Skip to content

package manager: set executable bit #19554

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

Merged
merged 1 commit into from
Apr 6, 2024
Merged

Conversation

ianic
Copy link
Contributor

@ianic ianic commented Apr 5, 2024

Based on file content. Detects elf magic header or shebang line.

Executable bit is ignored in hash calculation, as it was before this. So packages hashes are not changed.

Reference: #17463 (comment)

Fixes: #17463

Test is here.

Based on file content. Detects elf magic header or shebang line.

Executable bit is ignored in hash calculation, as it was before this. So
packages hashes are not changed.

Reference:
ziglang#17463 (comment)

Fixes: 17463

Test is here:
https://github.com/ianic/zig-fetch-test/blob/7c4600d7bb263f9b72fe3d0b70071f42be89e25c/src/main.zig#L307
(if ziglang#19500 got accepted I'll move this test to the Fetch.zig)
Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@@ -1746,3 +1744,37 @@ test {
_ = Filter;
_ = FileType;
}

// Detects executable header: ELF magic header or shebang line.
const FileHeader = struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a delightful little abstraction. I love it!

@andrewrk andrewrk merged commit 34bb670 into ziglang:master Apr 6, 2024
10 checks passed
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.

make packages fetched by zig set the executable bit based on ELF header and shebang line
2 participants