Files downloaded via --experimental_remote_download_regex are not executable.
Description of the bug:
When building with --remote_download_outputs={minimal,toplevel} --experimental_remote_download_regex=..., files which are downloaded because of matching --experimental_remote_download_regex (but not those picked up as top-level outputs, thankfully) do not have their executable bit set.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
$ bazel build --remote_download_outputs=minimal --nobuild_runfile_links --experimental_remote_download_regex='.*/bin/python3.9' //:...
...
$ ls -l bazel-out/*/bin/external/anaconda/bin/python3.9
-rw-r--r--. 1 adam.azarchs unix_devs 15733456 Aug 26 14:21 bazel-out/host/bin/external/anaconda/bin/python3.9
-rw-r--r--. 1 adam.azarchs unix_devs 15733456 Aug 26 14:21 bazel-out/k8-fastbuild/bin/external/anaconda/bin/python3.9
-rw-r--r--. 1 adam.azarchs unix_devs 15733456 Aug 26 14:21 bazel-out/k8-fastbuild-ST-829df9883741/bin/external/anaconda/bin/python3.9
-rw-r--r--. 1 adam.azarchs unix_devs 15733456 Aug 26 14:21 bazel-out/k8-opt-exec-3B763B72/bin/external/anaconda/bin/python3.9
-rw-r--r--. 1 adam.azarchs unix_devs 15733456 Aug 26 14:21 bazel-out/k8-opt-exec-3B763B72-ST-829df9883741/bin/external/anaconda/bin/python3.9
Which operating system are you running Bazel on?
Linux
What is the output of bazel info release?
release 5.3.0
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
cc @lfpino @anfelbar
@coeuvre you can assign me to this one if you want :)
Hi @adam-azarchs, Could you please provide complete steps to reproduce the above issue with code repo. Thanks!
Unfortunately our affected repos are closed source. If necessary I can try to cobble together a minimum reproducer, but I probably won't have time to do that that until later next week.
@lfpino Thanks! Please take a look! I'm happy to review the fix.
@coeuvre I can reproduce this with bazel sync --experimental_repository_resolved_file=tools/thirdparty/repositories.bzl --remote_download_minimal and an empty WORKSPACE file, I think the remote_download_minimal is confusing things because its an aggregate.
Should be fixed with recent changes.