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

files extracted from zips are missing execute permissions #21044

Open
travisstaloch opened this issue Aug 12, 2024 · 3 comments
Open

files extracted from zips are missing execute permissions #21044

travisstaloch opened this issue Aug 12, 2024 · 3 comments
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@travisstaloch
Copy link
Contributor

Zig Version

0.14.0-dev.875+ebd0c6ffd

Steps to Reproduce and Observed Behavior

This issue was reported here. That project uses the package manager to download zips from https://github.com/protocolbuffers/protobuf/releases/. When I unzip one of the zip files manually, the permissions look fine.

-r-xr-xr-x 1 17M May 22 11:45 protoc

But with the package manager I guess they turn into the following as reported in the issue above.

-rw-r--r-- protoc

I asked @marler8997 about this and he said

I don't think I implemented the extension for unix file permissions.

So it sounds like this just hasn't been implemented yet. zip support was added in #19729.

Expected Behavior

Execute permissions should be preserved.

@travisstaloch travisstaloch added the bug Observed behavior contradicts documented or intended behavior label Aug 12, 2024
@travisstaloch travisstaloch changed the title extracted zip files are missing execute permissions files extracted from zips are missing execute permissions Aug 12, 2024
@andrewrk andrewrk added the contributor friendly This issue is limited in scope and/or knowledge of Zig internals. label Aug 12, 2024
@andrewrk andrewrk added this to the 0.14.0 milestone Aug 12, 2024
@andrewrk andrewrk added standard library This issue involves writing Zig code for the standard library. enhancement Solving this issue will likely involve adding new logic or components to the codebase. and removed bug Observed behavior contradicts documented or intended behavior labels Aug 12, 2024
@andrewrk
Copy link
Member

To be clear, the expected behavior from the package manager is to ignore permissions from the zip file and set the execute bit based on ELF header and shebang line alone (see #17463). I set the milestone to 0.14.0 in case that is not implemented correctly.

As for implementing extensions in the standard library, that's a separate issue.

@owenbrooks
Copy link

For MacOS, that zig-protobuf project downloads the protoc binary in Mach-O file format, so it doesn't get set to executable. Is it worth adding Mach-O header detection to the isExecutable check in addition to ELF and shebang?

@fabioarnold
Copy link
Contributor

Is it worth adding Mach-O header detection to the isExecutable check in addition to ELF and shebang?

I opened a PR here: #21555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

4 participants