diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/stdenv')
9 files changed, 238 insertions, 112 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/default.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/default.nix index a040e6ab2424..f07b1ee73b87 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/default.nix @@ -7,15 +7,15 @@ # Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools , bootstrapFiles ? let fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> { - url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/d5bdfcbfe6346761a332918a267e82799ec954d2/${file}"; + url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/5ab5783e4f46c373c6de84deac9ad59b608bb2e6/${file}"; inherit (localSystem) system; inherit sha256 executable; }; in { - sh = fetch { file = "sh"; sha256 = "07wm33f1yzfpcd3rh42f8g096k4cvv7g65p968j28agzmm2s7s8m"; }; - bzip2 = fetch { file = "bzip2"; sha256 = "0y9ri2aprkrp2dkzm6229l0mw4rxr2jy7vvh3d8mxv2698v2kdbm"; }; - mkdir = fetch { file = "mkdir"; sha256 = "0sb07xpy66ws6f2jfnpjibyimzb71al8n8c6y4nr8h50al3g90nr"; }; - cpio = fetch { file = "cpio"; sha256 = "0r5c54hg678w7zydx27bzl9p3v9fs25y5ix6vdfi1ilqim7xh65n"; }; - tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "18hp5w6klr8g307ap4368r255qpzg9r0vwg9vqvj8f2zy1xilcjf"; executable = false; }; + sh = fetch { file = "sh"; sha256 = "sha256-nbb4XEk3go7ttiWrQyKQMLzPr+qUnwnHkWMtVCZsMCs="; }; + bzip2 = fetch { file = "bzip2"; sha256 = "sha256-ybnA+JWrKhXSfn20+GVKXkHFTp2Zt79hat8hAVmsUOc="; }; + mkdir = fetch { file = "mkdir"; sha256 = "sha256-nmvMxmfcY41/60Z/E8L9u0vgePW5l30Dqw1z+Nr02Hk="; }; + cpio = fetch { file = "cpio"; sha256 = "sha256-cB36rN3NLj19Tk37Kc5bodMFMO+mCpEQkKKo0AEMkaU="; }; + tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "sha256-kh2vKmjCr/HvR06czZbxUxV5KDRxSF27M6nN3cyofRI="; executable = false; }; } }: @@ -24,6 +24,8 @@ assert crossSystem == localSystem; let inherit (localSystem) system platform; + bootstrapClangVersion = "7.1.0"; + commonImpureHostDeps = [ "/bin/sh" "/usr/lib/libSystem.B.dylib" @@ -72,33 +74,48 @@ in rec { inherit (last) stdenv; }; - coreutils = { name = "${name}-coreutils"; outPath = bootstrapTools; }; - gnugrep = { name = "${name}-gnugrep"; outPath = bootstrapTools; }; - - bintools = import ../../build-support/bintools-wrapper { - inherit shell; - inherit (last) stdenvNoCC; - - nativeTools = false; - nativeLibc = false; - inherit buildPackages coreutils gnugrep; - libc = last.pkgs.darwin.Libsystem; - bintools = { name = "${name}-binutils"; outPath = bootstrapTools; }; - }; - - cc = if last == null then "/dev/null" else import ../../build-support/cc-wrapper { - inherit shell; - inherit (last) stdenvNoCC; - - extraPackages = []; + mkExtraBuildCommands = cc: '' + rsrc="$out/resource-root" + mkdir "$rsrc" + ln -s "${cc}/lib/clang/${cc.version}/include" "$rsrc" + ln -s "${last.pkgs.llvmPackages_7.compiler-rt.out}/lib" "$rsrc/lib" + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + ''; + + mkCC = overrides: import ../../build-support/cc-wrapper ( + let args = { + inherit shell; + inherit (last) stdenvNoCC; + + nativeTools = false; + nativeLibc = false; + inherit buildPackages libcxx; + inherit (last.pkgs) coreutils gnugrep; + bintools = last.pkgs.darwin.binutils; + libc = last.pkgs.darwin.Libsystem; + isClang = true; + cc = last.pkgs.llvmPackages_7.clang-unwrapped; + }; in args // (overrides args)); + + cc = if last == null then "/dev/null" else mkCC ({ cc, ... }: { + extraPackages = [ + last.pkgs.llvmPackages_7.libcxxabi + last.pkgs.llvmPackages_7.compiler-rt + ]; + extraBuildCommands = mkExtraBuildCommands cc; + }); - nativeTools = false; - nativeLibc = false; - inherit buildPackages coreutils gnugrep bintools libcxx; - libc = last.pkgs.darwin.Libsystem; - isClang = true; - cc = { name = "${name}-clang"; outPath = bootstrapTools; }; - }; + ccNoLibcxx = if last == null then "/dev/null" else mkCC ({ cc, ... }: { + libcxx = null; + extraPackages = [ + last.pkgs.llvmPackages_7.compiler-rt + ]; + extraBuildCommands = '' + echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags + echo "-B${last.pkgs.llvmPackages_7.compiler-rt}/lib" >> $out/nix-support/cc-cflags + echo "-nostdlib++" >> $out/nix-support/cc-cflags + '' + mkExtraBuildCommands cc; + }); thisStdenv = import ../generic { name = "${name}-stdenv-darwin"; @@ -137,7 +154,10 @@ in rec { extraAttrs = { inherit macosVersionMin appleSdkVersion platform; }; - overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; }; + overrides = self: super: (overrides self super) // { + inherit ccNoLibcxx; + fetchurl = thisStdenv.fetchurlBoot; + }; }; in { @@ -147,6 +167,9 @@ in rec { stage0 = stageFun 0 null { overrides = self: super: with stage0; { + coreutils = { name = "bootstrap-stage0-coreutils"; outPath = bootstrapTools; }; + gnugrep = { name = "bootstrap-stage0-gnugrep"; outPath = bootstrapTools; }; + darwin = super.darwin // { Libsystem = stdenv.mkDerivation { name = "bootstrap-stage0-Libsystem"; @@ -157,9 +180,26 @@ in rec { ''; }; dyld = bootstrapTools; + + binutils = lib.makeOverridable (import ../../build-support/bintools-wrapper) { + shell = "${bootstrapTools}/bin/bash"; + inherit (self) stdenvNoCC; + + nativeTools = false; + nativeLibc = false; + inherit (self) buildPackages coreutils gnugrep; + libc = self.pkgs.darwin.Libsystem; + bintools = { name = "bootstrap-stage0-binutils"; outPath = bootstrapTools; }; + }; }; llvmPackages_7 = { + clang-unwrapped = { + name = "bootstrap-stage0-clang"; + outPath = bootstrapTools; + version = bootstrapClangVersion; + }; + libcxx = stdenv.mkDerivation { name = "bootstrap-stage0-libcxx"; phases = [ "installPhase" "fixupPhase" ]; @@ -180,6 +220,15 @@ in rec { ln -s ${bootstrapTools}/lib/libc++abi.dylib $out/lib/libc++abi.dylib ''; }; + + compiler-rt = stdenv.mkDerivation { + name = "bootstrap-stage0-compiler-rt"; + buildCommand = '' + mkdir -p $out/lib + ln -s ${bootstrapTools}/lib/libclang_rt* $out/lib + ln -s ${bootstrapTools}/lib/darwin $out/lib/darwin + ''; + }; }; }; @@ -190,14 +239,26 @@ in rec { stage1 = prevStage: let persistent = self: super: with prevStage; { - cmake = super.cmake.override { - isBootstrap = true; - useSharedLibraries = false; - }; + cmake = super.cmakeMinimal; python3 = super.python3Minimal; ninja = super.ninja.override { buildDocs = false; }; + + llvmPackages_7 = super.llvmPackages_7 // (let + tools = super.llvmPackages_7.tools.extend (_: _: { + inherit (llvmPackages_7) clang-unwrapped; + }); + libraries = super.llvmPackages_7.libraries.extend (_: _: { + inherit (llvmPackages_7) compiler-rt libcxx libcxxabi; + }); + in { inherit tools libraries; } // tools // libraries); + + darwin = super.darwin // { + binutils = darwin.binutils.override { + libc = self.darwin.Libsystem; + }; + }; }; in with prevStage; stageFun 1 prevStage { extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\""; @@ -206,7 +267,9 @@ in rec { libcxx = pkgs.libcxx; allowedRequisites = - [ bootstrapTools ] ++ (with pkgs; [ libcxx libcxxabi ]) ++ [ pkgs.darwin.Libsystem ]; + [ bootstrapTools ] ++ + (with pkgs; [ libcxx libcxxabi llvmPackages_7.compiler-rt ]) ++ + (with pkgs.darwin; [ Libsystem ]); overrides = persistent; }; @@ -220,9 +283,26 @@ in rec { findfreetype libssh curl cmake autoconf automake libtool ed cpio coreutils libssh2 nghttp2 libkrb5 ninja; + llvmPackages_7 = super.llvmPackages_7 // (let + tools = super.llvmPackages_7.tools.extend (_: _: { + inherit (llvmPackages_7) clang-unwrapped; + }); + libraries = super.llvmPackages_7.libraries.extend (_: libSuper: { + inherit (llvmPackages_7) compiler-rt; + libcxx = libSuper.libcxx.override { + stdenv = overrideCC self.stdenv self.ccNoLibcxx; + }; + libcxxabi = libSuper.libcxxabi.override { + stdenv = overrideCC self.stdenv self.ccNoLibcxx; + standalone = true; + }; + }); + in { inherit tools libraries; } // tools // libraries); + darwin = super.darwin // { inherit (darwin) - dyld Libsystem xnu configd ICU libdispatch libclosure launchd CF; + binutils dyld Libsystem xnu configd ICU libdispatch libclosure + launchd CF darwin-stubs; }; }; in with prevStage; stageFun 2 prevStage { @@ -237,8 +317,9 @@ in rec { allowedRequisites = [ bootstrapTools ] ++ (with pkgs; [ - xz.bin xz.out libcxx libcxxabi zlib libxml2.out curl.out openssl.out libssh2.out - nghttp2.lib libkrb5 + xz.bin xz.out libcxx libcxxabi llvmPackages_7.compiler-rt + zlib libxml2.out curl.out openssl.out libssh2.out + nghttp2.lib libkrb5 coreutils gnugrep pcre.out gmp libiconv ]) ++ (with pkgs.darwin; [ dyld Libsystem CF ICU locale ]); @@ -265,7 +346,8 @@ in rec { darwin = super.darwin // { inherit (darwin) - dyld Libsystem xnu configd libdispatch libclosure launchd libiconv locale; + dyld Libsystem xnu configd libdispatch libclosure launchd libiconv + locale darwin-stubs; }; }; in with prevStage; stageFun 3 prevStage { @@ -287,8 +369,9 @@ in rec { allowedRequisites = [ bootstrapTools ] ++ (with pkgs; [ - xz.bin xz.out bash libcxx libcxxabi zlib libxml2.out curl.out openssl.out libssh2.out - nghttp2.lib libkrb5 + xz.bin xz.out bash libcxx libcxxabi llvmPackages_7.compiler-rt + zlib libxml2.out curl.out openssl.out libssh2.out + nghttp2.lib libkrb5 coreutils gnugrep pcre.out gmp libiconv ]) ++ (with pkgs.darwin; [ dyld ICU Libsystem locale ]); @@ -322,7 +405,7 @@ in rec { in { inherit tools libraries; } // tools // libraries); darwin = super.darwin // rec { - inherit (darwin) dyld Libsystem libiconv locale; + inherit (darwin) dyld Libsystem libiconv locale darwin-stubs; CF = super.darwin.CF.override { inherit libxml2; @@ -421,7 +504,7 @@ in rec { inherit cc; darwin = super.darwin // { - inherit (prevStage.darwin) CF; + inherit (prevStage.darwin) CF darwin-stubs; xnu = super.darwin.xnu.override { inherit (prevStage) python3; }; }; }); diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/make-bootstrap-tools.nix index 31e129639376..1243b96e5051 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -28,11 +28,8 @@ in rec { buildCommand = '' mkdir -p $out/bin $out/lib $out/lib/system - # We're not going to bundle the actual libSystem.dylib; instead we reconstruct it on - # the other side. See the notes in stdenv/darwin/default.nix for more information. - # We also need the .o files for various low-level boot stuff. + # Copy libSystem's .o files for various low-level boot stuff. cp -d ${darwin.Libsystem}/lib/*.o $out/lib - cp -d ${darwin.Libsystem}/lib/system/*.dylib $out/lib/system # Resolv is actually a link to another package, so let's copy it properly cp -L ${darwin.Libsystem}/lib/libresolv.9.dylib $out/lib @@ -208,39 +205,6 @@ in rec { fi done - install_name_tool \ - -id $out/lib/system/libsystem_c.dylib \ - $out/lib/system/libsystem_c.dylib - - install_name_tool \ - -id $out/lib/system/libsystem_kernel.dylib \ - $out/lib/system/libsystem_kernel.dylib - - # TODO: this logic basically duplicates similar logic in the Libsystem expression. Deduplicate them! - libs=$(cat $reexportedLibrariesFile | grep -v '^#') - - for i in $libs; do - if [ "$i" != "/usr/lib/system/libsystem_kernel.dylib" ] && [ "$i" != "/usr/lib/system/libsystem_c.dylib" ]; then - args="$args -reexport_library $i" - fi - done - - ld -macosx_version_min 10.7 \ - -arch x86_64 \ - -dylib \ - -o $out/lib/libSystem.B.dylib \ - -compatibility_version 1.0 \ - -current_version 1226.10.1 \ - -reexport_library $out/lib/system/libsystem_c.dylib \ - -reexport_library $out/lib/system/libsystem_kernel.dylib \ - $args - - ln -s libSystem.B.dylib $out/lib/libSystem.dylib - - for name in c dbm dl info m mx poll proc pthread rpcsvc util gcc_s.10.4 gcc_s.10.5; do - ln -s libSystem.dylib $out/lib/lib$name.dylib - done - ln -s libresolv.9.dylib $out/lib/libresolv.dylib for i in $out/lib/*.dylib $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation; do @@ -309,7 +273,20 @@ in rec { ${build}/on-server/sh -c 'echo Hello World' - export flags="-idirafter ${unpack}/include-Libsystem --sysroot=${unpack} -L${unpack}/lib" + # This approximates a bootstrap version of libSystem can that be + # assembled via fetchurl. Adapted from main libSystem expression. + mkdir libSystem-boot + cp -vr \ + ${darwin.darwin-stubs}/usr/lib/libSystem.B.tbd \ + ${darwin.darwin-stubs}/usr/lib/system \ + libSystem-boot + + substituteInPlace libSystem-boot/libSystem.B.tbd \ + --replace "/usr/lib/system/" "$PWD/libSystem-boot/system/" + ln -s libSystem.B.tbd libSystem-boot/libSystem.tbd + # End of bootstrap libSystem + + export flags="-idirafter ${unpack}/include-Libsystem --sysroot=${unpack} -L${unpack}/lib -L$PWD/libSystem-boot" export CPP="clang -E $flags" export CC="clang $flags -Wl,-rpath,${unpack}/lib -Wl,-v -Wl,-sdk_version,10.10" diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/check-meta.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/check-meta.nix index c06f17b6fc19..160ca5d4e068 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/check-meta.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/check-meta.nix @@ -49,6 +49,18 @@ let isUnfree = licenses: lib.lists.any (l: !l.free or true) licenses; + hasUnfreeLicense = attrs: + hasLicense attrs && + isUnfree (lib.lists.toList attrs.meta.license); + + isMarkedBroken = attrs: attrs.meta.broken or false; + + hasUnsupportedPlatform = attrs: + (!lib.lists.elem hostPlatform.system (attrs.meta.platforms or lib.platforms.all) || + lib.lists.elem hostPlatform.system (attrs.meta.badPlatforms or [])); + + isMarkedInsecure = attrs: (attrs.meta.knownVulnerabilities or []) != []; + # Alow granular checks to allow only some unfree packages # Example: # {pkgs, ...}: @@ -62,16 +74,15 @@ let # package has an unfree license and is not explicitely allowed by the # `allowUnfreePredicate` function. hasDeniedUnfreeLicense = attrs: + hasUnfreeLicense attrs && !allowUnfree && - hasLicense attrs && - isUnfree (lib.lists.toList attrs.meta.license) && !allowUnfreePredicate attrs; allowInsecureDefaultPredicate = x: builtins.elem (getName x) (config.permittedInsecurePackages or []); allowInsecurePredicate = x: (config.allowInsecurePredicate or allowInsecureDefaultPredicate) x; hasAllowedInsecure = attrs: - (attrs.meta.knownVulnerabilities or []) == [] || + !(isMarkedInsecure attrs) || allowInsecurePredicate attrs || builtins.getEnv "NIXPKGS_ALLOW_INSECURE" == "1"; @@ -80,21 +91,46 @@ let pos_str = meta: meta.position or "«unknown-file»"; remediation = { - unfree = remediate_whitelist "Unfree"; - broken = remediate_whitelist "Broken"; - unsupported = remediate_whitelist "UnsupportedSystem"; + unfree = remediate_whitelist "Unfree" remediate_unfree_predicate; + broken = remediate_whitelist "Broken" (x: ""); + unsupported = remediate_whitelist "UnsupportedSystem" (x: ""); blacklisted = x: ""; insecure = remediate_insecure; broken-outputs = remediateOutputsToInstall; unknown-meta = x: ""; }; - remediate_whitelist = allow_attr: attrs: + remediation_env_var = allow_attr: { + Unfree = "NIXPKGS_ALLOW_UNFREE"; + Broken = "NIXPKGS_ALLOW_BROKEN"; + UnsupportedSystem = "NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM"; + }.${allow_attr}; + remediation_phrase = allow_attr: { + Unfree = "unfree packages"; + Broken = "broken packages"; + UnsupportedSystem = "packages that are unsupported for this system"; + }.${allow_attr}; + remediate_unfree_predicate = attrs: '' - a) For `nixos-rebuild` you can set + + Alternatively you can configure a predicate to whitelist specific packages: + { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "${lib.getName attrs}" + ]; + } + ''; + + remediate_whitelist = allow_attr: rebuild_amendment: attrs: + '' + a) To temporarily allow ${remediation_phrase allow_attr}, you can use an environment variable + for a single invocation of the nix tools. + + $ export ${remediation_env_var allow_attr}=1 + + b) For `nixos-rebuild` you can set { nixpkgs.config.allow${allow_attr} = true; } in configuration.nix to override this. - - b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add + ${rebuild_amendment attrs} + c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add { allow${allow_attr} = true; } to ~/.config/nixpkgs/config.nix. ''; @@ -178,6 +214,9 @@ let platforms = listOf str; hydraPlatforms = listOf str; broken = bool; + unfree = bool; + unsupported = bool; + insecure = bool; # TODO: refactor once something like Profpatsch's types-simple will land # This is currently dead code due to https://github.com/NixOS/nix/issues/2532 tests = attrsOf (mkOptionType { @@ -229,17 +268,22 @@ let # # Return { valid: Bool } and additionally # { reason: String; errormsg: String } if it is not valid, where - # reason is one of "unfree", "blacklisted" or "broken". + # reason is one of "unfree", "blacklisted", "broken", "insecure", ... + # Along with a boolean flag for each reason checkValidity = attrs: - if hasDeniedUnfreeLicense attrs && !(hasWhitelistedLicense attrs) then + { + unfree = hasUnfreeLicense attrs; + broken = isMarkedBroken attrs; + unsupported = hasUnsupportedPlatform attrs; + insecure = isMarkedInsecure attrs; + } + // (if hasDeniedUnfreeLicense attrs && !(hasWhitelistedLicense attrs) then { valid = false; reason = "unfree"; errormsg = "has an unfree license (‘${showLicense attrs.meta.license}’)"; } else if hasBlacklistedLicense attrs then { valid = false; reason = "blacklisted"; errormsg = "has a blacklisted license (‘${showLicense attrs.meta.license}’)"; } else if !allowBroken && attrs.meta.broken or false then { valid = false; reason = "broken"; errormsg = "is marked as broken"; } - else if !allowUnsupportedSystem && - (!lib.lists.elem hostPlatform.system (attrs.meta.platforms or lib.platforms.all) || - lib.lists.elem hostPlatform.system (attrs.meta.badPlatforms or [])) then + else if !allowUnsupportedSystem && hasUnsupportedPlatform attrs then { valid = false; reason = "unsupported"; errormsg = "is not supported on ‘${hostPlatform.system}’"; } else if !(hasAllowedInsecure attrs) then { valid = false; reason = "insecure"; errormsg = "is marked as insecure"; } @@ -247,14 +291,14 @@ let { valid = false; reason = "broken-outputs"; errormsg = "has invalid meta.outputsToInstall"; } else let res = checkMeta (attrs.meta or {}); in if res != [] then { valid = false; reason = "unknown-meta"; errormsg = "has an invalid meta attrset:${lib.concatMapStrings (x: "\n\t - " + x) res}"; } - else { valid = true; }; + else { valid = true; }); assertValidity = { meta, attrs }: let validity = checkValidity attrs; in validity // { # Throw an error if trying to evaluate an non-valid derivation handled = if !validity.valid - then handleEvalIssue { inherit meta attrs; } (removeAttrs validity ["valid"]) + then handleEvalIssue { inherit meta attrs; } { inherit (validity) reason errormsg; } else true; }; diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/default.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/default.nix index eeddb584a3d5..c7c3bb9f3f3f 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/default.nix @@ -70,6 +70,7 @@ let ../../build-support/setup-hooks/move-sbin.sh ../../build-support/setup-hooks/move-lib64.sh ../../build-support/setup-hooks/set-source-date-epoch-to-latest.sh + ../../build-support/setup-hooks/reproducible-builds.sh # TODO use lib.optional instead (if hasCC then cc else null) ]; diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/make-derivation.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/make-derivation.nix index 491951e6121f..0eb799e45258 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/make-derivation.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/make-derivation.nix @@ -328,8 +328,9 @@ in rec { # Fill `meta.position` to identify the source location of the package. // lib.optionalAttrs (pos != null) { position = pos.file + ":" + toString pos.line; - # Expose the result of the checks for everyone to see. } // { + # Expose the result of the checks for everyone to see. + inherit (validity) unfree broken unsupported insecure; available = validity.valid && (if config.checkMetaRecursively or false then lib.all (d: d.meta.available or true) references diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/setup.sh b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/setup.sh index d19ed342aab0..4ff0a6caf760 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/generic/setup.sh +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/generic/setup.sh @@ -483,10 +483,14 @@ activatePackage() { # the transition, we do include everything in thatcase. # # TODO(@Ericson2314): Don't special-case native compilation - if [[ ( -z "${strictDeps-}" || "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then addToSearchPath _PATH "$pkg/bin" fi + if [[ "$hostOffset" -le -1 ]]; then + addToSearchPath _XDG_DATA_DIRS "$pkg/share" + fi + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then addToSearchPath _HOST_PATH "$pkg/bin" fi @@ -602,13 +606,16 @@ fi PATH="${_PATH-}${_PATH:+${PATH:+:}}$PATH" HOST_PATH="${_HOST_PATH-}${_HOST_PATH:+${HOST_PATH:+:}}$HOST_PATH" +export XDG_DATA_DIRS="${_XDG_DATA_DIRS-}${_XDG_DATA_DIRS:+${XDG_DATA_DIRS:+:}}${XDG_DATA_DIRS-}" if (( "${NIX_DEBUG:-0}" >= 1 )); then echo "final path: $PATH" echo "final host path: $HOST_PATH" + echo "final data dirs: $XDG_DATA_DIRS" fi unset _PATH unset _HOST_PATH +unset _XDG_DATA_DIRS # Make GNU Make produce nested output. @@ -1037,7 +1044,7 @@ checkPhase() { runHook preCheck if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom buildPhase, doing nothing" + echo "no Makefile or custom checkPhase, doing nothing" runHook postCheck return fi @@ -1182,7 +1189,7 @@ installCheckPhase() { runHook preInstallCheck if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom buildPhase, doing nothing" + echo "no Makefile or custom installCheckPhase, doing nothing" #TODO(@oxij): should flagsArray influence make -n? elif [[ -z "${installCheckTarget:-}" ]] \ && ! make -n ${makefile:+-f $makefile} ${installCheckTarget:-installcheck} >/dev/null 2>&1; then diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/linux/default.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/linux/default.nix index 6c396b277469..6d6bca870bf9 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/linux/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/linux/default.nix @@ -274,9 +274,9 @@ in gmp = super.gmp.override { stdenv = self.makeStaticLibraries self.stdenv; }; mpfr = super.mpfr.override { stdenv = self.makeStaticLibraries self.stdenv; }; libmpc = super.libmpc.override { stdenv = self.makeStaticLibraries self.stdenv; }; - isl_0_17 = super.isl_0_17.override { stdenv = self.makeStaticLibraries self.stdenv; }; + isl_0_20 = super.isl_0_20.override { stdenv = self.makeStaticLibraries self.stdenv; }; gcc-unwrapped = super.gcc-unwrapped.override { - isl = isl_0_17; + isl = isl_0_20; }; }; extraNativeBuildInputs = [ prevStage.patchelf ] ++ diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/linux/make-bootstrap-tools.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/linux/make-bootstrap-tools.nix index ec5f1092a469..25cde589a923 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -47,6 +47,12 @@ in with pkgs; rec { stdenv.mkDerivation { name = "stdenv-bootstrap-tools"; + meta = { + # Increase priority to unblock nixpkgs-unstable + # https://github.com/NixOS/nixpkgs/pull/104679#issuecomment-732267288 + schedulingPriority = 200; + }; + nativeBuildInputs = [ buildPackages.nukeReferences buildPackages.cpio ]; buildCommand = '' @@ -152,7 +158,7 @@ in with pkgs; rec { # These needed for cross but not native tools because the stdenv # GCC has certain things built in statically. See # pkgs/stdenv/linux/default.nix for the details. - cp -d ${isl_0_17.out}/lib/libisl*.so* $out/lib + cp -d ${isl_0_20.out}/lib/libisl*.so* $out/lib '' + '' cp -d ${bzip2.out}/lib/libbz2.so* $out/lib @@ -199,6 +205,12 @@ in with pkgs; rec { dist = stdenv.mkDerivation { name = "stdenv-bootstrap-tools"; + meta = { + # Increase priority to unblock nixpkgs-unstable + # https://github.com/NixOS/nixpkgs/pull/104679#issuecomment-732267288 + schedulingPriority = 200; + }; + buildCommand = '' mkdir -p $out/nix-support echo "file tarball ${build}/on-server/bootstrap-tools.tar.xz" >> $out/nix-support/hydra-build-products diff --git a/infra/libkookie/nixpkgs/pkgs/stdenv/native/default.nix b/infra/libkookie/nixpkgs/pkgs/stdenv/native/default.nix index f6e0df161ad0..b79b81253ad5 100644 --- a/infra/libkookie/nixpkgs/pkgs/stdenv/native/default.nix +++ b/infra/libkookie/nixpkgs/pkgs/stdenv/native/default.nix @@ -78,7 +78,7 @@ let # A function that builds a "native" stdenv (one that uses tools in # /usr etc.). makeStdenv = - { cc, fetchurl, extraPath ? [], overrides ? (self: super: { }) }: + { cc, fetchurl, extraPath ? [], overrides ? (self: super: { }), extraNativeBuildInputs ? [] }: import ../generic { buildPlatform = localSystem; @@ -94,10 +94,10 @@ let if system == "x86_64-cygwin" then prehookCygwin else prehookBase; - extraNativeBuildInputs = - if system == "i686-cygwin" then extraNativeBuildInputsCygwin else + extraNativeBuildInputs = extraNativeBuildInputs ++ + (if system == "i686-cygwin" then extraNativeBuildInputsCygwin else if system == "x86_64-cygwin" then extraNativeBuildInputsCygwin else - []; + []); initialPath = extraPath ++ path; @@ -163,6 +163,7 @@ in inherit (prevStage.stdenv) cc fetchurl; extraPath = [ prevStage.xz ]; overrides = self: super: { inherit (prevStage) xz; }; + extraNativeBuildInputs = if localSystem.isLinux then [ prevStage.patchelf ] else []; }; }) |