Skip to content

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

@andrewrk

Description

@andrewrk

Extracted from #17392.

Depends on #17462.

This issue is to eliminate this TODO comment:

zig/src/Package/Fetch.zig

Lines 1058 to 1063 in f7bc55c

// TODO: we would like to set this to executable_bit_only, but two
// things need to happen before that:
// 1. the tar implementation needs to support it
// 2. the hashing algorithm here needs to support detecting the is_executable
// bit on Windows from the ACLs (see the isExecutable function).
.mode_mode = .ignore,

Currently, all the mode bits of all files in a package are ignored and a default mode is used instead. This is desired, except the executable bit should be set based on whether the file is an ELF file or has a shebang line, when unpacking on a posix operating system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.os-windowsMicrosoft Windowsstandard libraryThis issue involves writing Zig code for the standard library.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions