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

wheel unpack doesn't preserve permissions #505

Closed
hauntsaninja opened this issue Feb 14, 2023 · 6 comments · Fixed by #514
Closed

wheel unpack doesn't preserve permissions #505

hauntsaninja opened this issue Feb 14, 2023 · 6 comments · Fixed by #514

Comments

@hauntsaninja
Copy link
Contributor

I expected wheel unpack + wheel pack to result in similarly functioning wheels. However, wheel unpack doesn't seem to preserve permissions. That is, there's nothing in wheel that does this kind of thing: https://github.com/pypa/pip/blob/852deddb9c14afdb780e77ea28c2fa6d29f8c2e1/src/pip/_internal/utils/unpacking.py#L143

Is this intentional?

@agronholm
Copy link
Contributor

I'm not sure I should fix this. Do you have a strong use case for this? Normally only console scripts would be made executable, and that is already handled by the installer (pip or other tool).

@hauntsaninja
Copy link
Contributor Author

For various reasons, it's useful at work to change wheel versions to have a local version that includes build information. In https://github.com/hauntsaninja/change_wheel_version I was relying on wheel unpack + wheel pack to roundtrip the functionality of the wheel after I tweaked the metadata.

It turns out, some of the wheels we use ship executables inside of them, so this process broke these wheels (as installed by pip) when those executables stopped being executable.

Like you can see at https://github.com/pypa/pip/blob/852deddb9c14afdb780e77ea28c2fa6d29f8c2e1/src/pip/_internal/utils/unpacking.py#L143 , pip also takes care to preserve executable bits, even on things that are not console scripts.

I'm not sure what "strong" means to you, but this was a real use case and I think it's reasonable for users to expect wheel unpack + wheel pack to preserve the functionality of a wheel.

@agronholm
Copy link
Contributor

By executables you mean something else than console scripts? Like compiled binaries?

@hauntsaninja
Copy link
Contributor Author

Yeah, compiled binaries

@agronholm
Copy link
Contributor

Ok, good enough for me.

@hauntsaninja
Copy link
Contributor Author

Thank you for implementing this!

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.

2 participants