Something went wrong. Try again.
lol
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222{ config, stdenvNoCC, callPackage, lib, fetchurl, channel, featureBand ? "1xx", dir ? ../. + ("/" + channel), releaseManifestFile ? dir + "/release.json", releaseInfoFile ? dir + "/release-info.json", bootstrapSdkFile ? dir + "/bootstrap-sdk.nix", bootstrapSdk ? null, depsFile ? dir + "/deps.json", pkgsBuildHost, buildDotnetSdk, withBinary ? true, combinePackages, systemToDotnetRid, binary,}@attrs:
assert bootstrapSdk != null || bootstrapSdkFile != null;
let suffix = let parts = lib.splitVersion channel; major = lib.elemAt parts 0; sdk = lib.concatStringsSep "_" (parts ++ [ featureBand ]); in { source = if featureBand == "1xx" then major else sdk; channel = lib.concatStringsSep "_" (lib.take 2 parts); inherit major sdk; };
releaseInfo = (lib.importJSON releaseInfoFile); inherit (releaseInfo) tarballHash artifactsUrl artifactsHash ;
artifacts = stdenvNoCC.mkDerivation { name = lib.nameFromURL artifactsUrl ".tar.gz";
src = fetchurl { url = artifactsUrl; hash = artifactsHash; };
sourceRoot = ".";
installPhase = '' mkdir -p $out cp -r * $out/ ''; };
vmr = if bootstrapSdk != null then callPackage ./vmr.nix { inherit releaseManifestFile tarballHash ; bootstrapSdk = bootstrapSdk.unwrapped; hasRuntime = false; } else callPackage ./stage1.nix { inherit releaseManifestFile tarballHash depsFile ; bootstrapSdk = (buildDotnetSdk bootstrapSdkFile).sdk.unwrapped.overrideAttrs (old: { passthru = old.passthru or { } // { inherit artifacts; }; }); };
fallbackSdk = binary.${"sdk_${suffix.sdk}"}; fallbackTargetPackages = fallbackSdk.targetPackages;
vmrPackages = let pkgs = callPackage ./packages.nix { inherit vmr fallbackTargetPackages; }; in lib.recurseIntoAttrs pkgs;
source = vmrPackages // lib.optionalAttrs vmr.meta.broken rec { sdk = fallbackSdk; inherit (sdk) runtime aspnetcore; };
# combine an SDK with the runtime/packages from a base SDK combineSdk = base: fallback: if (fallback.runtime.version != base.runtime.version) then throw "combineSdk: unable to combine ${fallback.name} with ${base.name} because runtime versions don't match (${fallback.runtime.version} != ${base.runtime.version})" else if base.meta.broken then fallback else let withBaseRuntimes = if fallback.version == base.version then base.unwrapped else (combinePackages [ base.runtime base.aspnetcore fallback ]).unwrapped.overrideAttrs (old: { name = fallback.unwrapped.name; # resolve symlinks so DOTNET_ROOT is self-contained postBuild = '' mv "$out"/share/dotnet{,~} cp -Lr "$out"/share/dotnet{~,} rm -r "$out"/share/dotnet~ '' + old.postBuild; passthru = old.passthru // { inherit (base) runtime aspnetcore ; inherit (fallback.unwrapped) pname version hasILCompiler ; }; });
withFallbackPackages = withBaseRuntimes.overrideAttrs (old: { passthru = old.passthru // ( let hostRid = systemToDotnetRid base.stdenv.hostPlatform.system; hasILCompiler = base.hasILCompiler || withBaseRuntimes.hasILCompiler; packageName = "runtime.${hostRid}.Microsoft.DotNet.ILCompiler"; mergePackages = a: b: let names = lib.genAttrs' a (p: lib.nameValuePair p.pname null); in a ++ lib.filter (p: !lib.hasAttr p.pname names) b; packages = mergePackages base.packages fallback.packages; targetPackages = lib.mapAttrs ( name: value: mergePackages value fallback.targetPackages.${name} ) base.targetPackages; in { inherit hasILCompiler packages targetPackages; } ); }); in callPackage ../wrapper.nix { } "sdk" withFallbackPackages;in{ "dotnet_${suffix.source}" = vmrPackages;}// ( let combined = lib.mapAttrs (s: v: combineSdk source.sdk v) ( if withBinary then lib.filterAttrs (n: _: lib.substring 0 4 n == "sdk_") binary else { "sdk_${suffix.sdk}" = binary.${"sdk_${suffix.sdk}"}; } // lib.optionalAttrs (lib.versionAtLeast source.sdk.version binary.${"sdk_${suffix.channel}"}.version) { "sdk_${suffix.channel}" = binary.${"sdk_${suffix.channel}"}; } ); in combined // { "sdk_${suffix.channel}-source" = source.sdk; "runtime_${suffix.channel}" = source.runtime; "aspnetcore_${suffix.channel}" = source.aspnetcore; })// lib.optionalAttrs withBinary ( lib.mergeAttrsList ( map ( featureBand: callPackage ./default.nix ( attrs // { inherit featureBand; dir = dir + "/${featureBand}"; withBinary = false; bootstrapSdk = vmrPackages.sdk; } ) ) ( lib.filter (x: x != "1xx") ( map (x: lib.elemAt x 2) ( lib.filter (x: x != null && lib.versionAtLeast (lib.elemAt x 0) "10") ( map (lib.match "sdk_(.*)_(.*)_(.*)") (lib.attrNames binary) ) ) ) ) ))