Skip to content

Commit

Permalink
stdenvBootstrapTools: revert "inherit {cross,local}System"
Browse files Browse the repository at this point in the history
This reverts commit 5643714.

The change was based on e663518 ("all-packages.nix: add bootstrapTools
to top-level.nix"). Unfortunately that change had intended side-effect
in releases.nix that turned stdenvBootstrapTools into a no-op.

As a result 5643714 "stdenvBootstrapTools: inherit {cross,local}System"
change dropped the locaSystem argument without evaluation failure.

Once the accidental change was fixed unexpected `localSystem` parameter
started failing evals:

    $ nix build -f pkgs/top-level/release.nix stdenvBootstrapTools.x86_64-linux.dist
    error: anonymous function at pkgs/stdenv/linux/make-bootstrap-tools.nix:1:1 called with unexpected argument 'localSystem'

       at /home/slyfox/dev/git/nixpkgs-master/pkgs/top-level/release.nix:169:16:

          168|             inherit
          169|               (import ../stdenv/linux/make-bootstrap-tools.nix {
             |                ^
          170|                 localSystem = { inherit system; };

Let's roll it back cleanly to restore stdenvBootstrapTools builds on hydra.
  • Loading branch information
trofi committed Jul 20, 2022
1 parent 94f95bf commit 9c8e384
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
8 changes: 3 additions & 5 deletions pkgs/stdenv/darwin/make-bootstrap-tools.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{ pkgspath ? ../../.., test-pkgspath ? pkgspath
, localSystem ? { system = builtins.currentSystem; }
, crossSystem ? null
, bootstrapFiles ? null
, system ? builtins.currentSystem, crossSystem ? null, bootstrapFiles ? null
}:

let cross = if crossSystem != null
Expand All @@ -13,7 +11,7 @@ let cross = if crossSystem != null
in (import "${pkgspath}/pkgs/stdenv/darwin" args').stagesDarwin;
}
else {};
in with import pkgspath ({ inherit localSystem; } // cross // custom-bootstrap);
in with import pkgspath ({ inherit system; } // cross // custom-bootstrap);

let
llvmPackages = llvmPackages_11;
Expand Down Expand Up @@ -366,7 +364,7 @@ in rec {
test-pkgs = import test-pkgspath {
# if the bootstrap tools are for another platform, we should be testing
# that platform.
localSystem = if crossSystem != null then crossSystem else localSystem;
system = if crossSystem != null then crossSystem else system;

stdenvStages = args: let
args' = args // { inherit bootstrapLlvmVersion bootstrapFiles; };
Expand Down
5 changes: 4 additions & 1 deletion pkgs/stdenv/linux/make-bootstrap-tools.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{ pkgs ? import ../../.. {} }:
{ localSystem ? { system = builtins.currentSystem; }
, crossSystem ? null
}:

let
pkgs = import ../../.. { inherit localSystem crossSystem; };
libc = pkgs.stdenv.cc.libc;
in with pkgs; rec {

Expand Down
19 changes: 7 additions & 12 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2054,18 +2054,13 @@ with pkgs;

brewtarget = libsForQt514.callPackage ../applications/misc/brewtarget { } ;

# Derivation's result is not used by nixpkgs. Useful for validation for
# regressions of bootstrapTools on hydra and on ofborg. Example:
# pkgsCross.aarch64-multiplatform.freshBootstrapTools.build
freshBootstrapTools = if stdenv.hostPlatform.isDarwin then
callPackage ../stdenv/darwin/make-bootstrap-tools.nix {
localSystem = stdenv.buildPlatform;
crossSystem =
if stdenv.buildPlatform == stdenv.hostPlatform then null else stdenv.hostPlatform;
}
else if stdenv.hostPlatform.isLinux then
callPackage ../stdenv/linux/make-bootstrap-tools.nix {}
else throw "freshBootstrapTools: unknown hostPlatform ${stdenv.hostPlatform.config}";
freshBootstrapTools =
let args = { crossSystem = stdenv.hostPlatform.system; }; in
if stdenv.hostPlatform.isDarwin
then callPackage ../stdenv/darwin/make-bootstrap-tools.nix args
else if stdenv.hostPlatform.isLinux
then callPackage ../stdenv/linux/make-bootstrap-tools.nix args
else throw "freshBootstrapTools: unknown hostPlatform ${stdenv.hostPlatform.config}";

boxes = callPackage ../tools/text/boxes { };

Expand Down

0 comments on commit 9c8e384

Please sign in to comment.