Skip to content

Ensure regular file bit set in wheel archives#1731

Merged
aignas merged 7 commits intobazel-contrib:mainfrom
lamcw:thomaslam-fix-whlfile-mode
Jan 31, 2024
Merged

Ensure regular file bit set in wheel archives#1731
aignas merged 7 commits intobazel-contrib:mainfrom
lamcw:thomaslam-fix-whlfile-mode

Conversation

@lamcw
Copy link
Copy Markdown
Contributor

@lamcw lamcw commented Jan 30, 2024

#1453 added logic to manually set zipinfo for each file in the wheel archive. When wheel archives generated by _Whlfile are installed by the installer module (or pip), the file mode is inspected as such:

as 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_IFREG on the file mode for all files in the zip archive.

Fixes #1711

lamcw added 5 commits January 30, 2024 15:49
Signed-off-by: Thomas Lam <thomaslam@canva.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
.
Signed-off-by: Thomas Lam <thomaslam@canva.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
@lamcw lamcw marked this pull request as ready for review January 30, 2024 05:14
@lamcw lamcw requested a review from rickeylev as a code owner January 30, 2024 05:14
lamcw and others added 2 commits January 31, 2024 09:36
Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
@lamcw lamcw requested a review from aignas January 30, 2024 22:44
@aignas aignas added this pull request to the merge queue Jan 31, 2024
Merged via the queue into bazel-contrib:main with commit 8fba377 Jan 31, 2024
@lamcw lamcw deleted the thomaslam-fix-whlfile-mode branch February 1, 2024 01:06
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 this pull request may close these issues.

py_wheel fails to correctly set file permissions

2 participants