From e7bafc814c26812bdad587f347d9a1856287719b Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 26 Jul 2022 22:22:27 +0100 Subject: [PATCH] pkgs/top-level/release.nix: disallow symbol clash between 'pkgs' and local jobs This change exposes symbol override that accidentally caused job loss on hydra: $ nix repl ./release.nix error: jobs: Unexpected attribute collision between 'jobs' and 'pkgs': stdenvBootstrapTools Added assert makes sure attribute clashes would not be re-introduced. --- pkgs/top-level/release.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix index d96f742d5d3f..61116328b29f 100644 --- a/pkgs/top-level/release.nix +++ b/pkgs/top-level/release.nix @@ -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; }; @@ -200,7 +200,15 @@ let }; }; - } // (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;