diff --git a/Cargo.lock b/Cargo.lock index a79eaf2cbc3..8b11f339dc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -455,9 +455,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.20.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d458d63f0f0f482c8da9b7c8b76c21bd885a02056cc94c6404d861ca2b8206" +checksum = "1a2c5f3bf25ec225351aa1c8e230d04d880d3bd89dea133537dafad4ae291e5c" dependencies = [ "smallvec", "target-lexicon", @@ -1681,7 +1681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", - "hashbrown 0.16.0", + "hashbrown 0.15.5", "serde", "serde_core", ] @@ -2192,7 +2192,7 @@ dependencies = [ "futures-core", "futures-sink", "getrandom 0.3.3", - "hashbrown 0.16.0", + "hashbrown 0.15.5", "indexmap 2.11.4", "libc", "log", @@ -3427,9 +3427,9 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "target-spec" -version = "3.5.2" +version = "3.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b44840fc121ca20db81dadbb66d27ac9133a0d4756d674caa7da088ce89cbf2d" +checksum = "ca3da9f675d5be234979ba2352a72510ac5fcf4a99cc48b402cd7bba300ec764" dependencies = [ "cfg-expr", "guppy-workspace-hack", diff --git a/fixtures/custom-target/my-target-2.json b/fixtures/custom-target/my-target-2.json new file mode 100644 index 00000000000..10f4f8ba510 --- /dev/null +++ b/fixtures/custom-target/my-target-2.json @@ -0,0 +1,46 @@ +{ + "arch": "x86_64", + "cpu": "x86-64", + "crt-static-respected": true, + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", + "dynamic-linking": true, + "env": "gnu", + "has-rpath": true, + "has-thread-local": true, + "llvm-target": "x86_64-unknown-linux-gnu", + "max-atomic-width": 64, + "os": "linux", + "position-independent-executables": true, + "pre-link-args": { + "gcc": [ + "-m64" + ] + }, + "relro-level": "full", + "stack-probes": { + "kind": "inline-or-call", + "min-llvm-version-for-inline": [ + 16, + 0, + 0 + ] + }, + "static-position-independent-executables": true, + "supported-sanitizers": [ + "address", + "cfi", + "leak", + "memory", + "thread" + ], + "supported-split-debuginfo": [ + "packed", + "unpacked", + "off" + ], + "supports-xray": true, + "target-family": [ + "unix" + ], + "target-pointer-width": 64 +} diff --git a/nextest-filtering/src/errors.rs b/nextest-filtering/src/errors.rs index 9b18d94657a..33a11abe505 100644 --- a/nextest-filtering/src/errors.rs +++ b/nextest-filtering/src/errors.rs @@ -1,6 +1,10 @@ // Copyright (c) The nextest Contributors // SPDX-License-Identifier: MIT OR Apache-2.0 +// rust nightly 2025-10-12 complains that "value assigned to `kind` is never +// read", and this is the nearest location this works in. Maybe a miette issue? +#![allow(unused_assignments)] + use crate::expression::FiltersetKind; use miette::{Diagnostic, SourceSpan}; use std::fmt; diff --git a/nextest-runner/tests/integration/target_triple.rs b/nextest-runner/tests/integration/target_triple.rs index dc921bcde87..99151559bce 100644 --- a/nextest-runner/tests/integration/target_triple.rs +++ b/nextest-runner/tests/integration/target_triple.rs @@ -44,32 +44,41 @@ fn parses_cargo_env() { } static MY_TARGET_TRIPLE_STR: &str = "my-target"; +static MY_TARGET_2_TRIPLE_STR: &str = "my-target-2"; static MY_TARGET_JSON_PATH: &str = "../custom-target/my-target.json"; +static MY_TARGET_2_JSON_PATH: &str = "../custom-target/my-target-2.json"; +static MY_TARGET_PATHS: &[(&str, &str)] = &[ + (MY_TARGET_JSON_PATH, MY_TARGET_TRIPLE_STR), + (MY_TARGET_2_JSON_PATH, MY_TARGET_2_TRIPLE_STR), +]; #[test] fn parses_custom_target_cli() { // SAFETY: // https://nexte.st/docs/configuration/env-vars/#altering-the-environment-within-tests unsafe { std::env::set_var("CARGO_BUILD_TARGET", "x86_64-unknown-linux-musl") }; - let expected_path = workspace_root() - .join(MY_TARGET_JSON_PATH) - .canonicalize_utf8() - .expect("canonicalization succeeded"); - let triple = target_triple(Some(MY_TARGET_JSON_PATH), Vec::new()) - .unwrap() - .expect("platform found"); - assert_eq!( - triple.platform.triple_str(), - MY_TARGET_TRIPLE_STR, - "custom platform name" - ); - - assert!(triple.platform.is_custom(), "custom platform"); - assert_eq!(triple.source, TargetTripleSource::CliOption); - assert_eq!( - triple.location, - TargetDefinitionLocation::DirectPath(expected_path) - ); + for (target_path, expected_triple) in MY_TARGET_PATHS { + eprintln!("** testing: {}", target_path); + let expected_path = workspace_root() + .join(target_path) + .canonicalize_utf8() + .expect("canonicalization succeeded"); + let triple = target_triple(Some(target_path), Vec::new()) + .unwrap() + .expect("platform found"); + assert_eq!( + triple.platform.triple_str(), + *expected_triple, + "custom platform name" + ); + + assert!(triple.platform.is_custom(), "custom platform"); + assert_eq!(triple.source, TargetTripleSource::CliOption); + assert_eq!( + triple.location, + TargetDefinitionLocation::DirectPath(expected_path) + ); + } } #[test] @@ -77,76 +86,86 @@ fn parses_custom_target_env() { // SAFETY: // https://nexte.st/docs/configuration/env-vars/#altering-the-environment-within-tests unsafe { std::env::set_var("CARGO_BUILD_TARGET", MY_TARGET_JSON_PATH) }; - let expected_path = workspace_root() - .join(MY_TARGET_JSON_PATH) - .canonicalize_utf8() - .expect("canonicalization succeeded"); - let triple = target_triple(None, Vec::new()) - .unwrap() - .expect("platform found"); - assert_eq!( - triple.platform.triple_str(), - MY_TARGET_TRIPLE_STR, - "custom platform name" - ); - - assert!(triple.platform.is_custom(), "custom platform"); - assert_eq!(triple.source, TargetTripleSource::Env); - assert_eq!( - triple.location, - TargetDefinitionLocation::DirectPath(expected_path) - ); + for (target_path, expected_triple) in MY_TARGET_PATHS { + eprintln!("** testing: {}", target_path); + unsafe { std::env::set_var("CARGO_BUILD_TARGET", target_path) }; + let expected_path = workspace_root() + .join(target_path) + .canonicalize_utf8() + .expect("canonicalization succeeded"); + let triple = target_triple(None, Vec::new()) + .unwrap() + .expect("platform found"); + assert_eq!( + triple.platform.triple_str(), + *expected_triple, + "custom platform name" + ); + + assert!(triple.platform.is_custom(), "custom platform"); + assert_eq!(triple.source, TargetTripleSource::Env); + assert_eq!( + triple.location, + TargetDefinitionLocation::DirectPath(expected_path) + ); + } } #[test] fn parses_custom_target_cli_from_rust_target_path() { let target_paths = vec![workspace_root().join("../custom-target")]; - let expected_path = workspace_root() - .join(MY_TARGET_JSON_PATH) - .canonicalize_utf8() - .expect("canonicalization succeeded"); - let triple = target_triple(Some(MY_TARGET_TRIPLE_STR), target_paths) - .unwrap() - .expect("platform found"); - assert_eq!( - triple.platform.triple_str(), - MY_TARGET_TRIPLE_STR, - "custom platform name" - ); - - assert!(triple.platform.is_custom(), "custom platform"); - assert_eq!(triple.source, TargetTripleSource::CliOption); - assert_eq!( - triple.location, - TargetDefinitionLocation::RustTargetPath(expected_path) - ); + for (target_path, expected_triple) in MY_TARGET_PATHS { + eprintln!("** testing: {}", expected_triple); + let expected_path = workspace_root() + .join(target_path) + .canonicalize_utf8() + .expect("canonicalization succeeded"); + let triple = target_triple(Some(expected_triple), target_paths.clone()) + .unwrap() + .expect("platform found"); + assert_eq!( + triple.platform.triple_str(), + *expected_triple, + "custom platform name" + ); + + assert!(triple.platform.is_custom(), "custom platform"); + assert_eq!(triple.source, TargetTripleSource::CliOption); + assert_eq!( + triple.location, + TargetDefinitionLocation::RustTargetPath(expected_path) + ); + } } #[test] fn parses_custom_target_env_from_rust_target_path() { - // SAFETY: - // https://nexte.st/docs/configuration/env-vars/#altering-the-environment-within-tests - unsafe { std::env::set_var("CARGO_BUILD_TARGET", MY_TARGET_TRIPLE_STR) }; let target_paths = vec![workspace_root().join("../custom-target")]; - let expected_path = workspace_root() - .join(MY_TARGET_JSON_PATH) - .canonicalize_utf8() - .expect("canonicalization succeeded"); - let triple = target_triple(None, target_paths) - .unwrap() - .expect("platform found"); - assert_eq!( - triple.platform.triple_str(), - MY_TARGET_TRIPLE_STR, - "custom platform name" - ); - - assert!(triple.platform.is_custom(), "custom platform"); - assert_eq!(triple.source, TargetTripleSource::Env); - assert_eq!( - triple.location, - TargetDefinitionLocation::RustTargetPath(expected_path) - ); + for (target_path, expected_triple) in MY_TARGET_PATHS { + eprintln!("** testing: {}", expected_triple); + // SAFETY: + // https://nexte.st/docs/configuration/env-vars/#altering-the-environment-within-tests + unsafe { std::env::set_var("CARGO_BUILD_TARGET", expected_triple) }; + let expected_path = workspace_root() + .join(target_path) + .canonicalize_utf8() + .expect("canonicalization succeeded"); + let triple = target_triple(None, target_paths.clone()) + .unwrap() + .expect("platform found"); + assert_eq!( + triple.platform.triple_str(), + *expected_triple, + "custom platform name" + ); + + assert!(triple.platform.is_custom(), "custom platform"); + assert_eq!(triple.source, TargetTripleSource::Env); + assert_eq!( + triple.location, + TargetDefinitionLocation::RustTargetPath(expected_path) + ); + } } #[test] diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index adf2db876d9..586558be028 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -25,7 +25,7 @@ console = { version = "0.16.0" } either = { version = "1.15.0", features = ["use_std"] } form_urlencoded = { version = "1.2.2" } getrandom = { version = "0.3.3", default-features = false, features = ["std"] } -hashbrown = { version = "0.16.0", default-features = false, features = ["allocator-api2", "inline-more"] } +hashbrown = { version = "0.15.5" } indexmap = { version = "2.11.4", features = ["serde"] } log = { version = "0.4.28", default-features = false, features = ["std"] } memchr = { version = "2.7.5" } @@ -39,7 +39,7 @@ serde = { version = "1.0.228", features = ["alloc", "derive"] } serde_core = { version = "1.0.228", features = ["alloc"] } serde_json = { version = "1.0.145", features = ["unbounded_depth"] } smallvec = { version = "1.15.1", default-features = false, features = ["const_generics"] } -target-spec = { version = "3.5.2", default-features = false, features = ["custom", "summaries"] } +target-spec = { version = "3.5.4", default-features = false, features = ["custom", "summaries"] } target-spec-miette = { version = "0.4.5", default-features = false, features = ["fixtures"] } tokio = { version = "1.47.1", features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync", "time", "tracing"] } tracing-core = { version = "0.1.34" }