4b00f1d7ac
We already evaluate this the same as Nix does, so worth adding it into CI. Change-Id: I529faccac6e5e16e0bc985ab4c3e0cd07bb23293 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8624 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de>
33 lines
1.1 KiB
Nix
33 lines
1.1 KiB
Nix
{ depot, pkgs, lib, ... }:
|
|
|
|
let
|
|
mkNixpkgsEvalCheck = attrset: expectedPath: {
|
|
label = ":nix: evaluate nixpkgs.${attrset} in tvix";
|
|
needsOutput = true;
|
|
|
|
command = pkgs.writeShellScript "tvix-eval-${builtins.replaceStrings [".drv"] ["-drv"] attrset}" ''
|
|
TVIX_OUTPUT=$(result/bin/tvix -E '(import ${pkgs.path} {}).${attrset}')
|
|
EXPECTED='${/* the verbatim expected Tvix output: */ "=> \"${expectedPath}\" :: string"}'
|
|
|
|
echo "Tvix output: ''${TVIX_OUTPUT}"
|
|
if [ "$TVIX_OUTPUT" != "$EXPECTED" ]; then
|
|
echo "Correct would have been ''${EXPECTED}"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Output was correct."
|
|
'';
|
|
};
|
|
in
|
|
|
|
(depot.tvix.crates.workspaceMembers.tvix-cli.build.override {
|
|
runTests = true;
|
|
}).overrideAttrs (_: {
|
|
meta = {
|
|
ci.extraSteps = {
|
|
eval-nixpkgs-stdenv-drvpath = (mkNixpkgsEvalCheck "stdenv.drvPath" pkgs.stdenv.drvPath);
|
|
eval-nixpkgs-stdenv-outpath = (mkNixpkgsEvalCheck "stdenv.outPath" pkgs.stdenv.outPath);
|
|
eval-nixpkgs-hello-outpath = (mkNixpkgsEvalCheck "hello.outPath" pkgs.hello.outPath);
|
|
};
|
|
};
|
|
})
|