From 3927778ea97df2ffce3684cd0773d46a8a39af5d Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Mon, 27 Oct 2025 13:17:06 -0400 Subject: [PATCH] cargo-nextest: Avoid usdt on macos entirely usdt depends on dtrace for macos which is unsupported in nixpkgs, so need to avoid. Disable by patching so future updates will likely fail to apply the patch if anything changes here. --- .../ca/cargo-nextest/no-dtrace-macos.patch | 62 +++++++++++++++++++ pkgs/by-name/ca/cargo-nextest/package.nix | 6 ++ 2 files changed, 68 insertions(+) create mode 100644 pkgs/by-name/ca/cargo-nextest/no-dtrace-macos.patch diff --git a/pkgs/by-name/ca/cargo-nextest/no-dtrace-macos.patch b/pkgs/by-name/ca/cargo-nextest/no-dtrace-macos.patch new file mode 100644 index 000000000000..ffd49c79d4dc --- /dev/null +++ b/pkgs/by-name/ca/cargo-nextest/no-dtrace-macos.patch @@ -0,0 +1,62 @@ +diff --git a/nextest-runner/Cargo.toml b/nextest-runner/Cargo.toml +index 776c9341..06196bd2 100644 +--- a/nextest-runner/Cargo.toml ++++ b/nextest-runner/Cargo.toml +@@ -118,7 +118,7 @@ nix.workspace = true + # + # Also, usdt 0.6.0 fails to compile on x86_64-apple-darwin, so restrict it to + # aarch64-apple-darwin. +-[target.'cfg(any(all(target_arch = "x86_64", any(target_os = "linux", target_os = "freebsd", target_os = "illumos")), all(target_arch = "aarch64", any(target_os = "macos", target_os = "freebsd", target_os = "illumos"))))'.dependencies] ++[target.'cfg(any(all(target_arch = "x86_64", any(target_os = "linux", target_os = "freebsd", target_os = "illumos")), all(target_arch = "aarch64", any(target_os = "freebsd", target_os = "illumos"))))'.dependencies] + usdt = "0.6.0" + + [target.'cfg(windows)'.dependencies] +diff --git a/nextest-runner/src/usdt.rs b/nextest-runner/src/usdt.rs +index 7732eeb4..af69015b 100644 +--- a/nextest-runner/src/usdt.rs ++++ b/nextest-runner/src/usdt.rs +@@ -28,7 +28,7 @@ use serde::Serialize; + ), + all( + target_arch = "aarch64", +- any(target_os = "macos", target_os = "freebsd", target_os = "illumos") ++ any(target_os = "freebsd", target_os = "illumos") + ) + ))] + pub fn register_probes() -> Result<(), usdt::Error> { +@@ -43,7 +43,7 @@ pub fn register_probes() -> Result<(), usdt::Error> { + ), + all( + target_arch = "aarch64", +- any(target_os = "macos", target_os = "freebsd", target_os = "illumos") ++ any(target_os = "freebsd", target_os = "illumos") + ) + )))] + pub fn register_probes() -> Result<(), std::convert::Infallible> { +@@ -57,7 +57,7 @@ pub fn register_probes() -> Result<(), std::convert::Infallible> { + ), + all( + target_arch = "aarch64", +- any(target_os = "macos", target_os = "freebsd", target_os = "illumos") ++ any(target_os = "freebsd", target_os = "illumos") + ) + ))] + #[usdt::provider(provider = "nextest")] +@@ -135,7 +135,7 @@ pub mod usdt_probes { + ), + all( + target_arch = "aarch64", +- any(target_os = "macos", target_os = "freebsd", target_os = "illumos") ++ any(target_os = "freebsd", target_os = "illumos") + ) + ))] + #[macro_export] +@@ -246,7 +246,7 @@ macro_rules! fire_usdt { + ), + all( + target_arch = "aarch64", +- any(target_os = "macos", target_os = "freebsd", target_os = "illumos") ++ any(target_os = "freebsd", target_os = "illumos") + ) + )))] + #[macro_export] diff --git a/pkgs/by-name/ca/cargo-nextest/package.nix b/pkgs/by-name/ca/cargo-nextest/package.nix index 2089b3bee2c4..549f8f579250 100644 --- a/pkgs/by-name/ca/cargo-nextest/package.nix +++ b/pkgs/by-name/ca/cargo-nextest/package.nix @@ -1,5 +1,6 @@ { lib, + stdenv, rustPlatform, fetchFromGitHub, nix-update-script, @@ -16,6 +17,11 @@ rustPlatform.buildRustPackage rec { hash = "sha256-DY/FNtlNQg9Ym6PKo6UqSuWzGC3cDhbNU6MKTDxIaU4="; }; + # FIXME: we don't support dtrace probe generation on macOS until we have a dtrace build: https://github.com/NixOS/nixpkgs/pull/392918 + patches = lib.optionals stdenv.isDarwin [ + ./no-dtrace-macos.patch + ]; + cargoHash = "sha256-uQH9d+9VByXe/lL4Ybz07p+iYWUhbATMBCu7mYKxOSE="; cargoBuildFlags = [