Provide independent source tree references for the sandbox P1 checks
This commit is contained in:
@@ -162,6 +162,7 @@
|
||||
checks.tests = craneLib.mkCargoDerivation (common // wasiCcEnv // {
|
||||
inherit cargoArtifacts;
|
||||
pnameSuffix = "-test";
|
||||
nativeBuildInputs = common.nativeBuildInputs ++ [ pkgs.git ];
|
||||
doCheck = true;
|
||||
buildPhaseCargoCommand = "";
|
||||
# Keep the same sandbox-compatible modules in the shared host test executable.
|
||||
@@ -175,6 +176,15 @@
|
||||
preCheck = ''
|
||||
export SAUSAGE_CACHE="$TMPDIR/sausage-cache"
|
||||
export CARGO_TARGET_DIR="$PWD/target"
|
||||
export RUST_BACKTRACE=1
|
||||
# Flake sources omit Git history. Map the recorded revision to independently
|
||||
# staged source trees for P1's directory-hash comparison.
|
||||
cp -r ${userlandSrc}/agents ${userlandSrc}/skills ${userlandSrc}/extensions .
|
||||
git init --quiet
|
||||
git add agents skills extensions
|
||||
git -c user.name=Sausage -c user.email=sausage@localhost \
|
||||
commit --no-gpg-sign --quiet -m 'Flake source trees'
|
||||
git update-ref refs/replace/${revision} HEAD
|
||||
mkdir -p target/userland
|
||||
ln -s ${userland} target/bundle
|
||||
ln -s ${userland} target/userland/bundle
|
||||
|
||||
Reference in New Issue
Block a user