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-sdk_3: remove #222422

Merged
merged 1 commit into from
Mar 29, 2023
Merged
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
69 changes: 45 additions & 24 deletions doc/languages-frameworks/dotnet.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with import <nixpkgs> {};
mkShell {
name = "dotnet-env";
packages = [
dotnet-sdk_3
dotnet-sdk
];
}
```
Expand All @@ -27,36 +27,57 @@ mkShell {
name = "dotnet-env";
packages = [
(with dotnetCorePackages; combinePackages [
sdk_3_1
sdk_6_0
sdk_7_0
])
];
}
```

This will produce a dotnet installation that has the dotnet 3.1 6.0 sdk. The first sdk listed will have it's cli utility present in the resulting environment. Example info output:
This will produce a dotnet installation that has the dotnet 6.0 7.0 sdk. The first sdk listed will have it's cli utility present in the resulting environment. Example info output:

```ShellSession
$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961

...

.NET Core SDKs installed:
2.1.803 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/sdk]
3.0.102 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/sdk]
3.1.101 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.15 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.15 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.2 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.15 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.2 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.NETCore.App]
.NET SDK:
Version: 7.0.202
Commit: 6c74320bc3

Środowisko uruchomieniowe:
OS Name: nixos
OS Version: 23.05
OS Platform: Linux
RID: linux-x64
Base Path: /nix/store/n2pm44xq20hz7ybsasgmd7p3yh31gnh4-dotnet-sdk-7.0.202/sdk/7.0.202/

Host:
Version: 7.0.4
Architecture: x64
Commit: 0a396acafe

.NET SDKs installed:
6.0.407 [/nix/store/3b19303vwrhv0xxz1hg355c7f2hgxxgd-dotnet-core-combined/sdk]
7.0.202 [/nix/store/3b19303vwrhv0xxz1hg355c7f2hgxxgd-dotnet-core-combined/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.15 [/nix/store/3b19303vwrhv0xxz1hg355c7f2hgxxgd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.4 [/nix/store/3b19303vwrhv0xxz1hg355c7f2hgxxgd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.15 [/nix/store/3b19303vwrhv0xxz1hg355c7f2hgxxgd-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.4 [/nix/store/3b19303vwrhv0xxz1hg355c7f2hgxxgd-dotnet-core-combined/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download
```

