tvix/eval: cargo test -p tvix-eval --test nix_oracle fails when invoked with non-Nix 2.3

#313
Opened by flokli at 2023-10-05T09·08+00

❯ cargo test -p tvix-eval --test nix_oracle
    Finished test [unoptimized + debuginfo] target(s) in 0.08s
     Running tests/nix_oracle.rs (target/debug/deps/nix_oracle-e42de0ccbcfb89de)

running 28 tests
test thunked_attr_set_in_list ... ok
test thunked_formals_fallback_application ... ok
test thunked_if_in_list ... ok
test thunked_assert_in_list ... ok
test add_ints ... ok
test add_lists ... ok
test thunked_has_attrs_in_list ... ok
test thunked_function_application_in_list ... ok
test thunked_formals_fallback_name_resolution_literal ... FAILED
test thunked_bin_ops_in_list ... ok
test add_paths ... ok
test literal_int ... ok
test thunked_legacy_let_in_list ... ok
test thunked_let_in_list ... ok
test thunked_with_in_list ... ok
test thunked_select_in_list ... ok
test thunked_unary_ops_in_list ... ok
test unthunked_absolute_path ... ok
test thunked_list_in_list ... ok
test thunked_lambda_in_list ... ok
test unthunked_formals_fallback_literal ... ok
test unthunked_formals_fallback_string_literal ... ok
test unthunked_home_relative_path ... ok
test unthunked_identifier_in_list ... ok
test unthunked_path_in_list ... ok
test unthunked_relative_path ... ok
test unthunked_literals_in_list ... ok
test unthunked_string_literal_in_list ... ok

failures:

---- thunked_formals_fallback_name_resolution_literal stdout ----
thread 'thunked_formals_fallback_name_resolution_literal' panicked at 'assertion failed: `(left == right)`

Diff < left / right > :
<[ 12 ]
>[ <CODE> ]

', eval/tests/nix_oracle.rs:113:1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    thunked_formals_fallback_name_resolution_literal

test result: FAILED. 27 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s

❯ nix --version
nix (Nix) 2.17.0

(and has been happening for quite a while)

I mean, sure, this might be expected - but even when not running Nix 2.3, a cargo test should probably not be red.

We could probably skip running this test if we run on non-Nix 2.3 (or the entire test alltogether), similar to how we skip the fuse tests if we're running inside the Nix sandbox - and generally log a warning to stderr or so.

  1. This is interesting and potentially problematic since it indicates variable resolution got lazier in C++ Nix in a strange way. Probably good that it fails, warrants some investigation.

    sterni at 2023-12-13T16·13+00