bazel icon indicating copy to clipboard operation
bazel copied to clipboard

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

Open endobson opened this issue 9 years ago • 7 comments

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

endobson avatar Apr 25 '17 17:04 endobson

See https://github.com/bazelbuild/bazel/issues/6530

Profpatsch avatar Dec 06 '18 09:12 Profpatsch

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?

endobson avatar Dec 06 '18 16:12 endobson

Relates #3359 (still)?

EricCousineau-TRI avatar Apr 28 '20 22:04 EricCousineau-TRI

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.

brandjon avatar Feb 15 '21 21:02 brandjon

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 avatar Feb 17 '23 05:02 sgowroji

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.

https://github.com/bazelbuild/bazel/issues/2888#issuecomment-779458934 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.

endobson avatar Feb 17 '23 16:02 endobson

I agree with endobson.

georgegiovanni avatar Feb 17 '23 18:02 georgegiovanni