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

rustup does not preserve permissions in toolchain components #1140

Closed
RalfJung opened this issue May 30, 2017 · 2 comments · Fixed by #1141
Closed

rustup does not preserve permissions in toolchain components #1140

RalfJung opened this issue May 30, 2017 · 2 comments · Fixed by #1141

Comments

@RalfJung
Copy link
Member

The rust-src component contains some files that are marked executable, e.g. src/jemalloc/include/jemalloc/internal/private_namespace.sh. When I download the component manually from https://static.rust-lang.org/dist/rust-src-nightly.tar.xz, I can see that the permissions are correct in that file (same for the .gz). However, ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/jemalloc/include/jemalloc/internal/private_namespace.sh is not executable, so permissions get lost somewhere on the way.

I am trying to figure out how rustup goes about extracting the tarball, but the code is so abstract I couldn't find the right place yet...

@RalfJung
Copy link
Member Author

This is related to rust-lang/rust#36488

@RalfJung
Copy link
Member Author

It seems to me like set_file_perms in package.rs, which is supposed to fix up permissions, actually screws them up :/

RalfJung added a commit to RalfJung/rustup.rs that referenced this issue May 30, 2017
bors added a commit that referenced this issue Jun 7, 2017
set_file_perms: if the file is already executable, keep it executable

This was the smallest change I could come up with to fix <rust-lang/rust#36488>: Maintain the X bit when fixing up permissions.

However, the code is still somewhat inconsistent in that it does apply different rules when applied to a file vs. when applied to a directory -- the code recursively walking the directory still removes the X bits from all files, just like it previously ignored the "bin" directory. If you want, I can refactor this some more to be consistent here.

Fixes: #1140
@bors bors closed this as completed in #1141 Jun 8, 2017
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

Successfully merging a pull request may close this issue.

1 participant