Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctx.actions.write generates executable files even when asked not to #2888

Open
endobson opened this issue Apr 25, 2017 · 7 comments
Open

ctx.actions.write generates executable files even when asked not to #2888

endobson opened this issue Apr 25, 2017 · 7 comments
Assignees
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: feature request

Comments

@endobson
Copy link
Contributor

Code:
https://gist.github.com/endobson/1fa9fe0ad27eeaa8296c17187165d642

  ctx.file_action(ctx.outputs.object, "object", False)

Output:

endobson@yggdrasil () ~/tmp/bazel-bug4 % ls -l bazel-bin/demo_rule.o
-r-xr-xr-x  1 endobson  wheel  6 Apr 25 10:03 bazel-bin/demo_rule.o

Using self built release 0.4.5:
Build label: 0.4.5- (@non-git)
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Apr 25 06:47:27 2017 (1493102847)
Build timestamp: 1493102847
Build timestamp as int: 1493102847

@vladmos vladmos added category: extensibility > skylark P1 I'll work on this now. (Assignee required) type: bug labels Apr 28, 2017
@laurentlb laurentlb added P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Starlark and removed P1 I'll work on this now. (Assignee required) category: extensibility > skylark labels Nov 21, 2018
@Profpatsch
Copy link
Contributor

See #6530

@endobson
Copy link
Contributor Author

endobson commented Dec 6, 2018

Even if this is desired behavior, then the docs should probably be fixed.

https://docs.bazel.build/versions/master/skylark/lib/actions.html#write

is_executable | bool
Whether the output file should be executable.

If this bit is not controlling the execute bit on the file, what is it controlling?

@EricCousineau-TRI
Copy link
Contributor

Relates #3359 (still)?

@brandjon brandjon changed the title ctx.file_action generates executable files even when asked not to. ctx.actions.write generates executable files even when asked not to Feb 15, 2021
@brandjon
Copy link
Member

Confirmed this is still the case.

I'm confused why we have these attributes at all if we always make outputs executable. This is both a documentation issue and a design issue.

@alexjski alexjski self-assigned this Apr 8, 2022
@brandjon brandjon added untriaged team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts and removed team-Build-Language labels Nov 4, 2022
@sgowroji sgowroji added the stale Issues or PRs that are stale (no activity for 30 days) label Feb 17, 2023
@sgowroji
Copy link
Member

Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen (or ping me to reopen) if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

@sgowroji sgowroji closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2023
@endobson
Copy link
Contributor Author

Can you explain why this is being closed? Your description makes it sound like that this is an old issue and 'stale' and those are the reasons for being closed. Those sound like a bad reasons, things don't stop becoming defects just because they are old.

#2888 (comment) showed that it reproduced still ~4 years after I initially filed it.

The open/closed bit should represent whether or not the issue is still impacting users/is a defect not whether or not there is bandwidth to fix the defect.

@georgegiovanni
Copy link

I agree with endobson.

@sgowroji sgowroji removed the stale Issues or PRs that are stale (no activity for 30 days) label Feb 17, 2023
@sgowroji sgowroji added the not stale Issues or PRs that are inactive but not considered stale label Feb 17, 2023
@sgowroji sgowroji reopened this Feb 17, 2023
@comius comius removed the untriaged label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not stale Issues or PRs that are inactive but not considered stale P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts type: feature request
Projects
None yet
Development

No branches or pull requests