diff options
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/darwin/default.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/darwin/make-bootstrap-tools.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/default.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/freebsd/default.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/generic/check-meta.nix | 10 | ||||
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/generic/make-derivation.nix | 13 | ||||
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 30 | ||||
-rw-r--r-- | pkgs/stdenv/linux/bootstrap-files/powerpc64le.nix | 25 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 5 | ||||
-rw-r--r-- | pkgs/stdenv/linux/make-bootstrap-tools-cross.nix | 2 | ||||
-rw-r--r-- | pkgs/stdenv/linux/make-bootstrap-tools.nix | 10 |
12 files changed, 79 insertions, 25 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 89132b8b3bb9a..32e4fe9749ab3 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -75,7 +75,7 @@ rec { inherit (bootstrapFiles) mkdir bzip2 cpio tarball; __impureHostDeps = commonImpureHostDeps; - } // lib.optionalAttrs (config.contentAddressedByDefault or false) { + } // lib.optionalAttrs config.contentAddressedByDefault { __contentAddressed = true; outputHashAlgo = "sha256"; outputHashMode = "recursive"; diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index 9bbdcbf81d5a2..1fed692fd1cee 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -80,7 +80,7 @@ in rec { cp ${curl_.bin}/bin/curl $out/bin cp -d ${curl_.out}/lib/libcurl*.dylib $out/lib cp -d ${libssh2.out}/lib/libssh*.dylib $out/lib - cp -d ${openssl.out}/lib/*.dylib $out/lib + cp -d ${lib.getLib openssl}/lib/*.dylib $out/lib cp -d ${gnugrep.pcre.out}/lib/libpcre*.dylib $out/lib cp -d ${lib.getLib libiconv}/lib/lib*.dylib $out/lib diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix index 0d328d98ba110..25a593c67437c 100644 --- a/pkgs/stdenv/default.nix +++ b/pkgs/stdenv/default.nix @@ -53,6 +53,7 @@ in armv8m-linux = stagesLinux; aarch64-linux = stagesLinux; mipsel-linux = stagesLinux; + mips64el-linux = stagesLinux; powerpc-linux = /* stagesLinux */ stagesNative; powerpc64-linux = stagesLinux; powerpc64le-linux = stagesLinux; diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix index ddcdc6a66e087..de66085876052 100644 --- a/pkgs/stdenv/freebsd/default.nix +++ b/pkgs/stdenv/freebsd/default.nix @@ -182,7 +182,7 @@ in buildInputs = [ make ]; mkdir = "/bin/mkdir"; ln = "/bin/ln"; - } // lib.optionalAttrs (config.contentAddressedByDefault or false) { + } // lib.optionalAttrs config.contentAddressedByDefault { __contentAddressed = true; outputHashAlgo = "sha256"; outputHashMode = "recursive"; diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix index 44caa6838e8df..8ad5fa6b89bdf 100644 --- a/pkgs/stdenv/generic/check-meta.nix +++ b/pkgs/stdenv/generic/check-meta.nix @@ -19,16 +19,9 @@ let allowlist = config.allowlistedLicenses or config.whitelistedLicenses or []; blocklist = config.blocklistedLicenses or config.blacklistedLicenses or []; - onlyLicenses = list: - lib.lists.all (license: - let l = lib.licenses.${license.shortName or "BROKEN"} or false; in - if license == l then true else - throw ''‘${showLicense license}’ is not an attribute of lib.licenses'' - ) list; - areLicenseListsValid = if lib.mutuallyExclusive allowlist blocklist then - assert onlyLicenses allowlist; assert onlyLicenses blocklist; true + true else throw "allowlistedLicenses and blocklistedLicenses are not mutually exclusive."; @@ -247,7 +240,6 @@ let outputsToInstall = listOf str; position = str; available = bool; - repositories = attrsOf str; isBuildPythonPackage = platforms; schedulingPriority = int; isFcitxEngine = bool; diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 4fb98e5e8013e..5f49aca5aa919 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -90,7 +90,7 @@ let allowedRequisites = allowedRequisites ++ defaultNativeBuildInputs ++ defaultBuildInputs; } - // lib.optionalAttrs (config.contentAddressedByDefault or false) { + // lib.optionalAttrs config.contentAddressedByDefault { __contentAddressed = true; outputHashAlgo = "sha256"; outputHashMode = "recursive"; diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 2465449867cb2..d1b93874a25a3 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -69,7 +69,7 @@ in , doInstallCheck ? config.doCheckByDefault or false , # TODO(@Ericson2314): Make always true and remove - strictDeps ? stdenv.hostPlatform != stdenv.buildPlatform + strictDeps ? if config.strictDepsByDefault then true else stdenv.hostPlatform != stdenv.buildPlatform , meta ? {} , passthru ? {} , pos ? # position used in error messages and for meta.position @@ -93,7 +93,7 @@ in , __contentAddressed ? (! attrs ? outputHash) # Fixed-output drvs can't be content addressed too - && (config.contentAddressedByDefault or false) + && config.contentAddressedByDefault , ... } @ attrs: @@ -219,9 +219,11 @@ else let # it again. staticMarker = lib.optionalString stdenv.hostPlatform.isStatic "-static"; in + lib.strings.sanitizeDerivationName ( if attrs ? name then attrs.name + hostSuffix - else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}"; + else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}" + ); }) // { builder = attrs.realBuilder or stdenv.shell; args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)]; @@ -340,8 +342,9 @@ else let # passed to the builder and is not a dependency. But since we # include it in the result, it *is* available to nix-env for queries. meta = { - # `name` above includes cross-compilation cruft (and is under assert), - # lets have a clean always accessible version here. + # `name` above includes cross-compilation cruft, + # is under assert, and is sanitized. + # Let's have a clean always accessible version here. name = attrs.name or "${attrs.pname}-${attrs.version}"; # If the packager hasn't specified `outputsToInstall`, choose a default, diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 0777fa830c109..6d30e6c01ffbf 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -143,14 +143,14 @@ exitHandler() { echo "build failed with exit code $exitCode (ignored)" mkdir -p "$out/nix-support" printf "%s" "$exitCode" > "$out/nix-support/failed" - exit 0 + return 0 fi else runHook exitHook fi - exit "$exitCode" + return "$exitCode" } trap "exitHandler" EXIT @@ -1305,6 +1305,23 @@ showPhaseHeader() { } +showPhaseFooter() { + local phase="$1" + local startTime="$2" + local endTime="$3" + local delta=$(( endTime - startTime )) + (( $delta < 30 )) && return + + local H=$((delta/3600)) + local M=$((delta%3600/60)) + local S=$((delta%60)) + echo -n "$phase completed in " + (( $H > 0 )) && echo -n "$H hours " + (( $M > 0 )) && echo -n "$M minutes " + echo "$S seconds" +} + + genericBuild() { if [ -f "${buildCommandPath:-}" ]; then source "$buildCommandPath" @@ -1340,11 +1357,20 @@ genericBuild() { showPhaseHeader "$curPhase" dumpVars + local startTime=$(date +"%s") + # Evaluate the variable named $curPhase if it exists, otherwise the # function named $curPhase. eval "${!curPhase:-$curPhase}" + local endTime=$(date +"%s") + + showPhaseFooter "$curPhase" "$startTime" "$endTime" + if [ "$curPhase" = unpackPhase ]; then + # make sure we can cd into the directory + [ -z "${sourceRoot}" ] || chmod +x "${sourceRoot}" + cd "${sourceRoot:-.}" fi done diff --git a/pkgs/stdenv/linux/bootstrap-files/powerpc64le.nix b/pkgs/stdenv/linux/bootstrap-files/powerpc64le.nix new file mode 100644 index 0000000000000..9f09a6b60a435 --- /dev/null +++ b/pkgs/stdenv/linux/bootstrap-files/powerpc64le.nix @@ -0,0 +1,25 @@ +# +# Files came from this Hydra build: +# +# https://hydra.nixos.org/build/172142499 +# +# Which used nixpkgs revision 49a83445c28c4ffb8a1a90a1f68e6150ea48893b +# to instantiate: +# +# /nix/store/gj272sd56gsj6qpyzh4njpfzwdhviliz-stdenv-bootstrap-tools-powerpc64le-unknown-linux-gnu.drv +# +# and then built: +# +# /nix/store/n81pljbd8m0xgypm84krc2bnvqgjrfxx-stdenv-bootstrap-tools-powerpc64le-unknown-linux-gnu +# +{ + busybox = import <nix/fetchurl.nix> { + url = "http://tarballs.nixos.org/stdenv-linux/powerpc64le/49a83445c28c4ffb8a1a90a1f68e6150ea48893b/busybox"; + sha256 = "sha256-UscnfGKOZAKLkPcRtwrbT5Uj8m3Kj9jhkKp9MUc1eCY="; + executable = true; + }; + bootstrapTools =import <nix/fetchurl.nix> { + url = "http://tarballs.nixos.org/stdenv-linux/powerpc64le/49a83445c28c4ffb8a1a90a1f68e6150ea48893b/bootstrap-tools.tar.xz"; + sha256 = "sha256-A20GKGn3rM8K2JcU0SApRp3+avUE+bIm1h632AitRzU="; + }; +} diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index d2c28b97ff939..5c5ca64b1e956 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -16,6 +16,7 @@ armv7l-linux = import ./bootstrap-files/armv7l.nix; aarch64-linux = import ./bootstrap-files/aarch64.nix; mipsel-linux = import ./bootstrap-files/loongson2f.nix; + powerpc64le-linux = import ./bootstrap-files/powerpc64le.nix; riscv64-linux = import ./bootstrap-files/riscv64.nix; }; musl = { @@ -65,7 +66,7 @@ let bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) { inherit system bootstrapFiles; extraAttrs = lib.optionalAttrs - (config.contentAddressedByDefault or false) + config.contentAddressedByDefault { __contentAddressed = true; outputHashAlgo = "sha256"; @@ -204,7 +205,7 @@ in # Rebuild binutils to use from stage2 onwards. overrides = self: super: { binutils-unwrapped = super.binutils-unwrapped.override { - gold = false; + enableGold = false; }; inherit (prevStage) ccWrapperStdenv diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix index d8ab96952b7f2..9fc2300b6efa5 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix @@ -17,6 +17,8 @@ in lib.mapAttrs (n: make) (with lib.systems.examples; { armv6l-musl = muslpi; aarch64-musl = aarch64-multiplatform-musl; riscv64 = riscv64; + mips64el-linux-gnuabin32 = mips64el-linux-gnuabin32; + mips64el-linux-gnuabi64 = mips64el-linux-gnuabi64; powerpc64 = ppc64; powerpc64-musl = ppc64-musl; powerpc64le = powernv; diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 84b63e7b8fd0e..d23a996dfcb48 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -37,7 +37,7 @@ in with pkgs; rec { bootBinutils = binutils.bintools.override { withAllTargets = false; # Don't need two linkers, disable whatever's not primary/default. - gold = false; + enableGold = false; # bootstrap is easier w/static enableShared = false; }; @@ -74,6 +74,9 @@ in with pkgs; rec { cp -d ${libc.out}/lib/libresolv*.so* $out/lib cp -d ${libc.out}/lib/crt?.o $out/lib + # Hacky compat with our current unpack-bootstrap-tools.sh + ln -s librt.so "$out"/lib/librt-dummy.so + cp -rL ${libc.dev}/include $out chmod -R u+w "$out" @@ -172,7 +175,7 @@ in with pkgs; rec { for i in as ld ar ranlib nm strip readelf objdump; do cp ${bootBinutils.out}/bin/$i $out/bin done - cp '${lib.getLib binutils.bintools}'/lib/* "$out/lib/" + cp -r '${lib.getLib binutils.bintools}'/lib/* "$out/lib/" chmod -R u+w $out @@ -186,6 +189,7 @@ in with pkgs; rec { nuke-refs $out/bin/* nuke-refs $out/lib/* + nuke-refs $out/lib/*/* nuke-refs $out/libexec/gcc/*/*/* nuke-refs $out/lib/gcc/*/*/* nuke-refs $out/lib/gcc/*/*/include-fixed/*{,/*} @@ -231,7 +235,7 @@ in with pkgs; rec { bootstrapTools = let extraAttrs = lib.optionalAttrs - (config.contentAddressedByDefault or false) + config.contentAddressedByDefault { __contentAddressed = true; outputHashAlgo = "sha256"; |