## dotnet-sdk vs dotnetCorePackages.sdk {#dotnet-sdk-vs-dotnetcorepackages.sdk}
Expand Down Expand Up @@ -119,8 +140,8 @@ in buildDotnetModule rec {

projectReferences = [ referencedProject ]; # `referencedProject` must contain `nupkg` in the folder structure.

dotnet-sdk = dotnetCorePackages.sdk_3_1;
dotnet-runtime = dotnetCorePackages.net_6_0;
dotnet-sdk = dotnetCorePackages.sdk_6.0;
dotnet-runtime = dotnetCorePackages.runtime_6_0;

executables = [ "foo" ]; # This wraps "$out/lib/$pname/foo" to `$out/bin/foo`.
executables = []; # Don't install any executables.
Expand Down
2 changes: 1 addition & 1 deletion nixos/doc/manual/release-notes/rl-2305.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ In addition to numerous new and upgraded packages, this release has the followin
- Please note that an upgrade from v24 (or older) to v26 directly is not possible. Please upgrade to `nextcloud25` (or earlier) first. Nextcloud prohibits skipping major versions while upgrading. You can upgrade by declaring [`services.nextcloud.package = pkgs.nextcloud25;`](options.html#opt-services.nextcloud.package).
- It's recommended to use the latest version available (i.e. v26) and to specify that using `services.nextcloud.package`.

- .NET 5.0 was removed due to being end-of-life, use a newer, supported .NET version - https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
- .NET 5.0 and .NET 3.1 were removed due to being end-of-life, use a newer, supported .NET version - https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core

- The iputils package, which is installed by default, no longer provides the
`ninfod`, `rarpd` and `rdisc` tools. See
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/dotnet/build-dotnet.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ type
, version
, srcs
, icu # passing icu as an argument, because dotnet 3.1 has troubles with icu71
, packages ? null
}:

Expand All @@ -16,6 +15,7 @@ assert if type == "sdk" then packages != null else true;
, makeWrapper
, libunwind
, openssl_1_1
, icu
, libuuid
, zlib
, libkrb5
Expand Down
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 @@ -10,7 +10,7 @@ in
assert lib.assertMsg ((builtins.length dotnetPackages) > 0)
''You must include at least one package, e.g
`with dotnetCorePackages; combinePackages [
sdk_3_1 aspnetcore_5_0
sdk_6_0 aspnetcore_7_0
];`'' ;
buildEnv {
name = "dotnet-core-combined";
Expand Down
20 changes: 10 additions & 10 deletions pkgs/development/compilers/dotnet/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
How to combine packages for use in development:
dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_3_1 sdk_5_0 aspnetcore_5_0 ];
dotnetCombined = with dotnetCorePackages; combinePackages [ sdk_6_0 aspnetcore_7_0 ];

Hashes and urls below are retrieved from:
Hashes and urls are retrieved from:
https://dotnet.microsoft.com/download/dotnet
*/
{ callPackage, icu70, icu }:
{ callPackage,}:
let
buildDotnet = attrs: callPackage (import ./build-dotnet.nix attrs) {};
buildAttrs = {
Expand All @@ -14,6 +14,11 @@ let
buildNetSdk = attrs: buildDotnet (attrs // { type = "sdk"; });
};

## Files in versions/ are generated automatically by update.sh ##
dotnet_6_0 = import ./versions/6.0.nix buildAttrs;
dotnet_7_0 = import ./versions/7.0.nix buildAttrs;
dotnet_8_0 = import ./versions/8.0.nix buildAttrs;

runtimeIdentifierMap = {
"x86_64-linux" = "linux-x64";
"aarch64-linux" = "linux-arm64";
Expand All @@ -25,12 +30,6 @@ let

# Convert a "stdenv.hostPlatform.system" to a dotnet RID
systemToDotnetRid = system: runtimeIdentifierMap.${system} or (throw "unsupported platform ${system}");

## Files in versions/ are generated automatically by update.sh ##
dotnet_3_1 = import ./versions/3.1.nix (buildAttrs // { icu = icu70; });
dotnet_6_0 = import ./versions/6.0.nix (buildAttrs // { inherit icu; });
dotnet_7_0 = import ./versions/7.0.nix (buildAttrs // { inherit icu; });
dotnet_8_0 = import ./versions/8.0.nix (buildAttrs // { inherit icu; });
in
rec {
inherit systemToDotnetRid;
Expand All @@ -41,5 +40,6 @@ rec {
sdk_2_1 = throw "Dotnet SDK 2.1 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
sdk_2_2 = throw "Dotnet SDK 2.2 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
sdk_3_0 = throw "Dotnet SDK 3.0 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
sdk_3_1 = throw "Dotnet SDK 3.1 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
sdk_5_0 = throw "Dotnet SDK 5.0 is EOL, please use 6.0 (LTS) or 7.0 (Current)";
} // dotnet_3_1 // dotnet_6_0 // dotnet_7_0 // dotnet_8_0
} // dotnet_6_0 // dotnet_7_0 // dotnet_8_0
61 changes: 26 additions & 35 deletions pkgs/development/compilers/dotnet/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,36 +219,30 @@ sdk_packages () {
"runtime.win-x86.Microsoft.NETCore.DotNetHost" \
"runtime.win-x86.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.win-x86.Microsoft.NETCore.DotNetHostResolver" \
"Microsoft.NETCore.App.Composite" \
"Microsoft.NETCore.App.Host.linux-musl-arm" \
"Microsoft.NETCore.App.Host.osx-arm64" \
"Microsoft.NETCore.App.Runtime.linux-musl-arm" \
"Microsoft.NETCore.App.Runtime.osx-arm64" \
"Microsoft.NETCore.App.Ref" \
"Microsoft.NETCore.App.Runtime.Mono.linux-arm" \
"Microsoft.NETCore.App.Runtime.Mono.linux-arm64" \
"Microsoft.NETCore.App.Runtime.Mono.linux-musl-x64" \
"Microsoft.NETCore.App.Runtime.Mono.linux-x64" \
"Microsoft.NETCore.App.Runtime.Mono.osx-arm64" \
"Microsoft.NETCore.App.Runtime.Mono.osx-x64" \
"Microsoft.NETCore.App.Runtime.Mono.win-x64" \
"Microsoft.NETCore.App.Runtime.Mono.win-x86" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHost" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostResolver" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetAppHost" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHost" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver" \
)

# Packages that only apply to .NET 6 and up
if ! version_older "$version" "6"; then
pkgs+=( \
"Microsoft.NETCore.App.Composite" \
"Microsoft.NETCore.App.Host.linux-musl-arm" \
"Microsoft.NETCore.App.Host.osx-arm64" \
"Microsoft.NETCore.App.Runtime.linux-musl-arm" \
"Microsoft.NETCore.App.Runtime.osx-arm64" \
"Microsoft.NETCore.App.Ref" \
"Microsoft.NETCore.App.Runtime.Mono.linux-arm" \
"Microsoft.NETCore.App.Runtime.Mono.linux-arm64" \
"Microsoft.NETCore.App.Runtime.Mono.linux-musl-x64" \
"Microsoft.NETCore.App.Runtime.Mono.linux-x64" \
"Microsoft.NETCore.App.Runtime.Mono.osx-arm64" \
"Microsoft.NETCore.App.Runtime.Mono.osx-x64" \
"Microsoft.NETCore.App.Runtime.Mono.win-x64" \
"Microsoft.NETCore.App.Runtime.Mono.win-x86" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetAppHost" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHost" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.linux-musl-arm.Microsoft.NETCore.DotNetHostResolver" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetAppHost" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHost" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostPolicy" \
"runtime.osx-arm64.Microsoft.NETCore.DotNetHostResolver" \
)
fi

# Packages that only apply to .NET 7 and up
if ! version_older "$version" "7"; then
# ILCompiler requires nixpkgs#181373 to be fixed to work properly
Expand All @@ -273,8 +267,8 @@ main () {
Get updated dotnet src (platform - url & sha512) expressions for specified versions

Examples:
$pname 3.1.21 5.0.12 - specific x.y.z versions
$pname 3.1 5.0 6.0 - latest x.y versions
$pname 6.0.14 7.0.201 - specific x.y.z versions
$pname 6.0 7.0 - latest x.y versions
" >&2
exit 1
fi
Expand Down Expand Up @@ -311,7 +305,7 @@ Examples:
buildAspNetCore = { ... }: {}; \
buildNetRuntime = { ... }: {}; \
buildNetSdk = { version, ... }: version; \
icu = null; }).sdk_${major_minor_underscore}" | jq -r)
}).sdk_${major_minor_underscore}" | jq -r)

if [[ "$current_version" == "$sdk_version" ]]; then
echo "Nothing to update."
Expand All @@ -325,24 +319,21 @@ Examples:

channel_version=$(jq -r '."channel-version"' <<< "$content")
support_phase=$(jq -r '."support-phase"' <<< "$content")
echo "{ buildAspNetCore, buildNetRuntime, buildNetSdk, icu }:
echo "{ buildAspNetCore, buildNetRuntime, buildNetSdk }:

# v$channel_version ($support_phase)
{
aspnetcore_$major_minor_underscore = buildAspNetCore {
inherit icu;
version = \"${aspnetcore_version}\";
$(platform_sources "$aspnetcore_files")
};

runtime_$major_minor_underscore = buildNetRuntime {
inherit icu;
version = \"${runtime_version}\";
$(platform_sources "$runtime_files")
};

sdk_$major_minor_underscore = buildNetSdk {
inherit icu;
version = \"${sdk_version}\";
$(platform_sources "$sdk_files")
packages = { fetchNuGet }: [
Expand Down
Loading