3
0
Fork 0
forked from mirrors/nixpkgs

Merge branch 'amjoseph-nixpkgs-pr/resume182058' into staging

This commit is contained in:
toonn 2022-09-25 14:45:17 +02:00
commit bf9ff0c687
No known key found for this signature in database
GPG key ID: 44FF902A66DF4576
3 changed files with 39 additions and 7 deletions

View file

@ -622,6 +622,20 @@ rec {
dontRecurseIntoAttrs =
attrs: attrs // { recurseForDerivations = false; };
/* `unionOfDisjoint x y` is equal to `x // y // z` where the
attrnames in `z` are the intersection of the attrnames in `x` and
`y`, and all values `assert` with an error message. This
operator is commutative, unlike (//). */
unionOfDisjoint = x: y:
let
intersection = builtins.intersectAttrs x y;
collisions = lib.concatStringsSep " " (builtins.attrNames intersection);
mask = builtins.mapAttrs (name: value: builtins.throw
"unionOfDisjoint: collision on ${name}; complete list: ${collisions}")
intersection;
in
(x // y) // mask;
/*** deprecated stuff ***/
zipWithNames = zipAttrsWithNames;

View file

@ -2192,7 +2192,10 @@ with pkgs;
brewtarget = libsForQt514.callPackage ../applications/misc/brewtarget { } ;
stdenvBootstrapTools = if stdenv.hostPlatform.isDarwin then
# 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 =
@ -2200,7 +2203,7 @@ with pkgs;
}
else if stdenv.hostPlatform.isLinux then
callPackage ../stdenv/linux/make-bootstrap-tools.nix {}
else throw "stdenvBootstrapTools: unknown hostPlatform ${stdenv.hostPlatform.config}";
else throw "freshBootstrapTools: unknown hostPlatform ${stdenv.hostPlatform.config}";
boxes = callPackage ../tools/text/boxes { };

View file

@ -30,7 +30,7 @@ let
"aarch64"
] (arch: builtins.elem "${arch}-darwin" systemsWithAnySupport);
jobs =
nonPackageJobs =
{ tarball = import ./make-tarball.nix { inherit pkgs nixpkgs officialRelease supportedSystems; };
metrics = import ./metrics.nix { inherit pkgs nixpkgs; };
@ -167,7 +167,9 @@ let
(system: {
inherit
(import ../stdenv/linux/make-bootstrap-tools.nix {
localSystem = { inherit system; };
pkgs = import ../.. {
localSystem = { inherit system; };
};
})
dist test;
})
@ -175,7 +177,9 @@ let
// optionalAttrs supportDarwin.x86_64 {
x86_64-darwin =
let
bootstrap = import ../stdenv/darwin/make-bootstrap-tools.nix { system = "x86_64-darwin"; };
bootstrap = import ../stdenv/darwin/make-bootstrap-tools.nix {
localSystem = { system = "x86_64-darwin"; };
};
in {
# Lightweight distribution and test
inherit (bootstrap) dist test;
@ -186,14 +190,25 @@ let
# Cross compiled bootstrap tools
aarch64-darwin =
let
bootstrap = import ../stdenv/darwin/make-bootstrap-tools.nix { system = "x86_64-darwin"; crossSystem = "aarch64-darwin"; };
bootstrap = import ../stdenv/darwin/make-bootstrap-tools.nix {
localSystem = { system = "x86_64-darwin"; };
crossSystem = { system = "aarch64-darwin"; };
};
in {
# Distribution only for now
inherit (bootstrap) dist;
};
};
} // (mapTestOn ((packagePlatforms pkgs) // {
};
# Do not allow attribute collision between jobs inserted in
# 'nonPackageAttrs' and jobs pulled in from 'pkgs'.
# Conflicts usually cause silent job drops like in
# https://github.com/NixOS/nixpkgs/pull/182058
jobs = lib.attrsets.unionOfDisjoint
nonPackageJobs
(mapTestOn ((packagePlatforms pkgs) // {
haskell.compiler = packagePlatforms pkgs.haskell.compiler;
haskellPackages = packagePlatforms pkgs.haskellPackages;
idrisPackages = packagePlatforms pkgs.idrisPackages;