Skip to content

Commit

Permalink
dotnet: default to source-built sdk/runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
corngood committed Dec 8, 2024
1 parent ffd1002 commit 31e7828
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 64 deletions.
4 changes: 2 additions & 2 deletions pkgs/applications/misc/avalonia-ilspy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ buildDotnetModule rec {
ln -s $out/bin/ILSpy $out/Applications/ILSpy.app/Contents/MacOS/ILSpy
'';

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;

projectFile = "ILSpy/ILSpy.csproj";
nugetDeps = ./deps.nix;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/al/alttpr-opentracker/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ buildDotnetModule rec {

patches = [./remove-project.patch];

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;

nugetDeps = ./deps.nix;

Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/av/avalonia/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/az/azure-functions-core-tools/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ buildDotnetModule rec {
pname = "azure-functions-core-tools";
inherit src version;

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-runtime = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
dotnet-runtime = dotnetCorePackages.sdk_6_0-bin;
nugetDeps = ./deps.nix;
useDotnetFromEnv = true;
executables = [ "func" ];
Expand Down
6 changes: 3 additions & 3 deletions pkgs/by-name/be/beatsabermodmanager/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/bi/bicep/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buildDotnetModule rec {

nugetDeps = ./deps.nix;

dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-sdk = dotnetCorePackages.sdk_8_0_4xx-bin;

dotnet-runtime = dotnetCorePackages.runtime_8_0;

Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/bi/bililiverecorder/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/fo/formula/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildDotnetModule rec {
postFixup = if stdenv.hostPlatform.isLinux then ''
mv $out/bin/CommandLine $out/bin/formula
'' else lib.optionalString stdenv.hostPlatform.isDarwin ''
makeWrapper ${dotnetCorePackages.runtime_6_0}/bin/dotnet $out/bin/formula \
makeWrapper ${dotnetCorePackages.runtime_6_0-bin}/bin/dotnet $out/bin/formula \
--add-flags "$out/lib/formula-dotnet/CommandLine.dll" \
--prefix DYLD_LIBRARY_PATH : $out/lib/formula-dotnet/runtimes/macos/native
'';
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/in/inklecate/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ buildDotnetModule rec {
nugetDeps = ./deps.nix;
executables = [ "inklecate" ];

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;

meta = with lib; {
description = "Compiler for ink, inkle's scripting language";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/lu/lumafly/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ buildDotnetModule rec {

nugetDeps = ./deps.nix;

dotnet-sdk = dotnetCorePackages.sdk_7_0;
dotnet-sdk = dotnetCorePackages.sdk_7_0-bin;

selfContainedBuild = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ms/msbuild/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/na/naps2/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buildDotnetModule rec {

executables = [ "naps2" ];

dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_6_0 sdk_8_0 ];
dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_6_0-bin sdk_8_0 ];
dotnet-runtime = dotnetCorePackages.runtime_8_0;
selfContainedBuild = true;
runtimeDeps = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/pa/pablodraw/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.nix;

Expand Down
16 changes: 16 additions & 0 deletions pkgs/by-name/ro/roslyn-ls/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let
pname = "roslyn-ls";
dotnet-sdk =
with dotnetCorePackages;
<<<<<<< HEAD
sdk_9_0
// {
inherit
Expand All @@ -26,6 +27,21 @@ let
targetPackages
;
};
||||||| parent of d4282248b2bc (dotnet: default to source-built sdk/runtimes)
combinePackages [
sdk_6_0
sdk_7_0
sdk_8_0
sdk_9_0
];
=======
combinePackages [
sdk_6_0-bin
sdk_7_0-bin
sdk_8_0
sdk_9_0
];
>>>>>>> d4282248b2bc (dotnet: default to source-built sdk/runtimes)
# need sdk on runtime as well
dotnet-runtime = dotnetCorePackages.sdk_9_0;
rid = dotnetCorePackages.systemToDotnetRid stdenvNoCC.targetPlatform.system;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ro/roslyn/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ry/ryujinx/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.nix;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/so/sonarr/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/to/tone/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildDotnetModule rec {
"-p:PublishSingleFile=false"
];

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
runtimeDeps = [ ffmpeg-full ];

meta = with lib; {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/wa/wasabibackend/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ buildDotnetModule rec {
projectFile = "WalletWasabi.Backend/WalletWasabi.Backend.csproj";
nugetDeps = ./deps.nix;

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];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/dotnet/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
releaseInfoFile = ./release-info.json;
bootstrapSdkFile = ./bootstrap-sdk.nix;
depsFile = ./deps.nix;
fallbackTargetPackages = dotnetCorePackages.sdk_8_0.targetPackages;
fallbackTargetPackages = dotnetCorePackages.sdk_8_0-bin.targetPackages;
}
2 changes: 1 addition & 1 deletion pkgs/development/compilers/dotnet/9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
bootstrapSdkFile = ./bootstrap-sdk.nix;
allowPrerelease = true;
depsFile = ./deps.nix;
fallbackTargetPackages = dotnetCorePackages.sdk_9_0.targetPackages;
fallbackTargetPackages = dotnetCorePackages.sdk_9_0-bin.targetPackages;
}
2 changes: 1 addition & 1 deletion pkgs/development/compilers/dotnet/combine-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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_6_0-bin aspnetcore_7_0-bin
];`'';
mkWrapper "sdk" (buildEnv {
name = "dotnet-combined";
Expand Down
50 changes: 32 additions & 18 deletions pkgs/development/compilers/dotnet/default.nix
Original file line number Diff line number Diff line change
@@ -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_6_0-bin aspnetcore_7_0-bin ];
Hashes and urls are retrieved from:
https://dotnet.microsoft.com/download/dotnet
Expand Down Expand Up @@ -33,10 +33,14 @@ makeScopeWithSplicing' {
};

## 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;
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";
Expand All @@ -48,7 +52,19 @@ makeScopeWithSplicing' {
};

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
// rec {
inherit callPackage fetchNupkg buildDotnetSdk;

# Convert a "stdenv.hostPlatform.system" to a dotnet RID
Expand All @@ -69,18 +85,16 @@ makeScopeWithSplicing' {

dotnet_8 = recurseIntoAttrs (callPackage ./8 { });
dotnet_9 = recurseIntoAttrs (callPackage ./9 { });

sdk_8_0 = dotnet_8.sdk;
sdk_8_0_1xx = dotnet_8.sdk;
runtime_8_0 = dotnet_8.runtime;
aspnetcore_8_0 = dotnet_8.aspnetcore;

sdk_9_0 = dotnet_9.sdk;
sdk_9_0_1xx = dotnet_9.sdk;
runtime_9_0 = dotnet_9.runtime;
aspnetcore_9_0 = dotnet_9.aspnetcore;
}
// 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
);
}
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/clr-loader/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ buildPythonPackage {

format = "pyproject";

buildInputs = dotnetCorePackages.sdk_6_0.packages ++ dotnet-build.nugetDeps;
buildInputs = dotnetCorePackages.sdk_6_0-bin.packages ++ dotnet-build.nugetDeps;

nativeBuildInputs = [
setuptools
setuptools-scm
wheel
dotnetCorePackages.sdk_6_0
dotnetCorePackages.sdk_6_0-bin
];

propagatedBuildInputs = [ cffi ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/tools/ilspycmd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ buildDotnetModule rec {
# bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
env.LOCALE_ARCHIVE = lib.optionalString stdenv.hostPlatform.isLinux "${glibcLocales}/lib/locale/locale-archive";

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;

projectFile = "ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj";
nugetDeps = ./deps.nix;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/games/openra/build-engine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ buildDotnetModule rec {
};

# SDK 6.0 required for Robust.LoaderApi
dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_8_0 sdk_6_0 ];
dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_8_0 sdk_6_0-bin ];
dotnet-runtime = dotnetCorePackages.runtime_8_0;

dotnetFlags = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/servers/nosql/eventstore/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];

Expand Down
12 changes: 6 additions & 6 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,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;

Expand Down

0 comments on commit 31e7828

Please sign in to comment.