tvl-depot/tvix/eval/default.nix
Griffin Smith 645d0c06e5 feat(tvix/eval): Add a proc-macro for defining builtins
Add a single new proc macro to a new proc-macro crate,
`tvix-eval-proc-macros` for defining an inline module containing nix
builtins, and automatically generating a function within that module
which returns a list of those builtins as `tvix_eval::value::Builtin`.

Change-Id: Ie4afae438914d2af93d15637151a49b4c68aa352
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7198
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: Adam Joseph <adam@westernsemico.com>
Tested-by: BuildkiteCI
2022-11-08 13:42:37 +00:00

34 lines
893 B
Nix

{ depot, pkgs, lib, ... }:
lib.fix (self: depot.third_party.naersk.buildPackage (lib.fix (naerskArgs: {
src = depot.third_party.gitignoreSource ./.;
# see https://github.com/nix-community/naersk/issues/169
root = depot.nix.sparseTree ./. [ ./Cargo.lock ./Cargo.toml ];
doCheck = true;
# Tell the test suite where to find upstream nix, to compare eval results
# against
NIX_INSTANTIATE_BINARY_PATH = "${pkgs.nix}/bin/nix-instantiate";
meta.ci.targets = builtins.attrNames self.passthru;
copySources = [
"builtin-macros"
];
passthru.benchmarks = depot.third_party.naersk.buildPackage (naerskArgs // {
name = "tvix-eval-benchmarks";
doCheck = false;
cargoBuildOptions = opts: opts ++ [ "--benches" ];
copyBinsFilter = ''
select(.reason == "compiler-artifact" and any(.target.kind[] == "bench"; .))
'';
passthru = { };
});
}))
)