cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.21k stars 354 forks source link

Forward unstable feature flags (-Z) to cargo metadata invocations #1517

Open Hakhenaton opened 1 week ago

Hakhenaton commented 1 week ago

The problem

I ran across some issues when using nightly Cargo features such as artifacts-dependencies.

Cargo forces users to pass a -Z bindeps flag to activate the feature in every cargo command.

Cross already forwards the +nightly flag to internal cargo invocations, but it does not forward -Z flags.

Consequently, cargo metadata always fail for projects using such feature.

This problem would also occur when using other Cargo nightly features.

Solution

Parse the -Z flags and forward them to cargo metadata.