Declare consumed compiler inputs through the existing checked recipe (#931)
This commit is contained in:
parent
7545f7392d
commit
e5232098aa
@@ -0,0 +1,73 @@
|
||||
{
|
||||
pkgs,
|
||||
library,
|
||||
nixpkgsNarHash,
|
||||
}:
|
||||
let
|
||||
comparisonIdentity = import ../tools/local-first/derivation-identity.nix;
|
||||
source = pkgs.lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = pkgs.lib.fileset.unions [
|
||||
./src
|
||||
./test
|
||||
./grammar
|
||||
./proto
|
||||
./nix
|
||||
./package.json
|
||||
./yarn.lock
|
||||
./.yarnrc.yml
|
||||
./.yarn/plugins
|
||||
./tsconfig.json
|
||||
./tsconfig.build.json
|
||||
./tsconfig.test.json
|
||||
./default.nix
|
||||
./yarn-project.nix
|
||||
./flake.nix
|
||||
./README.md
|
||||
];
|
||||
};
|
||||
inputs = pkgs.writeText "protocol-source-inputs.json" (
|
||||
builtins.toJSON {
|
||||
inherit source nixpkgsNarHash;
|
||||
nixpkgs = pkgs.path;
|
||||
system = pkgs.stdenv.hostPlatform.system;
|
||||
expected = comparisonIdentity library;
|
||||
yarn = comparisonIdentity library.yarn-freestanding;
|
||||
}
|
||||
);
|
||||
closure = pkgs.closureInfo { rootPaths = [ pkgs.path ]; };
|
||||
in
|
||||
pkgs.runCommand "quixos-protocol-source-check"
|
||||
{
|
||||
nativeBuildInputs = [
|
||||
pkgs.nodejs_24
|
||||
pkgs.nix
|
||||
];
|
||||
passthru.ciDiagnosticArtifacts."protocol-source.json" = {
|
||||
file = "protocol-source.json";
|
||||
maxBytes = 8192;
|
||||
};
|
||||
}
|
||||
''
|
||||
# The ordinary compiler still owns all tests and emitted fixtures. Finish
|
||||
# that same checked build before the new identity-only evaluations.
|
||||
test -e ${library}
|
||||
export HOME="$TMPDIR/home"
|
||||
export NIX_STATE_DIR="$TMPDIR/nix-state"
|
||||
export NIX_LOG_DIR="$TMPDIR/nix-log"
|
||||
export NIX_CONF_DIR="$TMPDIR/nix-conf"
|
||||
export NIX_USER_CONF_FILES=/dev/null
|
||||
export NIX_CONFIG='experimental-features = nix-command flakes
|
||||
substituters =
|
||||
builders =
|
||||
max-jobs = 0
|
||||
allow-import-from-derivation = false
|
||||
accept-flake-config = false'
|
||||
export QUIXOS_PROTOCOL_EVALUATION_STORE="$TMPDIR/evaluation-store"
|
||||
mkdir -p "$HOME" "$NIX_STATE_DIR" "$NIX_LOG_DIR" "$NIX_CONF_DIR" "$QUIXOS_PROTOCOL_EVALUATION_STORE/nix/store"
|
||||
while IFS= read -r dependency; do
|
||||
cp -a --no-preserve=ownership "$dependency" "$QUIXOS_PROTOCOL_EVALUATION_STORE$dependency"
|
||||
done < ${closure}/store-paths
|
||||
nix-store --store "local?root=$QUIXOS_PROTOCOL_EVALUATION_STORE" --load-db < ${closure}/registration
|
||||
timeout --kill-after=5s 180s node ${./source-qualification.mjs} ${inputs} "$out"
|
||||
''
|
||||
Reference in New Issue
Block a user