Commit 3927778e authored by Manuel Mendez's avatar Manuel Mendez
Browse files

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.
parent 043dc9c8
Loading
Loading
Loading
Loading
+62 −0
Original line number Diff line number Diff line
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]
+6 −0
Original line number Diff line number Diff line
{
  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 = [