From a1cfdeb0efc338c69e0fe8f0b52bfde3f23da1b1 Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Tue, 22 Jul 2025 17:28:34 +0200 Subject: [PATCH] fix(nix-compat-derive-tests): Get rid of compile-tests flag Because we are now using mkCargoBuild to build this crate in CI we can get rid of the compile-tests flag and always run the compile tests. This is because the trybuild crate works when using the the same build method we used for rustdoc an clippy. Change-Id: I3f168a987a09bf6f3e3e7c1ab3aaa1acd9d010cf Reviewed-on: https://cl.snix.dev/c/snix/+/30651 Reviewed-by: Florian Klink Autosubmit: Brian Olsen Tested-by: besadii --- snix/Cargo.nix | 3 +-- snix/nix-compat-derive-tests/Cargo.toml | 3 --- snix/nix-compat-derive-tests/tests/ui.rs | 1 - .../tests/ui/deserialize_bad_type.stderr | 8 ++++---- .../tests/ui/deserialize_from_str_missing.stderr | 4 ++-- .../tests/ui/deserialize_try_from_missing.stderr | 2 +- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/snix/Cargo.nix b/snix/Cargo.nix index a415d62bd..dd7b7344e 100644 --- a/snix/Cargo.nix +++ b/snix/Cargo.nix @@ -8489,8 +8489,7 @@ rec { packageId = "trybuild"; } ]; - features = { }; - resolvedDefaultFeatures = [ "compile-tests" ]; + }; "nix-daemon" = rec { crateName = "nix-daemon"; diff --git a/snix/nix-compat-derive-tests/Cargo.toml b/snix/nix-compat-derive-tests/Cargo.toml index 9e4d319ee..871e9e97a 100644 --- a/snix/nix-compat-derive-tests/Cargo.toml +++ b/snix/nix-compat-derive-tests/Cargo.toml @@ -3,9 +3,6 @@ name = "nix-compat-derive-tests" version = "0.1.0" edition = "2024" -[features] -compile-tests = [] - [dev-dependencies] hex-literal.workspace = true pretty_assertions.workspace = true diff --git a/snix/nix-compat-derive-tests/tests/ui.rs b/snix/nix-compat-derive-tests/tests/ui.rs index 6a7bffeaf..870c2f95e 100644 --- a/snix/nix-compat-derive-tests/tests/ui.rs +++ b/snix/nix-compat-derive-tests/tests/ui.rs @@ -1,4 +1,3 @@ -#[cfg(feature = "compile-tests")] #[test] fn ui() { let t = trybuild::TestCases::new(); diff --git a/snix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr b/snix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr index 1bd224f38..42ba4d695 100644 --- a/snix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr +++ b/snix/nix-compat-derive-tests/tests/ui/deserialize_bad_type.stderr @@ -5,14 +5,14 @@ error[E0277]: the trait bound `BadType: NixDeserialize` is not satisfied | ^^^^^^^ the trait `NixDeserialize` is not implemented for `BadType` | = help: the following other types implement trait `NixDeserialize`: + AddToStoreNarRequest BTreeMap + CAHash ClientSettings IgnoredZero + NarHash Operation - StorePath - String - Test - Vec + Option and $N others note: required by a bound in `try_read_value` --> $WORKSPACE/nix-compat/src/wire/de/mod.rs diff --git a/snix/nix-compat-derive-tests/tests/ui/deserialize_from_str_missing.stderr b/snix/nix-compat-derive-tests/tests/ui/deserialize_from_str_missing.stderr index f68f58801..3cf99da5c 100644 --- a/snix/nix-compat-derive-tests/tests/ui/deserialize_from_str_missing.stderr +++ b/snix/nix-compat-derive-tests/tests/ui/deserialize_from_str_missing.stderr @@ -5,12 +5,12 @@ error[E0277]: the trait bound `Test: FromStr` is not satisfied | ^^^^^^^^ the trait `FromStr` is not implemented for `Test` | = help: the following other types implement trait `FromStr`: + ByteString + CString IpAddr Ipv4Addr Ipv6Addr NonZero NonZero NonZero - NonZero - NonZero and $N others diff --git a/snix/nix-compat-derive-tests/tests/ui/deserialize_try_from_missing.stderr b/snix/nix-compat-derive-tests/tests/ui/deserialize_try_from_missing.stderr index 9605d1f33..dbb24b613 100644 --- a/snix/nix-compat-derive-tests/tests/ui/deserialize_try_from_missing.stderr +++ b/snix/nix-compat-derive-tests/tests/ui/deserialize_try_from_missing.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `Test: From` is not satisfied --> tests/ui/deserialize_try_from_missing.rs:4:18 | 4 | #[nix(try_from = "u64")] - | ^^^^^ the trait `From` is not implemented for `Test`, which is required by `Test: TryFrom` + | ^^^^^ the trait `From` is not implemented for `Test` | = note: required for `u64` to implement `Into` = note: required for `Test` to implement `TryFrom`