internal/pkg: optional executable files
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m54s
Test / ShareFS (push) Successful in 4m2s
Test / Sandbox (race detector) (push) Successful in 5m33s
Test / Hakurei (race detector) (push) Successful in 6m48s
Test / Hakurei (push) Successful in 2m29s
Test / Flake checks (push) Successful in 1m10s

This enables a FileArtifact implementation to specify whether its resulting file should be executable. This change also implements shebang and ELF magic checks in the file artifact.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-07-23 17:10:22 +09:00
parent 67dbb68818
commit e0eec632d0
10 changed files with 93 additions and 36 deletions
+3
View File
@@ -91,6 +91,9 @@ func (c compoundCloser) Close() error {
return err
}
// IsExecutable returns false.
func (*decompressArtifact) IsExecutable() bool { return false }
// Cure returns a decompressor [io.ReadCloser].
func (a *decompressArtifact) Cure(r *RContext) (io.ReadCloser, error) {
sr, err := r.Open(a.f)