internal/pkg: optional executable files

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:
cat
2026-07-23 17:10:22 +09:00
parent 67dbb68818
commit e0eec632d0
10 changed files with 93 additions and 36 deletions
+1 -2
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"io"
"io/fs"
"math"
"reflect"
"testing"
@@ -154,7 +153,7 @@ func TestRevision(t *testing.T) {
p := buf.Bytes()
p[8] = 0xfd
wantErr := pkg.RevisionError{math.MaxUint64 - 2, math.MaxUint64}
wantErr := pkg.RevisionError{0xfd, 0}
if _, err := c.NewDecoder(
bytes.NewReader(p),
).Decode(); !reflect.DeepEqual(err, wantErr) {