Merge pull request #216992 from SuperSandro2000/stdenvNative-fix-eval

{bintools,cc}-wrapper: don't fallback to version = null
This commit is contained in:
Sandro 2023-04-14 11:22:20 +02:00 committed by GitHub
commit b04d4bad27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View file

@ -102,7 +102,7 @@ in
stdenv.mkDerivation {
pname = targetPrefix
+ (if name != "" then name else "${bintoolsName}-wrapper");
version = if bintools == null then null else bintoolsVersion;
version = if bintools == null then "" else bintoolsVersion;
preferLocalBuild = true;

View file

@ -161,7 +161,7 @@ assert nativePrefix == bintools.nativePrefix;
stdenv.mkDerivation {
pname = targetPrefix
+ (if name != "" then name else "${ccName}-wrapper");
version = if cc == null then null else ccVersion;
version = if cc == null then "" else ccVersion;
preferLocalBuild = true;
@ -598,8 +598,11 @@ stdenv.mkDerivation {
expandResponseParams = "${expand-response-params}/bin/expand-response-params";
shell = getBin shell + shell.shellPath or "";
gnugrep_bin = if nativeTools then "" else gnugrep;
# stdenv.cc.cc should not be null and we have nothing better for now.
# if the native impure bootstrap is gotten rid of this can become `inherit cc;` again.
cc = if nativeTools then "" else cc;
wrapperName = "CC_WRAPPER";
inherit suffixSalt coreutils_bin bintools cc;
inherit suffixSalt coreutils_bin bintools;
inherit libc_bin libc_dev libc_lib;
inherit darwinPlatformForCC darwinMinVersion darwinMinVersionVariable;
};

View file

@ -309,6 +309,7 @@ else let
hostSuffix = lib.optionalString
(stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix)
"-${stdenv.hostPlatform.config}";
# Disambiguate statically built packages. This was originally
# introduce as a means to prevent nix-env to get confused between
# nix and nixStatic. This should be also achieved by moving the
@ -319,7 +320,10 @@ else let
lib.strings.sanitizeDerivationName (
if attrs ? name
then attrs.name + hostSuffix
else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}"
else
# we cannot coerce null to a string below
assert lib.assertMsg (attrs ? version && attrs.version != null) "The version attribute cannot be null.";
"${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}"
);
}) // lib.optionalAttrs __structuredAttrs { env = checkedEnv; } // {
builder = attrs.realBuilder or stdenv.shell;