diff --git a/ci/eval/default.nix b/ci/eval/default.nix index 927dec5a908dc..a53e7de3a56be 100644 --- a/ci/eval/default.nix +++ b/ci/eval/default.nix @@ -72,6 +72,7 @@ let chunkSize, checkMeta ? true, includeBroken ? true, + includeSubpackages ? evalSystem != "aarch64-darwin" && evalSystem != "x86_64-darwin", # Whether to just evaluate a single chunk for quick testing quickTest ? false, }: @@ -100,6 +101,7 @@ let --arg systems "[ \"$system\" ]" \ --arg checkMeta ${lib.boolToString checkMeta} \ --arg includeBroken ${lib.boolToString includeBroken} \ + --arg includeSubpackages ${lib.boolToString includeSubpackages} \ -I ${nixpkgs} \ -I ${attrpathFile} \ > "$outputDir/result/$myChunk" diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 502343f01fb32..b3c6f8327f599 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -491,6 +491,7 @@ let broken = isMarkedBroken attrs; unsupported = hasUnsupportedPlatform attrs; insecure = isMarkedInsecure attrs; + hydraPlatforms = if config.allowHydra then attrs.hydraPlatforms or [] else []; available = validity.valid != "no" && (if config.checkMetaRecursively or false diff --git a/pkgs/top-level/config.nix b/pkgs/top-level/config.nix index a4e1116a16dd0..aa211c946625f 100644 --- a/pkgs/top-level/config.nix +++ b/pkgs/top-level/config.nix @@ -92,6 +92,24 @@ let ''; }; + allowHydra = mkOption { + type = types.bool; + default = true; + defaultText = literalExpression ''true''; + description = '' + Whether to enable Hydra building of all packages. + ''; + }; + + allowHydraSubpackages = mkOption { + type = types.bool; + default = false; + defaultText = literalExpression ''false''; + description = '' + Whether to enable Hydra building of all sub-nixpkgs instances. + ''; + }; + allowUnfree = mkOption { type = types.bool; default = false; diff --git a/pkgs/top-level/release-attrpaths-parallel.nix b/pkgs/top-level/release-attrpaths-parallel.nix index 46d10c6a95041..c5372d4d0459d 100644 --- a/pkgs/top-level/release-attrpaths-parallel.nix +++ b/pkgs/top-level/release-attrpaths-parallel.nix @@ -9,6 +9,7 @@ myChunk, checkMeta, includeBroken, + includeSubpackages, systems, }: @@ -18,7 +19,12 @@ let unfiltered = import ./release-outpaths.nix { inherit path; - inherit checkMeta includeBroken systems; + inherit + checkMeta + includeBroken + includeSubpackages + systems + ; }; # Turns the unfiltered recursive attribute set into one that is limited to myAttrpaths diff --git a/pkgs/top-level/release-attrpaths-superset.nix b/pkgs/top-level/release-attrpaths-superset.nix index 9a89062bd1749..5f07bd3a83ef6 100644 --- a/pkgs/top-level/release-attrpaths-superset.nix +++ b/pkgs/top-level/release-attrpaths-superset.nix @@ -49,7 +49,6 @@ let targetPackages = true; # cross packagesets - pkgsLLVM = true; pkgsMusl = true; pkgsStatic = true; pkgsCross = true; @@ -186,10 +185,6 @@ let # I am not entirely sure why these three packages end up in # the Hydra jobset. But they do, and they don't meet the # criteria above, so at the moment they are special-cased. - [ - "pkgsLLVM" - "stdenv" - ] [ "pkgsStatic" "stdenv" diff --git a/pkgs/top-level/release-outpaths.nix b/pkgs/top-level/release-outpaths.nix index 0b70ea631244f..f0b837b190210 100644 --- a/pkgs/top-level/release-outpaths.nix +++ b/pkgs/top-level/release-outpaths.nix @@ -7,6 +7,7 @@ { checkMeta, includeBroken ? true, # set this to false to exclude meta.broken packages from the output + includeSubpackages ? true, # set this to false to exclude "pkgs*" path ? ./../.., # used by pkgs/top-level/release-attrnames-superset.nix @@ -28,6 +29,7 @@ let allowAliases = false; allowBroken = includeBroken; allowUnfree = false; + allowHydraSubpackages = includeSubpackages; allowInsecurePredicate = x: true; checkMeta = checkMeta; @@ -84,7 +86,7 @@ let "stdenvBootstrapTools" "moduleSystem" "lib-tests" # these just confuse the output - ]; + ] ++ lib.optional (!includeSubpackages) "pkgsLLVM"; in tweak (builtins.removeAttrs hydraJobs blacklist) diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix index 0140f0bd9d6a4..86e42546fe887 100644 --- a/pkgs/top-level/release.nix +++ b/pkgs/top-level/release.nix @@ -69,6 +69,7 @@ let id isDerivation optionals + subtractLists ; inherit (release-lib.lib.attrsets) unionOfDisjoint; @@ -320,6 +321,8 @@ let jobs = let packagePlatforms = release-lib.recursiveMapPackages (if attrNamesOnly then id else release-lib.getPlatforms); + packagePlatformsExclude = systems: release-lib.recursiveMapPackages + (if attrNamesOnly then id else (drv: subtractLists (release-lib.getPlatforms drv) systems)); packageJobs = packagePlatforms pkgs // { haskell.compiler = packagePlatforms pkgs.haskell.compiler; haskellPackages = packagePlatforms pkgs.haskellPackages; @@ -340,7 +343,7 @@ let idrisPackages = packagePlatforms pkgs.idrisPackages; agdaPackages = packagePlatforms pkgs.agdaPackages; - pkgsLLVM.stdenv = [ "x86_64-linux" "aarch64-linux" ]; + pkgsLLVM = packagePlatformsExclude [ "aarch64-darwin" "x86_64-darwin" ] pkgs.pkgsLLVM; pkgsArocc.stdenv = [ "x86_64-linux" "aarch64-linux" ]; pkgsZig.stdenv = [ "x86_64-linux" "aarch64-linux" ]; pkgsMusl.stdenv = [ "x86_64-linux" "aarch64-linux" ]; diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 1cedd8dd18458..9918c9b23b46d 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -175,6 +175,10 @@ let lib.optionalAttrs allowCustomOverrides ((config.packageOverrides or (super: {})) super); + nixpkgsFunSub = attrs: nixpkgsFun (attrs // { + allowHydra = config.allowHydraSubpackages; + }); + # Convenience attributes for instantitating package sets. Each of # these will instantiate a new version of allPackages. Currently the # following package sets are provided: @@ -192,7 +196,7 @@ let nixpkgsFun { inherit crossSystem; }) lib.systems.examples; - pkgsLLVM = nixpkgsFun { + pkgsLLVM = if stdenv.hostPlatform.isDarwin then self else nixpkgsFunSub { overlays = [ (self': super': { pkgsLLVM = super'; @@ -207,7 +211,7 @@ let }; }; - pkgsArocc = nixpkgsFun { + pkgsArocc = nixpkgsFunSub { overlays = [ (self': super': { pkgsArocc = super'; @@ -222,7 +226,7 @@ let }; }; - pkgsZig = nixpkgsFun { + pkgsZig = nixpkgsFunSub { overlays = [ (self': super': { pkgsZig = super'; @@ -240,7 +244,7 @@ let # All packages built with the Musl libc. This will override the # default GNU libc on Linux systems. Non-Linux systems are not # supported. 32-bit is also not supported. - pkgsMusl = if stdenv.hostPlatform.isLinux && stdenv.buildPlatform.is64bit then nixpkgsFun { + pkgsMusl = if stdenv.hostPlatform.isLinux && stdenv.buildPlatform.is64bit then nixpkgsFunSub { overlays = [ (self': super': { pkgsMusl = super'; })] ++ overlays; @@ -252,7 +256,7 @@ let # All packages built for i686 Linux. # Used by wine, firefox with debugging version of Flash, ... - pkgsi686Linux = if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86 then nixpkgsFun { + pkgsi686Linux = if stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86 then nixpkgsFunSub { overlays = [ (self': super': { pkgsi686Linux = super'; })] ++ overlays; @@ -265,7 +269,7 @@ let } else throw "i686 Linux package set can only be used with the x86 family."; # x86_64-darwin packages for aarch64-darwin users to use with Rosetta for incompatible packages - pkgsx86_64Darwin = if stdenv.hostPlatform.isDarwin then nixpkgsFun { + pkgsx86_64Darwin = if stdenv.hostPlatform.isDarwin then nixpkgsFunSub { overlays = [ (self': super': { pkgsx86_64Darwin = super'; })] ++ overlays; @@ -282,7 +286,7 @@ let pkgsLinux = if stdenv.hostPlatform.isLinux then self - else nixpkgsFun { + else nixpkgsFunSub { localSystem = lib.systems.elaborate "${stdenv.hostPlatform.parsed.cpu.name}-linux"; }; @@ -292,7 +296,7 @@ let appendOverlays = extraOverlays: if extraOverlays == [] then self - else nixpkgsFun { overlays = args.overlays ++ extraOverlays; }; + else nixpkgsFunSub { overlays = args.overlays ++ extraOverlays; }; # NOTE: each call to extend causes a full nixpkgs rebuild, adding ~130MB # of allocations. DO NOT USE THIS IN NIXPKGS. @@ -305,7 +309,7 @@ let # Fully static packages. # Currently uses Musl on Linux (couldn’t get static glibc to work). - pkgsStatic = nixpkgsFun ({ + pkgsStatic = nixpkgsFunSub ({ overlays = [ (self': super': { pkgsStatic = super'; })] ++ overlays; @@ -321,7 +325,7 @@ let }; }); - pkgsExtraHardening = nixpkgsFun { + pkgsExtraHardening = nixpkgsFunSub { overlays = [ (self': super': { pkgsExtraHardening = super';