Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet: default to source-built sdk/runtimes #363008

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.json;
Expand Down
3 changes: 3 additions & 0 deletions pkgs/by-name/al/alcom/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
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.json;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/am/am2rlauncher/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ buildDotnetModule {
hash = "sha256-/nHqo8jh3sOUngbpqdfiQjUWO/8Uzpc5jtW7Ep4q6Wg=";
};

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
projectFile = "AM2RLauncher/AM2RLauncher.Gtk/AM2RLauncher.Gtk.csproj";

nugetDeps = ./deps.json;
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
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.json;

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/bo/boogie/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/da/dafny/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ buildDotnetModule rec {
--replace-warn "netstandard2.0;net452" net6.0
'';

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
nativeBuildInputs = [ jdk11 ];
nugetDeps = ./deps.json;

Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/fo/formula/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ buildDotnetModule rec {
sha256 = "sha256-2ulv//YV3OqrfFltgUCeDe4rOPC0qqJ+80/D2lIoih8=";
};

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
nugetDeps = ./nuget.json;
projectFile = "Src/CommandLine/CommandLine.csproj";

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
2 changes: 1 addition & 1 deletion pkgs/by-name/gh/gh-gei/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildDotnetModule rec {
hash = "sha256-6lEEeAYrMB9wwATsORuaS21wLOB+gq/od88FobSse50=";
};

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
projectFile = "src/gei/gei.csproj";
nugetDeps = ./deps.json; # File generated with `nix-build -A gh-gei.passthru.fetch-deps`.

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.json;
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/kn/knossosnet/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buildDotnetModule rec {

patches = [ ./targetframework.patch ];

dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
nugetDeps = ./deps.json;
executables = [ "Knossos.NET" ];

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 @@ -33,7 +33,7 @@ buildDotnetModule rec {
inherit
(combinePackages [
sdk_8_0
sdk_6_0
sdk_6_0-bin
])
packages
targetPackages
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ne/networkminer/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ buildDotnetModule rec {
sha256 = "1n2312acq5rq0jizlcfk0crslx3wgcsd836p47nk3pnapzw0cqvv";
};

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

nativeBuildInputs = [
unzip
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.json;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ro/roslyn-ls/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let
sdk_8_0
# NOTE: we should be able to remove net6.0 after upstream removes from here:
# https://github.com/dotnet/roslyn/blob/6cc106c0eaa9b0ae070dba3138a23aeab9b50c13/eng/targets/TargetFrameworks.props#L20
sdk_6_0
sdk_6_0-bin
])
packages
targetPackages
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.json;
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
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.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];

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
);
}
5 changes: 5 additions & 0 deletions pkgs/development/compilers/dotnet/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ let
+ ''
ln -s ${vmr.man} $man
'';
propagatedSandboxProfile = lib.optionalString stdenvNoCC.hostPlatform.isDarwin ''
(allow file-read* (subpath "/private/var/db/mds/system"))
(allow mach-lookup (global-name "com.apple.SecurityServer")
(global-name "com.apple.system.opendirectoryd.membership"))
'';
}
)
);
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/python-modules/clr-loader/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ let
"example/example.csproj"
];
nugetDeps = ./deps.json;
dotnet-sdk = dotnetCorePackages.sdk_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6_0-bin;
};
in
buildPythonPackage {
inherit pname version src;

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.json;
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
Loading
Loading