dotnet: default to source-built sdk/runtimes

This commit is contained in:
David McFarland 2024-09-22 23:36:05 -03:00
parent 691f0c0f0a
commit 07271da986
28 changed files with 160 additions and 990 deletions

View file

@ -15,7 +15,7 @@ in
zlib,
python3,
lldb,
dotnet-sdk_8,
dotnetCorePackages,
maven,
openssl,
expat,
@ -44,6 +44,8 @@ let
products = versions.${system} or (throw "Unsupported system: ${system}");
dotnet-sdk = dotnetCorePackages.sdk_8_0-source;
package = if stdenv.hostPlatform.isDarwin then ./bin/darwin.nix else ./bin/linux.nix;
mkJetBrainsProductCore = callPackage package { inherit vmopts; };
mkMeta = meta: fromSource: {
@ -188,7 +190,7 @@ rec {
for dir in plugins/clion-radler/DotFiles/linux-*; do
rm -rf $dir/dotnet
ln -s ${dotnet-sdk_8.unwrapped}/share/dotnet $dir/dotnet
ln -s ${dotnet-sdk}/share/dotnet $dir/dotnet
done
)
'';
@ -352,7 +354,7 @@ rec {
for dir in lib/ReSharperHost/linux-*; do
rm -rf $dir/dotnet
ln -s ${dotnet-sdk_8.unwrapped}/share/dotnet $dir/dotnet
ln -s ${dotnet-sdk}/share/dotnet $dir/dotnet
done
)
'';

View file

@ -106,6 +106,9 @@ rustPlatform.buildRustPackage {
-p:Deterministic=true
'';
# NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json.
NuGetAudit = "false";
passthru = {
inherit (dotnetBuild) fetch-deps;
};

View file

@ -26,8 +26,8 @@ let
dotnet-sdk =
with dotnetCorePackages;
combinePackages [
sdk_7_0_1xx
runtime_6_0
sdk_7_0_1xx-bin
runtime_6_0-bin
];
npmDepsFile = ./npm-deps.nix;

View file

@ -21,11 +21,11 @@ buildDotnetModule rec {
};
dotnet-sdk = with dotnetCorePackages; combinePackages [
sdk_7_0
sdk_6_0
sdk_7_0-bin
sdk_6_0-bin
];
dotnet-runtime = dotnetCorePackages.runtime_7_0;
dotnet-runtime = dotnetCorePackages.runtime_7_0-bin;
projectFile = [ "BeatSaberModManager/BeatSaberModManager.csproj" ];

View file

@ -26,7 +26,7 @@ buildDotnetModule rec {
nugetDeps = ./deps.json;
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-sdk = dotnetCorePackages.sdk_8_0_4xx-bin;
dotnet-runtime = dotnetCorePackages.runtime_8_0;

View file

@ -9,8 +9,8 @@ let
pname = "bililiverecorder";
dotnet = with dotnetCorePackages; combinePackages [
runtime_6_0
aspnetcore_6_0
runtime_6_0-bin
aspnetcore_6_0-bin
];
version = "2.13.0";

View file

@ -17,7 +17,7 @@ buildDotnetModule rec {
hash = "sha256-IWtYbb1IFB6DLIYYTP+q7q+h/0aqonxr/mWwf+83aRo=";
};
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
projectFile = [ "Source/Boogie.sln" ];
nugetDeps = ./deps.json;

View file

@ -11,7 +11,7 @@
makeWrapper,
ncurses5,
dotnet-sdk_8,
dotnetCorePackages,
dotnetSupport ? false,
alsa-lib,
@ -33,7 +33,7 @@
let
dyalogHome = "$out/lib/dyalog";
makeWrapperArgs = lib.optional dotnetSupport "--set DOTNET_ROOT ${dotnet-sdk_8}/share/dotnet";
makeWrapperArgs = lib.optional dotnetSupport "--set DOTNET_ROOT ${dotnetCorePackages.sdk_8_0-source}/share/dotnet";
licenseUrl = "https://www.dyalog.com/uploads/documents/Developer_Software_Licence.pdf";

View file

@ -15,7 +15,7 @@ buildDotnetModule rec {
hash = "sha256-hUURXPKhiI3n1BrW8IzVVmPuJyO4AxM8D5uluaJXk+4=";
};
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-sdk = dotnetCorePackages.sdk_8_0_4xx;
projectFile = "src/gei/gei.csproj";
nugetDeps = ./deps.json; # File generated with `nix-build -A gh-gei.passthru.fetch-deps`.

View file

@ -4,7 +4,6 @@
buildPackages,
dbus,
dotnet-sdk_6,
dotnet-sdk_8,
dotnetCorePackages,
fetchFromGitHub,
fontconfig,
@ -60,6 +59,8 @@ let
arch = stdenv.hostPlatform.linuxArch;
dotnet-sdk = dotnetCorePackages.sdk_8_0-source;
attrs = finalAttrs: rec {
pname = "godot4${suffix}";
version = "4.3-stable";
@ -154,7 +155,7 @@ let
]
++ lib.optionals withWayland [ wayland-scanner ]
++ lib.optionals withMono [
dotnet-sdk_8
dotnet-sdk
makeWrapper
];
@ -222,10 +223,10 @@ let
+ lib.optionalString withMono ''
cp -r bin/GodotSharp/ $out/bin/
wrapProgram $out/bin/godot4${suffix} \
--set DOTNET_ROOT ${dotnet-sdk_8} \
--set DOTNET_ROOT ${dotnet-sdk} \
--prefix PATH : "${
lib.makeBinPath [
dotnet-sdk_8
dotnet-sdk
]
}"
''

View file

@ -2,7 +2,7 @@
let
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
xplat = fetchurl {
url = "https://github.com/mono/msbuild/releases/download/v16.9.0/mono_msbuild_6.12.0.137.zip";

View file

@ -33,7 +33,7 @@ buildDotnetModule rec {
inherit
(combinePackages [
sdk_8_0
sdk_6_0
sdk_6_0-bin
])
packages
targetPackages

View file

@ -21,7 +21,7 @@ buildDotnetModule rec {
sha256 = "1n2312acq5rq0jizlcfk0crslx3wgcsd836p47nk3pnapzw0cqvv";
};
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
nativeBuildInputs = [
unzip

View file

@ -30,8 +30,8 @@ buildDotnetModule rec {
executables = [ "PabloDraw" ];
dotnet-sdk = dotnetCorePackages.sdk_7_0;
dotnet-runtime = dotnetCorePackages.runtime_7_0;
dotnet-sdk = dotnetCorePackages.sdk_7_0-bin;
dotnet-runtime = dotnetCorePackages.runtime_7_0-bin;
nugetDeps = ./deps.json;

View file

@ -17,7 +17,7 @@ buildDotnetModule rec {
hash = "sha256-4iXabFp0LqJ8TXOrqeD+oTAocg6ZTIfijfX3s3fMJuI=";
};
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
projectFile = [ "src/NuGet/Microsoft.Net.Compilers.Toolset/Microsoft.Net.Compilers.Toolset.Package.csproj" ];

View file

@ -34,7 +34,7 @@ buildDotnetModule rec {
enableParallelBuilding = false;
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-sdk = dotnetCorePackages.sdk_8_0_4xx-bin;
dotnet-runtime = dotnetCorePackages.runtime_8_0;
nugetDeps = ./deps.json;

View file

@ -69,8 +69,8 @@ buildDotnetModule {
runtimeDeps = [ sqlite ];
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnetCorePackages.aspnetcore_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
dotnet-runtime = dotnetCorePackages.aspnetcore_6_0-bin;
doCheck = true;

View file

@ -22,8 +22,8 @@ buildDotnetModule rec {
projectFile = "WalletWasabi.Backend/WalletWasabi.Backend.csproj";
nugetDeps = ./deps.json;
dotnet-sdk = dotnetCorePackages.sdk_7_0;
dotnet-runtime = dotnetCorePackages.aspnetcore_7_0;
dotnet-sdk = dotnetCorePackages.sdk_7_0-bin;
dotnet-runtime = dotnetCorePackages.aspnetcore_7_0-bin;
buildInputs = [(lib.getLib stdenv.cc.cc) zlib];

View file

@ -5,5 +5,5 @@
releaseInfoFile = ./release-info.json;
bootstrapSdkFile = ./bootstrap-sdk.nix;
depsFile = ./deps.json;
fallbackTargetPackages = dotnetCorePackages.sdk_8_0.targetPackages;
fallbackTargetPackages = dotnetCorePackages.sdk_8_0-bin.targetPackages;
}

View file

@ -6,5 +6,5 @@
bootstrapSdkFile = ./bootstrap-sdk.nix;
allowPrerelease = true;
depsFile = ./deps.json;
fallbackTargetPackages = dotnetCorePackages.sdk_9_0.targetPackages;
fallbackTargetPackages = dotnetCorePackages.sdk_9_0-bin.targetPackages;
}

View file

@ -18,7 +18,7 @@ in
assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
You must include at least one package, e.g
`with dotnetCorePackages; combinePackages [
sdk_6_0 aspnetcore_7_0
sdk_9_0 aspnetcore_8_0
];`'';
mkWrapper "sdk" (buildEnv {
name = "dotnet-combined";

View file

@ -1,6 +1,6 @@
/*
How to combine packages for use in development:
dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_6_0 aspnetcore_7_0 ];
dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_9_0 aspnetcore_8_0 ];
Hashes and urls are retrieved from:
https://dotnet.microsoft.com/download/dotnet
@ -13,74 +13,115 @@
makeScopeWithSplicing',
}:
makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope "dotnetCorePackages";
f = (
self:
let
callPackage = self.callPackage;
let
pkgs = makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope "dotnetCorePackages";
f = (
self:
let
callPackage = self.callPackage;
fetchNupkg = callPackage ../../../build-support/dotnet/fetch-nupkg { };
fetchNupkg = callPackage ../../../build-support/dotnet/fetch-nupkg { };
buildDotnet = attrs: callPackage (import ./build-dotnet.nix attrs) { };
buildDotnetSdk =
version:
import version {
inherit fetchNupkg;
buildAspNetCore = attrs: buildDotnet (attrs // { type = "aspnetcore"; });
buildNetRuntime = attrs: buildDotnet (attrs // { type = "runtime"; });
buildNetSdk = attrs: buildDotnet (attrs // { type = "sdk"; });
buildDotnet = attrs: callPackage (import ./build-dotnet.nix attrs) { };
buildDotnetSdk =
version:
import version {
inherit fetchNupkg;
buildAspNetCore = attrs: buildDotnet (attrs // { type = "aspnetcore"; });
buildNetRuntime = attrs: buildDotnet (attrs // { type = "runtime"; });
buildNetSdk = attrs: buildDotnet (attrs // { type = "sdk"; });
};
## Files in versions/ are generated automatically by update.sh ##
dotnet-bin = lib.mergeAttrsList (
map buildDotnetSdk [
./versions/6.0.nix
./versions/7.0.nix
./versions/8.0.nix
./versions/9.0.nix
]
);
runtimeIdentifierMap = {
"x86_64-linux" = "linux-x64";
"aarch64-linux" = "linux-arm64";
"x86_64-darwin" = "osx-x64";
"aarch64-darwin" = "osx-arm64";
"x86_64-windows" = "win-x64";
"i686-windows" = "win-x86";
};
## Files in versions/ are generated automatically by update.sh ##
dotnet_6_0 = buildDotnetSdk ./versions/6.0.nix;
dotnet_7_0 = buildDotnetSdk ./versions/7.0.nix;
dotnet_8_0 = buildDotnetSdk ./versions/8.0.nix;
dotnet_9_0 = buildDotnetSdk ./versions/9.0.nix;
in
lib.optionalAttrs config.allowAliases (
{
# EOL
sdk_2_1 = throw "Dotnet SDK 2.1 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_2_2 = throw "Dotnet SDK 2.2 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_3_0 = throw "Dotnet SDK 3.0 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_3_1 = throw "Dotnet SDK 3.1 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_5_0 = throw "Dotnet SDK 5.0 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
}
// dotnet-bin
)
// lib.mapAttrs' (k: v: lib.nameValuePair "${k}-bin" v) dotnet-bin
// {
inherit callPackage fetchNupkg buildDotnetSdk;
runtimeIdentifierMap = {
"x86_64-linux" = "linux-x64";
"aarch64-linux" = "linux-arm64";
"x86_64-darwin" = "osx-x64";
"aarch64-darwin" = "osx-arm64";
"x86_64-windows" = "win-x64";
"i686-windows" = "win-x86";
};
# Convert a "stdenv.hostPlatform.system" to a dotnet RID
systemToDotnetRid =
system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
in
{
inherit callPackage fetchNupkg buildDotnetSdk;
combinePackages = attrs: callPackage (import ./combine-packages.nix attrs) { };
# Convert a "stdenv.hostPlatform.system" to a dotnet RID
systemToDotnetRid =
system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");
patchNupkgs = callPackage ./patch-nupkgs.nix { };
nugetPackageHook = callPackage ./nuget-package-hook.nix { };
combinePackages = attrs: callPackage (import ./combine-packages.nix attrs) { };
buildDotnetModule = callPackage ../../../build-support/dotnet/build-dotnet-module { };
buildDotnetGlobalTool = callPackage ../../../build-support/dotnet/build-dotnet-global-tool { };
patchNupkgs = callPackage ./patch-nupkgs.nix { };
nugetPackageHook = callPackage ./nuget-package-hook.nix { };
mkNugetSource = callPackage ../../../build-support/dotnet/make-nuget-source { };
mkNugetDeps = callPackage ../../../build-support/dotnet/make-nuget-deps { };
addNuGetDeps = callPackage ../../../build-support/dotnet/add-nuget-deps { };
buildDotnetModule = callPackage ../../../build-support/dotnet/build-dotnet-module { };
buildDotnetGlobalTool = callPackage ../../../build-support/dotnet/build-dotnet-global-tool { };
mkNugetSource = callPackage ../../../build-support/dotnet/make-nuget-source { };
mkNugetDeps = callPackage ../../../build-support/dotnet/make-nuget-deps { };
addNuGetDeps = callPackage ../../../build-support/dotnet/add-nuget-deps { };
dotnet_8 = recurseIntoAttrs (callPackage ./8 { });
dotnet_9 = recurseIntoAttrs (callPackage ./9 { });
}
// lib.optionalAttrs config.allowAliases {
# EOL
sdk_2_1 = throw "Dotnet SDK 2.1 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_2_2 = throw "Dotnet SDK 2.2 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_3_0 = throw "Dotnet SDK 3.0 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_3_1 = throw "Dotnet SDK 3.1 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
sdk_5_0 = throw "Dotnet SDK 5.0 is EOL, please use 8.0 (LTS) or 9.0 (Current)";
}
// dotnet_6_0
// dotnet_7_0
// dotnet_8_0
// dotnet_9_0
dotnet_8 = recurseIntoAttrs (callPackage ./8 { });
dotnet_9 = recurseIntoAttrs (callPackage ./9 { });
}
);
};
in
pkgs
// rec {
# use binary SDK here to avoid downgrading feature band
sdk_8_0_1xx = if !pkgs.dotnet_8.vmr.meta.broken then pkgs.dotnet_8.sdk else pkgs.sdk_8_0_1xx-bin;
# source-built SDK only exists for _1xx feature band
sdk_8_0_4xx = pkgs.callPackage ./wrapper.nix { } "sdk" (
pkgs.sdk_8_0_4xx-bin.unwrapped.overrideAttrs (old: {
passthru =
old.passthru
// {
inherit (sdk_8_0_1xx)
runtime
aspnetcore
;
}
# We can't use the source-built packages until ilcompiler is fixed (see vmr.nix)
// lib.optionalAttrs sdk_8_0_1xx.hasILCompiler {
inherit (sdk_8_0_1xx)
packages
targetPackages
;
};
})
);
sdk_8_0 = sdk_8_0_4xx;
sdk_8_0-source = sdk_8_0_1xx;
runtime_8_0 = sdk_8_0.runtime;
aspnetcore_8_0 = sdk_8_0.aspnetcore;
}
// rec {
sdk_9_0_1xx = if !pkgs.dotnet_9.vmr.meta.broken then pkgs.dotnet_9.sdk else pkgs.sdk_9_0_1xx-bin;
sdk_9_0 = sdk_9_0_1xx;
runtime_9_0 = sdk_9_0.runtime;
aspnetcore_9_0 = sdk_9_0.aspnetcore;
}

View file

@ -28,7 +28,7 @@ buildDotnetModule rec {
nugetDeps = ./deps.json;
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-sdk = dotnetCorePackages.sdk_8_0_4xx-bin;
dotnet-runtime = dotnetCorePackages.runtime_8_0;
postInstall = ''

View file

@ -17,8 +17,8 @@ buildDotnetModule rec {
nugetDeps = engine.deps;
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnetCorePackages.runtime_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
dotnet-runtime = dotnetCorePackages.runtime_6_0-bin;
useAppHost = false;

View file

@ -26,7 +26,15 @@ buildDotnetModule rec {
dotnet-runtime = dotnetCorePackages.aspnetcore_8_0;
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnetInstallFlags = [ "-p:TargetFramework=net8.0" ];
dotnetInstallFlags = [
"--framework"
"net8.0"
];
postPatch = ''
substituteInPlace ${projectFile} ${testProjectFile} \
--replace-fail '<TargetFrameworks>net8.0;net462</' '<TargetFrameworks>net8.0</'
'';
runtimeDeps = [ openssl ];

File diff suppressed because it is too large Load diff

View file

@ -27,8 +27,8 @@ buildDotnetModule rec {
# Fixes application reporting 0.0.0.0 as its version.
MINVERVERSIONOVERRIDE = version;
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnetCorePackages.aspnetcore_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
dotnet-runtime = dotnetCorePackages.aspnetcore_6_0-bin;
nativeBuildInputs = [ git glibcLocales bintools ];

View file

@ -411,18 +411,18 @@ with pkgs;
dotnetCorePackages = recurseIntoAttrs (callPackage ../development/compilers/dotnet {});
dotnet-sdk_6 = dotnetCorePackages.sdk_6_0;
dotnet-sdk_7 = dotnetCorePackages.sdk_7_0;
dotnet-sdk_6 = dotnetCorePackages.sdk_6_0-bin;
dotnet-sdk_7 = dotnetCorePackages.sdk_7_0-bin;
dotnet-sdk_8 = dotnetCorePackages.sdk_8_0;
dotnet-sdk_9 = dotnetCorePackages.sdk_9_0;
dotnet-runtime_6 = dotnetCorePackages.runtime_6_0;
dotnet-runtime_7 = dotnetCorePackages.runtime_7_0;
dotnet-runtime_6 = dotnetCorePackages.runtime_6_0-bin;
dotnet-runtime_7 = dotnetCorePackages.runtime_7_0-bin;
dotnet-runtime_8 = dotnetCorePackages.runtime_8_0;
dotnet-runtime_9 = dotnetCorePackages.runtime_9_0;
dotnet-aspnetcore_6 = dotnetCorePackages.aspnetcore_6_0;
dotnet-aspnetcore_7 = dotnetCorePackages.aspnetcore_7_0;
dotnet-aspnetcore_6 = dotnetCorePackages.aspnetcore_6_0-bin;
dotnet-aspnetcore_7 = dotnetCorePackages.aspnetcore_7_0-bin;
dotnet-aspnetcore_8 = dotnetCorePackages.aspnetcore_8_0;
dotnet-aspnetcore_9 = dotnetCorePackages.aspnetcore_9_0;