-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cross-compilation: native derivations and stdenv.cross
#14965
Comments
This doesn't fix the cross-build by itself due to NixOS#14965 But in this case one can hack around that "easily" by: (html-tidy.override { inherit (/*non-cross nixpkgs eval*/) cmake; }).crossDrv
@Ericson2314: I pushed the current state of my WIP to vcunat/nixpkgs@kt/cross...vcunat:v/cross-native-rework The main idea is to use |
@vcunat From just a quick glance, I think this will fit very nicely together with what I've got, which is now otherwise ready for PR testing? |
So I already added a proper phase for computing the build-time deps in https://github.com/Ericson2314/nixpkgs/blob/cross/pkgs/stdenv/cross/default.nix, which means proper substitution of the stdenv. It's just a matter of combining your |
#21268 fixes the |
#24610 almost fixes all the rest of this. We just now need to deprecate |
#26884 did the latter! |
I think I'll keep |
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 samestdenv
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 modifiedmkDerivation
to producenativeDrv
andcrossDrv
. Those arguments have no possibility to differentiate among the two cases during evaluation time. We can still usecrossAttrs
, 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
stdenv.cross
is gonestdenv.is*
with evaluation-time warningcrossAttrs
#33302 RemovecrossAttrs
(see cross stdenv adapter inpkgs/stdenv/adapters.nix
)The text was updated successfully, but these errors were encountered: