diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-11-23 18:14:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-11-23 18:14:48 +0900 |
| commit | ca6d417715000d25439e7c46403267b6e3723036 (patch) | |
| tree | 5d100742eb36f89554d8b10c5910ea4711e4da66 /internal | |
| parent | 33f43117c6e6b53efa9226c276f416348fc2d63b (diff) | |
cmd/dist: enable testing when cross-compiling
This uses emulator specified via the environment. This change also
reinstates seccomp filter checksums of build-only targets.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/rosa/package/hakurei.az | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/internal/rosa/package/hakurei.az b/internal/rosa/package/hakurei.az index 3ffef1c6..df8c5209 100644 --- a/internal/rosa/package/hakurei.az +++ b/internal/rosa/package/hakurei.az @@ -49,13 +49,18 @@ GOARCH='`+arch+`' CGO_ENABLED=0 go build -trimpath -tags=rosa -o /work`+prefix+` -buildid= -X main.hakureiPath=`+prefix+`/bin/hakurei " ./cmd/hsu`; - check = arch { - default = ` + check = ` echo echo '##### Testing hakurei.' -go test -ldflags='-buildid= -linkmode external -extldflags=-static' ./...`; - cross = unset; - }; +GOARCH='`+arch+`' go test`+arch { + default = ""; + cross = " "+ + "-tags=qemu "+ + "-exec='qemu-"+linuxArch+" -L "+prefix+"/"+arch+"'"; + }+` -ldflags='`+arch { + default = "-buildid= -linkmode external -extldflags=-static"; + cross = "-buildid= -linkmode internal"; + }+`' ./...`; install = ` chmod 4511 /work`+prefix+`/bin/hsu `; @@ -82,6 +87,8 @@ chmod 4511 /work`+prefix+`/bin/hsu ]; runtime = nil; + + native = [ qemu ]; } package hakurei-dist { @@ -104,8 +111,10 @@ package hakurei-dist { chdir = false; cross = ` unset CC CXX -export HAKUREI_ARCH='`+arch+`' -export HAKUREI_SYSROOT='`+prefix+`/`+arch+`' +export \ + HAKUREI_ARCH='`+arch+`' \ + HAKUREI_SYSROOT='`+prefix+`/`+arch+`' \ + HAKUREI_EMULATOR='qemu-`+linuxArch+` -L `+prefix+`/`+arch+`' `; build = ` NAME=make`; @@ -137,6 +146,8 @@ DESTDIR=/work "./${NAME}.sh" ]; runtime = nil; + + native = [ qemu ]; } package hakurei-dist-race { |
