-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Description
The problem is closely related to #10874. We've developed a habit to test stdenv.cross to find if we're cross-compiling or not. However, that does not work for native build inputs, i.e. they see the same stdenv arguments as the cross derivations.
What's worse, I don't think this is easily fixable. We call stdenv.mkDerivation with some arguments, and inside this call we call the original and modified mkDerivation to produce nativeDrv and crossDrv. Those arguments have no possibility to differentiate among the two cases during evaluation time. We can still use crossAttrs, but that's rather inconvenient if we only want to slightly tweak a substring of a phase or drop a build input.
(Attributes like stdenv.isLinux also evaluate the same always, but the problem there is reversed, as discussed in #10874: it shows properties of the build system even though users typically mean the host system.)
TODO by @Ericson2314
- Native and cross builds do not see the same stdenv
- Purge stdenv.cross #26884
stdenv.crossis gone - Formally deprecate
stdenv.is*with evaluation-time warning - Get rid of
crossAttrs#33302 RemovecrossAttrs(see cross stdenv adapter inpkgs/stdenv/adapters.nix)