Skip to content

Make usdt an optional default feature#3027

Merged
sunshowers merged 2 commits into
nextest-rs:mainfrom
konstin:konsti/make-usdt-optional
Feb 3, 2026
Merged

Make usdt an optional default feature#3027
sunshowers merged 2 commits into
nextest-rs:mainfrom
konstin:konsti/make-usdt-optional

Conversation

@konstin

@konstin konstin commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

This fixes cross-compilation. I've verified this with the command below.

SDKROOT=${SDK_ROOT}/macos-sdk \
    CFLAGS_aarch64_apple_darwin="-isystem ${SDK_ROOT}/macos-sdk/usr/include" \
    RUSTFLAGS="-C link-arg=-F${SDK_ROOT}/macos-sdk/System/Library/Frameworks -C link-arg=-L${SDK_ROOT}/macos-sdk/usr/lib" \
    cargo zigbuild --target aarch64-apple-darwin --no-default-features --features default-no-update,self-update

Fixes #3026

This fixes cross-compilation. I've verified this with the command below.

```
CARGO_CFG_TARGET_ARCH=aarch64 SDKROOT=${SDK_ROOT}/macos-sdk CFLAGS_aarch64_apple_darwin="-isystem ${SDK_ROOT}/macos-sdk/usr/include" RUSTFLAGS="-C link-arg=-F${SDK_ROOT}/macos-sdk/System/Library/Frameworks -C link-arg
=-L${SDK_ROOT}/macos-sdk/usr/lib" cargo zigbuild --target aarch64-apple-darwin --no-default-features --features default-no-update,self-update
```

Fixes nextest-rs#3026
@codecov

codecov Bot commented Feb 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.02%. Comparing base (362c6ae) to head (572d7fb).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3027      +/-   ##
==========================================
- Coverage   83.10%   83.02%   -0.09%     
==========================================
  Files         154      155       +1     
  Lines       40919    42251    +1332     
==========================================
+ Hits        34004    35077    +1073     
- Misses       6915     7174     +259     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sunshowers sunshowers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Trying to understand this in more detail:

Based on oxidecomputer/usdt@master...konstin:usdt:master I guess this is an issue when cross-compiling to another architecture (not just another OS). Now our release builds perform cross-compiles from:

  1. x86_64 Linux to aarch64 Linux
  2. x86_64 Linux to x86_64 FreeBSD
  3. x86_64 Linux to x86_64 illumos
  4. aarch64 macOS to x86_64 macOS

1 isn't an issue because the usdt crate already doesn't work on aarch64 Linux.

2 and 3 aren't issues because we're compiling to the same architecture.

4 isn't an issue because the usdt crate doesn't work on x86_64 macOS.

But based on the command line you pasted, what you're trying to do is compile from x86_64 macOS to aarch64 macOS. So you run into this USDT issue.

Is my understanding correct?

Comment thread cargo-nextest/Cargo.toml Outdated
Comment on lines +59 to +60
default = ["default-no-update", "self-update", "usdt"]
usdt = ["nextest-runner/usdt"]

@sunshowers sunshowers Feb 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usdt should be moved to default-no-update below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That naming went straight over my head, updated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For posterity, to run the build command, you now need to be in ./cargo-nextest, not in root, as the root unconditionally activates default-no-updat. (This works when fetching the .crate file for cargo-nextest from crates.io, which I did before patching).

cargo-nextest = { path = "cargo-nextest", default-features = false, features = [
    "default-no-update",
] }
SDKROOT=${SDK_ROOT}/macos-sdk     CFLAGS_aarch64_apple_darwin="-isystem ${SDK_ROOT}/macos-sdk/usr/include"     RUSTFLAGS="-C link-arg=-F${SDK_ROOT}/macos-sdk/System/Library/Frameworks -C link-arg=-L${SDK_ROOT}/macos-sdk/usr/lib"     cargo zigbuild --target aarch64-apple-darwin --no-default-features

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I would expect the following to work:

  • cargo install --locked cargo-nextest --no-default-features --features default-no-update
  • cargo build -p cargo-nextest --no-default-features --features default-no-update
  • cargo install --locked --git https://github.com/nextest-rs/nextest --no-default-features --features default-no-update

@konstin

konstin commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

I was trying to build packages for {linux, windows, mac} x {x86_64, aarch64} from a linux x86_64 host in a docker container (though a linux aarch64 host would also work, x86_64 is just more conveniently available for me).

@sunshowers sunshowers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sunshowers sunshowers merged commit d5dd340 into nextest-rs:main Feb 3, 2026
23 checks passed
9999years added a commit to 9999years/nixpkgs that referenced this pull request Feb 9, 2026
Formatting changes broke this patch with `cargo-nextest-0.9.126`.

See: nextest-rs/nextest#3027
See: NixOS#456256
See: NixOS#392918
9999years added a commit to 9999years/nixpkgs that referenced this pull request Feb 9, 2026
Formatting changes broke this patch with `cargo-nextest-0.9.126`.

See: nextest-rs/nextest#3027
See: NixOS#456256
See: NixOS#392918
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nextest can't be cross compiled

2 participants