diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-12 15:10:43 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-12 15:11:17 +0900 |
| commit | 6643cfbeee181ee1bd543e2b3783bb5a8c01ad13 (patch) | |
| tree | 04b1b3b1d3fa044a1f8d5097355fa2779fe95af9 /internal/rosa/rosa.go | |
| parent | dcde38f2e967ebf14a3c8a7f933b7dd1bf465566 (diff) | |
internal/pkg: optionally measure exec artifact
Useful for verifying deterministic output without enabling network access.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
| -rw-r--r-- | internal/rosa/rosa.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index 6bf51fcb..740746cf 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -220,6 +220,8 @@ const ( TEarly // TNoToolchain excludes the LLVM toolchain. TNoToolchain + // THostNet arranges for a [pkg.KindExecNet] to be created. + THostNet ) var ( @@ -325,7 +327,9 @@ mkdir -vp /work/system/bin } return pkg.NewExec( - name, arch, knownChecksum, pkg.ExecTimeoutMax, flag&TExclusive != 0, + name, arch, knownChecksum, pkg.ExecTimeoutMax, + flag&THostNet != 0, + flag&TExclusive != 0, fhs.AbsRoot, env, AbsSystem.Append("bin", "sh"), []string{"sh", absCureScript.String()}, @@ -408,6 +412,9 @@ type Helper interface { // PackageAttr holds build-system-agnostic attributes. type PackageAttr struct { + // Measure output if populated. Required by [THostNet]. + KnownChecksum *pkg.Checksum + // Mount the source tree writable. Writable bool // Do not pass through [Toolchain.NewPatchedSource]. @@ -545,7 +552,7 @@ cd '/usr/src/` + name + `/' name+"-"+version, attr.Flag, extraRes, - nil, + attr.KnownChecksum, attr.Env, scriptEarly+helper.script(name), slices.Concat(attr.Paths, []pkg.ExecPath{ |
