Make usdt an optional default feature#3027
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
sunshowers
left a comment
There was a problem hiding this comment.
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:
- x86_64 Linux to aarch64 Linux
- x86_64 Linux to x86_64 FreeBSD
- x86_64 Linux to x86_64 illumos
- 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?
| default = ["default-no-update", "self-update", "usdt"] | ||
| usdt = ["nextest-runner/usdt"] |
There was a problem hiding this comment.
usdt should be moved to default-no-update below.
There was a problem hiding this comment.
That naming went straight over my head, updated.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Yeah. I would expect the following to work:
cargo install --locked cargo-nextest --no-default-features --features default-no-updatecargo build -p cargo-nextest --no-default-features --features default-no-updatecargo install --locked --git https://github.com/nextest-rs/nextest --no-default-features --features default-no-update
|
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). |
Formatting changes broke this patch with `cargo-nextest-0.9.126`. See: nextest-rs/nextest#3027 See: NixOS#456256 See: NixOS#392918
Formatting changes broke this patch with `cargo-nextest-0.9.126`. See: nextest-rs/nextest#3027 See: NixOS#456256 See: NixOS#392918
This fixes cross-compilation. I've verified this with the command below.
Fixes #3026