Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/attrsets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2186,15 +2186,18 @@ 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 =
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 "stdenvBootstrapTools: unknown hostPlatform ${stdenv.hostPlatform.config}";
else throw "freshBootstrapTools: unknown hostPlatform ${stdenv.hostPlatform.config}";

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

Expand Down
25 changes: 20 additions & 5 deletions pkgs/top-level/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down Expand Up @@ -167,15 +167,19 @@ let
(system: {
inherit
(import ../stdenv/linux/make-bootstrap-tools.nix {
localSystem = { inherit system; };
pkgs = import ../.. {
localSystem = { inherit system; };
};
})
dist test;
})
# darwin is special in this
// 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;
Expand All @@ -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;
Expand Down