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

Inconsistent directory permissions in bazel cache: user has no permissions to delete generated files #2053

Open
miklelappo opened this issue Jul 10, 2024 · 3 comments

Comments

@miklelappo
Copy link

miklelappo commented Jul 10, 2024

🐞 bug report

Affected Rule

I guess bootstrap python

ls -la ~/.cache/bazel/_bazel_mlappo/3c5c24edab0df70f75e12e6adf52c6d8/external/rules_python\~\~python\~python_3_11_x86_64-unknown-linux-gnu    
total 72
drwxr-xr-x   6 mlappo mlappo  4096 Jul  8 21:34 .
drwxr-xr-x 143 mlappo mlappo 36864 Jul 10 09:09 ..
drwxr-xr-x   2 mlappo mlappo  4096 Jul  8 21:34 bin
-rwxr-xr-x   1 mlappo mlappo  2752 Jul  8 21:34 BUILD.bazel
drwxr-xr-x   3 mlappo mlappo  4096 Jul  8 21:34 include
dr-xr-xr-x  10 mlappo mlappo  4096 Jul  8 21:34 lib
lrwxrwxrwx   1 mlappo mlappo   151 Jul  8 21:34 python -> /home/mlappo/.cache/bazel/_bazel_mlappo/3c5c24edab0df70f75e12e6adf52c6d8/external/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu/bin/python3
-rw-r--r--   1 mlappo mlappo     0 Jul  8 21:34 REPO.bazel
drwxr-xr-x   3 mlappo mlappo  4096 Jul  8 21:34 share
-rwxr-xr-x   1 mlappo mlappo   100 Jul  8 21:34 STANDALONE_INTERPRETER
-rw-r--r--   1 mlappo mlappo     0 Jul  8 21:34 WORKSPACE

dr-xr-xr-x 10 mlappo mlappo 4096 Jul 8 21:34 lib

Is this a regression?

Don't know

Description

Specified directory and shared object are marked as read-only for current user (user performed the build)

🔬 Minimal Reproduction

bazel build //... with having i.e. wheel creation

🌍 Your Environment

Operating System:

  
uname -a
Linux mlappo-mobl 6.9.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 05 Jul 2024 22:11:24 +0000 x86_64 GNU/Linux
  

Output of bazel version:

  
bazel version
Bazelisk version: v1.11.0
WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE.
Starting local Bazel server and connecting to it...
Build label: 7.2.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Jun 10 13:04:32 2024 (1718024672)
Build timestamp: 1718024672
Build timestamp as int: 1718024672
  

Rules_python version:

  
0.33.2
  

Anything else relevant?

@miklelappo
Copy link
Author

Also the files inside. This one looks correct:

ls -la ~/.cache/bazel/_bazel_mlappo/3c5c24edab0df70f75e12e6adf52c6d8/external/rules_python\~\~python\~python_3_11_x86_64-unknown-linux-gnu/bin/python3.11 
-rwxrwxr-x 1 mlappo mlappo 20944 Jan  1  2024 /home/mlappo/.cache/bazel/_bazel_mlappo/3c5c24edab0df70f75e12e6adf52c6d8/external/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu/bin/python3.11

While this one doesn't

ls -la ~/.cache/bazel/_bazel_mlappo/3c5c24edab0df70f75e12e6adf52c6d8/external/rules_python\~\~python\~python_3_11_x86_64-unknown-linux-gnu/lib/libpython3.so 
-r-xr-xr-x 1 mlappo mlappo 16800 Jan  1  2024 /home/mlappo/.cache/bazel/_bazel_mlappo/3c5c24edab0df70f75e12e6adf52c6d8/external/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu/lib/libpython3.so

@aignas
Copy link
Collaborator

aignas commented Jul 10, 2024

This is a feature and is currently discussed in #2016 and the associated issue.

@miklelappo
Copy link
Author

@aignas does that mean that read-only-executable permissions only on some files/folders are expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants