<#23654 Unconditional chmod in embedded_binary.py ...
# github-notifications
q
#23654 Unconditional chmod in embedded_binary.py prevents installation in a read-only area Issue created by svenier In our large, multi-user environment we want to pre-install Pants in a central area and extract the SCIE there so that all users don't have to unpack 200MB of sources into their
~/.cache
directory. We've done that by setting
$SCIE_BASE
prior to running the SCIE for the first time. When another user who does not have write permission to the SCIE_BASE area tries to run pants, it fails with a stack dump ending with:
Copy code
File "/home/svenier/.cache/pex/venvs/3/2e36ada10d83b19ee30b6b41f19b48589fb38dc1/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/lib/python3.14/site-packages/pants/engine/embedded_binary.py", line 20, in get_embedded_binary
    os.chmod(bin_path, 0o755)
    ~~~~~~~~^^^^^^^^^^^^^^^^^
PermissionError: [Errno 1] Operation not permitted: '/home/svenier/.cache/pex/venvs/3/2e36ada10d83b19ee30b6b41f19b48589fb38dc1/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/lib/python3.14/site-packages/pants/bin/sandboxer'
That chmod on line 20 of embedded_binary.py is unneeded in this situation, but it is unconditional. My proposal is to condition it on the file not being already executable. This is pants 2.33.0 running on Linux. PR coming shortly. pantsbuild/pants