Merge pull request #25194 from obsidiansystems/host-target-unconfuse
stdenv.cross is a silly attribute that needs to go leaving the well-defined hostPlatform and targetPlatform. This PR doesn't remove it, but changes its definition: before it tracked the target platform which is sometimes more useful for compilers, and now it tracks the host platform which is more useful for everything else. Most usages are libraries, falling in the "everything else" category, so changing the definition makes sense to appease the majority. The few compiler (gcc in particular) uses that exist I remove to use targetPlatform --- preserving correctness and becoming more explicit in the process. I would also update the documentation aside mentioning stdenv.cross as deprecated, but the definition given actually erroneously assumes this PR is already merged!
This commit is contained in:
@@ -58,6 +58,10 @@ rec {
|
||||
# builds.
|
||||
makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv // {
|
||||
|
||||
# Overrides are surely not valid as packages built with this run on a
|
||||
# different platform.
|
||||
overrides = _: _: {};
|
||||
|
||||
mkDerivation =
|
||||
{ name ? "", buildInputs ? [], nativeBuildInputs ? []
|
||||
, propagatedBuildInputs ? [], propagatedNativeBuildInputs ? []
|
||||
|
||||
@@ -21,9 +21,7 @@ in bootStages ++ [
|
||||
selfBuild = false;
|
||||
# It's OK to change the built-time dependencies
|
||||
allowCustomOverrides = true;
|
||||
stdenv = vanillaPackages.stdenv // {
|
||||
overrides = _: _: {};
|
||||
};
|
||||
inherit (vanillaPackages) stdenv;
|
||||
})
|
||||
|
||||
# Run Packages
|
||||
|
||||
@@ -253,7 +253,7 @@ in rec {
|
||||
inherit
|
||||
gnumake gzip gnused bzip2 gawk ed xz patch bash
|
||||
libcxxabi libcxx ncurses libffi zlib icu llvm gmp pcre gnugrep
|
||||
coreutils findutils diffutils patchutils binutils binutils-raw;
|
||||
coreutils findutils diffutils patchutils;
|
||||
|
||||
llvmPackages = super.llvmPackages // {
|
||||
inherit (llvmPackages) llvm clang-unwrapped;
|
||||
@@ -262,6 +262,9 @@ in rec {
|
||||
darwin = super.darwin // {
|
||||
inherit (darwin) dyld Libsystem cctools libiconv;
|
||||
};
|
||||
} // lib.optionalAttrs (super.targetPlatform == localSystem) {
|
||||
# Need to get rid of these when cross-compiling.
|
||||
inherit binutils binutils-raw;
|
||||
};
|
||||
|
||||
stdenvDarwin = prevStage: let pkgs = prevStage; in import ../generic rec {
|
||||
|
||||
@@ -298,12 +298,14 @@ in
|
||||
*/
|
||||
|
||||
overrides = self: super: {
|
||||
gcc = cc;
|
||||
|
||||
inherit (prevStage)
|
||||
gzip bzip2 xz bash binutils coreutils diffutils findutils gawk
|
||||
gzip bzip2 xz bash coreutils diffutils findutils gawk
|
||||
glibc gnumake gnused gnutar gnugrep gnupatch patchelf
|
||||
attr acl paxctl zlib pcre;
|
||||
} // lib.optionalAttrs (super.targetPlatform == localSystem) {
|
||||
# Need to get rid of these when cross-compiling.
|
||||
inherit (prevStage) binutils;
|
||||
gcc = cc;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user