Ensure regular file bit set in wheel archives#1731
Merged
aignas merged 7 commits intobazel-contrib:mainfrom Jan 31, 2024
Merged
Ensure regular file bit set in wheel archives#1731aignas merged 7 commits intobazel-contrib:mainfrom
aignas merged 7 commits intobazel-contrib:mainfrom
Conversation
Signed-off-by: Thomas Lam <thomaslam@canva.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
aignas
reviewed
Jan 30, 2024
Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
aignas
approved these changes
Jan 31, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1453 added logic to manually set zipinfo for each file in the wheel archive. When wheel archives generated by
_Whlfileare installed by theinstallermodule (orpip), the file mode is inspected as such:installer: https://github.com/pypa/installer/blob/fcc0d6f14f99974316c2e490cead07a9a0b7a6ac/src/installer/sources.py#L318-L321pip: https://github.com/pypa/pip/blob/0f21fb92/src/pip/_internal/utils/unpacking.py#L96-L100as you can tell, if the regular file bit is not set, the installer thinks that the file being installed is not an executable and therefore the executable bit will not be preserved when the file from wheel is extracted onto the host filesystem.
Since all files being archived into Whlfile are regular files anyway, we set
S_IFREGon the file mode for all files in the zip archive.Fixes #1711