From 8821746d6c6c1b71774727fe1103425d903952bb Mon Sep 17 00:00:00 2001 From: Aspen Smith Date: Sun, 7 Jul 2024 09:21:52 -0400 Subject: fix(tvix/repl): Share globals and sourcemap across evaluations Now that we can bind (potentially lazy, potentially lambda-containing) values in the REPL and then reference them in subsequent evaluations, it's important that the values to which we construct shared references are shared across those subsequent evaluations - otherwise, we get panics due to unknown source map locations, or dropped weak references to globals. This change assigns both the globals and the source map as fields on the Repl after the first evaluation, and then passes those in (to the EvaluationBuilder) on subsequent evaluations. On the EvaluationBuilder side, there's some panicking introduced - this is intentional, as my intent is for the builder to be configured statically enough that panicking is the best way to report errors here (it's always a bug to misconfigure an Evaluation, and we'd never want to handle it dynamically). Change-Id: I37225697235c22b683ca48a17d30fa8fedd12d1b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11960 Reviewed-by: flokli Autosubmit: aspen Tested-by: BuildkiteCI --- tvix/utils.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tvix/utils.nix') diff --git a/tvix/utils.nix b/tvix/utils.nix index 7adf8fe99733..1548d4de05b6 100644 --- a/tvix/utils.nix +++ b/tvix/utils.nix @@ -78,7 +78,10 @@ }; tvix-cli = prev: { - src = depot.tvix.utils.filterRustCrateSrc { root = prev.src.origSrc; }; + src = depot.tvix.utils.filterRustCrateSrc rec { + root = prev.src.origSrc; + extraFileset = root + "/tests"; + }; buildInputs = lib.optional pkgs.stdenv.isDarwin commonDarwinDeps; }; -- cgit 1.4.1