#23 move RUSTC_BOOTSTRAP=1 only into the macros that actually need it
Closed by decathorpe. Opened by decathorpe.

This environment variable does not need to be defined everywhere, and it might have unintended consequences.


I tried implementing this, but in the end, the only macro that calls cargo under the hood that ends up without RUSTC_BOOTSTRAP=1 is %cargo_test. All other places where cargo is invoked need it:

  • %cargo_build: requires -Z avoid-dev-deps because otherwise it won't build anything if dev-dependencies are not available
  • %cargo_install: requires RUSTC_BOOTSTRAP to be set to the same value as it was set to in %cargo_build, otherwise everything is considered "dirty" and needs to be re-compiled
  • %cargo_license and %cargo_license_summary need -Z avoid-dev-deps for a similar reason to %cargo_build - even if cargo tree is explicitly told to not consider dev edges, they still need to be present without -Z avoid-dev-deps

So ... the end effect of moving RUSTC_BOOTSTRAP=1 into only the places where it's needed is basically the same as having it defined in a central location, because it's basically needed everywhere.

Metadata Update from @decathorpe:
- Issue set to the milestone: None (was: 25.3)
- Issue status updated to: Closed (was: Open)

Metadata