From d38e6502adf9a3429a392c2f6ad9c787853d31c1 Mon Sep 17 00:00:00 2001 From: edef Date: Tue, 10 Oct 2023 19:56:11 +0000 Subject: fix(third_party/crate2nix): run tests in debug mode Behave like `cargo test` rather than `cargo test --release`. Change-Id: Ie013d04ac68d7dec2a3b870fa9f0060a70a9635d Reviewed-on: https://cl.tvl.fyi/c/depot/+/9621 Reviewed-by: flokli Tested-by: BuildkiteCI --- third_party/overlays/patches/crate2nix-tests-debug.patch | 12 ++++++++++++ third_party/overlays/tvl.nix | 5 +++++ tvix/Cargo.nix | 1 + 3 files changed, 18 insertions(+) create mode 100644 third_party/overlays/patches/crate2nix-tests-debug.patch diff --git a/third_party/overlays/patches/crate2nix-tests-debug.patch b/third_party/overlays/patches/crate2nix-tests-debug.patch new file mode 100644 index 0000000000..384178c805 --- /dev/null +++ b/third_party/overlays/patches/crate2nix-tests-debug.patch @@ -0,0 +1,12 @@ +diff --git a/templates/nix/crate2nix/default.nix b/templates/nix/crate2nix/default.nix +index 4eefda8..d064118 100644 +--- a/templates/nix/crate2nix/default.nix ++++ b/templates/nix/crate2nix/default.nix +@@ -111,6 +111,7 @@ rec { + ( + _: { + buildTests = true; ++ release = false; + } + ); + # If the user hasn't set any pre/post commands, we don't want to diff --git a/third_party/overlays/tvl.nix b/third_party/overlays/tvl.nix index c88bd4d741..4dfd72eceb 100644 --- a/third_party/overlays/tvl.nix +++ b/third_party/overlays/tvl.nix @@ -120,6 +120,11 @@ depot.nix.readTree.drvTargets { hash = "sha256-eFT2SUxTopxEvW0rcxSjQU6nbrQLI2FbyaVgtV8oiTk="; }; + patches = old.patches ++ [ + # run tests in debug mode, not release mode + ./patches/crate2nix-tests-debug.patch + ]; + cargoDeps = old.cargoDeps.overrideAttrs (_: { inherit src; outputHash = "sha256-elEIWHxyY3iccprIcbQA6GWFiq/n5kozpGfw/OmoSIg="; diff --git a/tvix/Cargo.nix b/tvix/Cargo.nix index a13f130371..548eef65c1 100644 --- a/tvix/Cargo.nix +++ b/tvix/Cargo.nix @@ -10917,6 +10917,7 @@ rec { ( _: { buildTests = true; + release = false; } ); # If the user hasn't set any pre/post commands, we don't want to -- cgit 1.4.1