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: infrastructure updates #361563

Closed
wants to merge 10 commits into from
2 changes: 2 additions & 0 deletions pkgs/build-support/dotnet/build-dotnet-module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ let
finalAttrs:
{
enableParallelBuilding ? true,
strictDeps ? true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my lack of knowledge, I tried looking at the source for mkDerivation but I couldn't understand what this flag does, and #353937 hasn't been done to document what it does.

Also, won't this break out-of-tree packages using buildDotnetModule? We should probably document this breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This came from:

#358824

You're right that it needs documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, makes sense. Saw another PR that adds a little description to it so now I have an idea how it works.

# Flags to pass to `makeWrapper`. This is done to avoid double wrapping.
makeWrapperArgs ? [ ],

Expand Down Expand Up @@ -127,6 +128,7 @@ let

inherit
enableParallelBuilding
strictDeps
dotnetRestoreFlags
dotnetBuildFlags
dotnetTestFlags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
{
name = "dotnet-fixup-hook";
substitutions = {
# this is used for DOTNET_ROOT, so we need unwrapped
dotnetRuntime = if (dotnet-runtime != null) then dotnet-runtime.unwrapped else null;
dotnetRuntime = if (dotnet-runtime != null) then dotnet-runtime else null;
wrapperPath = lib.makeBinPath [ which coreutils ];
};
}
Expand Down
2 changes: 2 additions & 0 deletions pkgs/build-support/dotnet/fetch-nupkg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ lib.makeOverridable (
;
};

strictDeps = true;

nativeBuildInputs = [
unzip
patchNupkgs
Expand Down
2 changes: 2 additions & 0 deletions pkgs/build-support/dotnet/make-nuget-source/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
stdenvNoCC.mkDerivation (lib.recursiveUpdate {
inherit name;

strictDeps = true;

nativeBuildInputs = [ python3 ];

buildCommand = ''
Expand Down
5 changes: 1 addition & 4 deletions pkgs/by-name/be/beatsabermodmanager/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ buildDotnetModule rec {
fetchSubmodules = true; # It vendors BSIPA-Linux
};

dotnet-sdk = with dotnetCorePackages; combinePackages [
sdk_7_0
sdk_6_0
];
dotnet-sdk = dotnetCorePackages.sdk_7_0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, and #339370 will cause a merge conflict


dotnet-runtime = dotnetCorePackages.runtime_7_0;

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 @@ -42,7 +42,7 @@ buildDotnetModule rec {
'';

dotnet-sdk = dotnetCorePackages.sdk_6_0;
buildInputs = [ jdk11 ];
nativeBuildInputs = [ jdk11 ];
nugetDeps = ./deps.nix;

# Build just these projects. Building Source/Dafny.sln includes a bunch of
Expand Down
14 changes: 9 additions & 5 deletions pkgs/by-name/do/dotnet-outdated/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{ lib
, fetchFromGitHub
, buildDotnetModule
, dotnetCorePackages
{
lib,
fetchFromGitHub,
buildDotnetModule,
dotnetCorePackages,
}:
buildDotnetModule rec {
pname = "dotnet-outdated";
Expand All @@ -24,7 +25,10 @@ buildDotnetModule rec {
executables = "dotnet-outdated";

dotnetFlags = [ "-p:TargetFrameworks=net8.0" ];
dotnetInstallFlags = [ "--framework" "net8.0" ];
dotnetInstallFlags = [
"--framework"
"net8.0"
];

meta = with lib; {
description = ".NET Core global tool to display and update outdated NuGet packages in a project";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/dy/dyalog/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
let
dyalogHome = "$out/lib/dyalog";

makeWrapperArgs = lib.optional dotnetSupport "--set DOTNET_ROOT ${dotnet-sdk_8.unwrapped}/share/dotnet";
makeWrapperArgs = lib.optional dotnetSupport "--set DOTNET_ROOT ${dotnet-sdk_8}/share/dotnet";

licenseUrl = "https://www.dyalog.com/uploads/documents/Developer_Software_Licence.pdf";

Expand Down
9 changes: 4 additions & 5 deletions pkgs/by-name/fs/fsautocomplete/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ buildDotnetModule (finalAttrs: rec {

dotnet-sdk =
with dotnetCorePackages;
combinePackages [
sdk_6_0
sdk_7_0
sdk_8_0
];
sdk_8_0
// {
inherit (sdk_6_0) packages targetPackages;
};
Comment on lines 37 to +42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is more confusing than the earlier combinePackages. I have no idea what it does nor why it is needed.

Should probably create a helper function that does this and documents its behavior and when to use if we do decide to move forward with this pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that we don't actually need more than one SDK, but we do need the targeting packages. This breaks the dependencies on the insecure packages.

It does feel messy. I started working on a bigger overhaul of how nuget packages are referenced, but it's not close to being ready.

Copy link
Contributor

@GGG-KILLER GGG-KILLER Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that the packages themselves being used are also insecure, this feels like just swiping it under the rug as opposed to actually fixing the problem.

This one is gonna be a hard no from me, considering that many .NET CVEs were on SDK/runtime packages and not on the compiler/runtime itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For net 6, it definitely is just sweeping it under the rug, but I still think it's better for things to only depend on the SDKs they use, instead of using combinePackages solely to pull in nuget packages.

I'd be happy to mark all net6/7 nuget packages as insecure, but that's a separate problem IMO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another question, shouldn't we keep the 8.0 packages here (and elsewhere where this is used)?

And couldn't the instances where this uses combinePackages be replaced with the lib methods conmbinePackages uses instead of creating a full derivation?
It feels wasteful to create a whole combined SDK when we only need the packages and targeting packages from it.

And if possible, I'd like to have the packages be marked as insecure before we start actually using them so this doesn't end up unmarking packages as insecure and people mistakenly think these are safe to use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just having a go at this, by applying knownVulnerabilities to the packages as well:

$ nix eval -f. fsautocomplete
«error: Package ‘Microsoft.AspNetCore.App.Ref-6.0.36’ in /home/david/src/nixpkgs/pkgs/build-support/dotnet/fetch-nupkg/default.nix:23 is marked as insecure, refusing to evaluate.


Known issues:
 - Dotnet SDK 6.0.428 is EOL, please use 8.0 (LTS) or 9.0 (Current)

You can install it anyway by allowing this package, using the
following methods:

a) To temporarily allow all insecure packages, you can use an environment
   variable for a single invocation of the nix tools:

     $ export NIXPKGS_ALLOW_INSECURE=1

   Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
         then pass `--impure` in order to allow use of environment variables.

b) for `nixos-rebuild` you can add ‘Microsoft.AspNetCore.App.Ref-6.0.36’ to
   `nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
   like so:

     {
       nixpkgs.config.permittedInsecurePackages = [
         "Microsoft.AspNetCore.App.Ref-6.0.36"
       ];
     }

c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
   ‘Microsoft.AspNetCore.App.Ref-6.0.36’ to `permittedInsecurePackages` in
   ~/.config/nixpkgs/config.nix, like so:

     {
       permittedInsecurePackages = [
         "Microsoft.AspNetCore.App.Ref-6.0.36"
       ];
     }

It's going to be really painful for anyone who wants to use permittedInsecurePackages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, there's no way around it unfortunately. I think making it easy for people to use insecure packages isn't an objective of nixpkgs, but worst case they can do something like

nixpkgs.config.permittedInsecurePackages = lib.map (pkg: pkg.name) pkgs.dotnetCorePackages.sdk_6_0.packages;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could make a pseudo-package referenced by the sdk, runtime, nuget packages, and mark that as insecure?

I don't know if it's worth the trouble though.

nixpkgs.config.permittedInsecurePackages = lib.map (pkg: pkg.name) pkgs.dotnetCorePackages.sdk_6_0.packages;

You'd also need to bring in targetPackages which is an attrset of lists. It's still doable, but cumbersome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could make a pseudo-package referenced by the sdk, runtime, nuget packages, and mark that as insecure?

Sounds like too much work for something we plan to remove in the long term, but it would make the deprecation process easier perhaps. If it's easy enough we could do it to make it easier on us to deprecate them as well.

You'd also need to bring in targetPackages which is an attrset of lists. It's still doable, but cumbersome.

Yeah, but I'd say allowing usage of insecure things is a non-objective. If people really want to use them, it should be doable but I wouldn't go out of my way to make it easy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like too much work for something we plan to remove in the long term, but it would make the deprecation process easier perhaps. If it's easy enough we could do it to make it easier on us to deprecate them as well.

I actually don't think it would work anyway. I know you need to add the wrapper packages to permittedInsecurePackages, so I assume you'd still have to add everything that's transiently insecure.

dotnet-runtime = dotnetCorePackages.sdk_8_0;

projectFile = "src/FsAutoComplete/FsAutoComplete.fsproj";
Expand Down
7 changes: 1 addition & 6 deletions pkgs/by-name/ga/garnet/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ buildDotnetModule rec {
projectFile = "main/GarnetServer/GarnetServer.csproj";
nugetDeps = ./deps.nix;

dotnet-sdk =
with dotnetCorePackages;
combinePackages [
sdk_6_0
sdk_8_0
];
dotnet-sdk = dotnetCorePackages.sdk_8_0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing with this package too.

Also the same change is being done in #361658

dotnet-runtime = dotnetCorePackages.runtime_8_0;

dotnetBuildFlags = [
Expand Down
9 changes: 8 additions & 1 deletion pkgs/by-name/gi/github-runner/package.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
bash,
buildDotnetModule,
coreutils,
darwin,
dotnetCorePackages,
fetchFromGitHub,
Expand Down Expand Up @@ -111,12 +113,17 @@ buildDotnetModule rec {
[
which
git
# needed for `uname`
coreutils
]
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
darwin.autoSignDarwinBinariesHook
];

buildInputs = [ (lib.getLib stdenv.cc.cc) ];
buildInputs = [
(lib.getLib stdenv.cc.cc)
bash
];

dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-runtime = dotnetCorePackages.runtime_8_0;
Expand Down
14 changes: 13 additions & 1 deletion pkgs/by-name/na/naps2/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,19 @@ buildDotnetModule rec {

executables = [ "naps2" ];

dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_6_0 sdk_8_0 ];
dotnet-sdk =
with dotnetCorePackages;
sdk_8_0
// {
inherit
(combinePackages [
sdk_8_0
sdk_6_0
])
packages
targetPackages
;
};
dotnet-runtime = dotnetCorePackages.runtime_8_0;
selfContainedBuild = true;
runtimeDeps = [
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ne/netcoredbg/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let

cmakeFlags = [
"-DCORECLR_DIR=${coreclr-src}/src/coreclr"
"-DDOTNET_DIR=${dotnet-sdk.unwrapped}/share/dotnet"
"-DDOTNET_DIR=${dotnet-sdk}/share/dotnet"
"-DBUILD_MANAGED=0"
];
};
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/pr/pre-commit/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ buildPythonApplication rec {
VIRTUALENV_NO_DOWNLOAD=1 PRE_COMMIT_NO_CONCURRENCY=1 LANG=en_US.UTF-8

# Resolve `.NET location: Not found` errors for dotnet tests
export DOTNET_ROOT="${dotnet-sdk.unwrapped}/share/dotnet"
export DOTNET_ROOT="${dotnet-sdk}/share/dotnet"

export HOME=$(mktemp -d)

Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/ta/tagger/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ buildDotnetModule rec {

nativeBuildInputs = [
blueprint-compiler
libadwaita
];

buildInputs = [
chromaprint
libadwaita
];

runtimeDeps = [
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/compilers/dotnet/8/bootstrap-sdk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let
(fetchNupkg { pname = "Microsoft.NETCore.DotNetHostResolver"; version = "8.0.10"; hash = "sha512-dQn8Z1iypqdntr/hfuuEt2qCdJZywJtociOEnl+jRp2wyEJcQNGBtNQfDT2LWqNj/tJjSY+a+ncuXT3UnnQvjQ=="; })
(fetchNupkg { pname = "Microsoft.DotNet.ILCompiler"; version = "8.0.10"; hash = "sha512-cA9+iEQ0AikuCnRJ0ASaZbPPpVAINzbEbwR5I4fx2wrch2cdARdSwP3CQK1OAeR8IfA2EEm1jKpgT5fLJ7emHQ=="; })
(fetchNupkg { pname = "Microsoft.NET.ILLink.Tasks"; version = "8.0.10"; hash = "sha512-N3VO3kok4zHBI6gQC0+x6e/36ebf6xa6dIEzxMnuF/GGEgjseDNBSRI6/Ta/ACRR2LzwDE1CcLp5leBzxMkyAw=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Ref"; version = "8.0.10"; hash = "sha512-VJUmnC22ZvY5HsjeYZ7XEaBlfHVfkP9n+zFTDg9UftVlHOwJm8PdecavJFpNBM692i0vicgHjn8xuQYShuwZ4g=="; })
];

hostPackages = {
Expand Down Expand Up @@ -145,6 +146,7 @@ let
(fetchNupkg { pname = "runtime.win-arm64.Microsoft.NETCore.DotNetHost"; version = "8.0.10"; hash = "sha512-D3hpY5NnpvIg4fNVKcJYYUwxfaFY8AHTvYzwT0D0tb0qcXKIMsJEm7lRM2vsENuhHn02tWTvsyRuo5h9XmmG/g=="; })
(fetchNupkg { pname = "runtime.win-arm64.Microsoft.NETCore.DotNetHostPolicy"; version = "8.0.10"; hash = "sha512-pMagTteRJ2XwPeJnonPRvA5A4v3f4F+X1iu08RxPwTXVDsS4xemkm1LfZgiyPADIrAsY6DBFLXvK5fZ0uaBigA=="; })
(fetchNupkg { pname = "runtime.win-arm64.Microsoft.NETCore.DotNetHostResolver"; version = "8.0.10"; hash = "sha512-fprLJDM1dWKqI3n2DjCVSY8l7zBngdjnLid8HZxdHn1Hr9m57k4wcbFc/otHfnTHcYF0MXPrC6VO4CgRYFtIkA=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Runtime.win-arm64"; version = "8.0.10"; hash = "sha512-MFsFM8Xsx/e7MQdJv/2S8mLEigaqyurnE5lNdzKFft0htVKnPx6DpTbi0k8P6RmWcpoO3KKivj310st7M4IxBQ=="; })
];
win-x64 = [
(fetchNupkg { pname = "Microsoft.AspNetCore.App.Runtime.win-x64"; version = "8.0.10"; hash = "sha512-aBIdHUFn4vBEIN/v9+8ix+C/7Ljrb9zgFp6naPO37XlvGTuOgYm4tc2hfs1wbjc3VxaC2Gzc2smzUwahicAM6A=="; })
Expand All @@ -155,6 +157,7 @@ let
(fetchNupkg { pname = "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy"; version = "8.0.10"; hash = "sha512-VY6rMwR9QzRKhuUVBCFSVwPBPIqH20C+F4W2R6KP0GajGfu6h1/AdtnJS0op+76fIg0qia8JFuW6DUhc3UmSLQ=="; })
(fetchNupkg { pname = "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver"; version = "8.0.10"; hash = "sha512-yWJ8LOGQ1/pKyT/qHjGkU+RuWmCy9OsUe/ANtHA5kTHmY4g4RNwP8+eDW1K3+g5BESfaENlJiNiTnWwTn2CFQQ=="; })
(fetchNupkg { pname = "Microsoft.NETCore.App.Runtime.Mono.win-x64"; version = "8.0.10"; hash = "sha512-qrxC9S51t2w84jLBttmTmLmS1KjHscP31REqw8I117VnX/R7861Aabj7gg0cVz6YiGaeBqgzuUt/yBiHu18xeQ=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Runtime.win-x64"; version = "8.0.10"; hash = "sha512-wxE7rlCvX781atu3tdx5zXib8/Yr1uyjg9aUFrXtIBhMRRfEEUQ0NaW3Njonhi5Tf3JF8lXiUEX1COvRxsCFSQ=="; })
];
win-x86 = [
(fetchNupkg { pname = "Microsoft.AspNetCore.App.Runtime.win-x86"; version = "8.0.10"; hash = "sha512-NGl4nsuWJgLBQobSkbOxJgkT04uyetP/Kv8JXz7qN6MV0q+MjyhYQY29H8ODQgSMi4viOBL9KHbrTc6K+oSD7w=="; })
Expand All @@ -165,6 +168,7 @@ let
(fetchNupkg { pname = "runtime.win-x86.Microsoft.NETCore.DotNetHostPolicy"; version = "8.0.10"; hash = "sha512-Mp2Scz97QbDE1CKZli/Z4zDSeQGSjN4vuylZUqvLukTTGTM1xB89a0TLf5ooz6rZefyNecAY2WOP0fr+oOjpPg=="; })
(fetchNupkg { pname = "runtime.win-x86.Microsoft.NETCore.DotNetHostResolver"; version = "8.0.10"; hash = "sha512-Voo3Y/uZNEaiWfePrWjKkpsgZBR1dmgwuCf/8sxMCSQ2MvVG5jYlb0z+LqQdWQnF35fPHDFOCKeXIek20hPFtA=="; })
(fetchNupkg { pname = "Microsoft.NETCore.App.Runtime.Mono.win-x86"; version = "8.0.10"; hash = "sha512-00BocEhDPtq4wrrkK4TN4uC0JLQvLn+JZpEAanMEQzN/ZOb8pP8c4RX/jNpPP40MqNNnsNOSFh9C2LE/HPgjHA=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Runtime.win-x86"; version = "8.0.10"; hash = "sha512-5322ID0jxoDa/ehLGbr6RkE7GNs0lLGQ9M/YvmHyPxWZfWq+b9OXMVkGqpAjF+3hp3a77yoFGBYGEtBKLI7jHA=="; })
];
};

Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/compilers/dotnet/9/bootstrap-sdk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let
(fetchNupkg { pname = "Microsoft.NETCore.App.Ref"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-tJYYbEootDwmS23jQtXRN/HrkN57sLdcpjYuKjqzgOsWVhVYr+5Yq5vcuYa03RiRv/PnoOmWB6pMhQ69qfIhcA=="; })
(fetchNupkg { pname = "Microsoft.DotNet.ILCompiler"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-7gm4DUCtrapDZxO1aKiPGm/danAxKvGiCyj16+4zdgD69S0UJ0mwQw5Mn7xIhrz3/YSC/yK7ihvZ4oqc4I00aQ=="; })
(fetchNupkg { pname = "Microsoft.NET.ILLink.Tasks"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-h08RQolDzXy4ihvbyEb0E75pozEG/tyZgPaKEfWGtEM1Byvbe4SDrQlu0G4f97h5I49L6Czy+RQ+rdnyL/XwjQ=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Ref"; version = "9.0.0-rc.2.24474.4"; hash = "sha512-WeoUwf3g/wdlyd6DB98+0y4ztWFlg3IP+yXGhV2Hy6XJJTYVELdCrDefL1L5INfozshNFI63rEUrEbItcyR2gA=="; })
];

hostPackages = {
Expand Down Expand Up @@ -109,18 +110,21 @@ let
(fetchNupkg { pname = "Microsoft.NETCore.App.Host.win-arm64"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-tKSRJQ4E/PndHyAEKnDitBvgTnJCtzIBiw4MAim7mmdO3T3xCq3N1PP/WRST+JEMDy19tkLwClR3SqziiXPAag=="; })
(fetchNupkg { pname = "Microsoft.NETCore.App.Runtime.win-arm64"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-gNMyW8t/1pBYNWwZpW7Gk4GArSEVrJOCBz8YvaHpzwk9iuVYeka4lOIvudA9drCxY5EUU1I20EJvCSycNffgsg=="; })
(fetchNupkg { pname = "runtime.win-arm64.Microsoft.NETCore.DotNetAppHost"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-FiXMi1dtVF47L4ITblPzzCbgLY9noHwV0ZvEL30bgm4hQPSSNdELFbDAgNuAktieV3/XV7KSOQPPxlc6KEZi2w=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Runtime.win-arm64"; version = "9.0.0-rc.2.24474.4"; hash = "sha512-8679z3waMYSYVmBMB3HHwRAbow8ssM1Aau2XBmF7A1oUVvhU8Nodl51TzZmgLIT/UOSSqNYRqvPznGnPiVk6JA=="; })
];
win-x64 = [
(fetchNupkg { pname = "Microsoft.AspNetCore.App.Runtime.win-x64"; version = "9.0.0-rc.2.24474.3"; hash = "sha512-8FXl5YY++/bGTAOoAS7lK53CXyc7vzLAzfmXQ3q2s4vLvrKI3720ECDnDQS9Of9P8ZLDdMwX6SeHd4RbsLMaBg=="; })
(fetchNupkg { pname = "Microsoft.NETCore.App.Host.win-x64"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-P4A/HDIrDVLJBtBD9Eoy2DxofmLXji5zzOBA9ZEWioXurCU5ujFw2VhUiKY6qDedFsq6/1IyVGDNcesd42jgmQ=="; })
(fetchNupkg { pname = "Microsoft.NETCore.App.Runtime.win-x64"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-lCAvZbxLspyp1LgfAE8uCvd9muUNGK1XRAo62v7cxhMDrCopNPF4F36nRQq+LBbyijlCbXzHmB7FJ5SfcQYhfA=="; })
(fetchNupkg { pname = "runtime.win-x64.Microsoft.NETCore.DotNetAppHost"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-UUoAim2OxX0npr5wF3z9mLunFVVNyfadk5EyE8dkTAhiSULv4mzQhAMRLirPlnOOcvytVgrixBWmE+unUrjJrA=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Runtime.win-x64"; version = "9.0.0-rc.2.24474.4"; hash = "sha512-kz+ygB7ZcfFXL+Je1eGw2+PQkUI+1OID32VKZ1IQ548hR1m4Dx/RVVVuYlty/bUsrUeep4lqafQwA4ZZeBf7gA=="; })
];
win-x86 = [
(fetchNupkg { pname = "Microsoft.AspNetCore.App.Runtime.win-x86"; version = "9.0.0-rc.2.24474.3"; hash = "sha512-xuLmBBnsSd915EIhwY4x8UP6LKvVrbTP5Stx6zn12ZE9wf0mzrp92o4zs9xdS+XFjV4sXgPdJ00ayj8vRtqaew=="; })
(fetchNupkg { pname = "Microsoft.NETCore.App.Host.win-x86"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-e0Rk0Kg5yGi/gv6pBGuGca860xeOTOMjx+A+5xvB6NLaPS7bdAuGgFRhiI0Bs1s8KcuEhnWK4EP8Z9127BR54A=="; })
(fetchNupkg { pname = "Microsoft.NETCore.App.Runtime.win-x86"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-BU8bppDcPbtBi0WtF8WpGPDf10l+LwB/i/sBYmvmKtGymDkUTZ1Cx535oPA7c0vRfTYFbPZPNEZwlmtQj+gaRQ=="; })
(fetchNupkg { pname = "runtime.win-x86.Microsoft.NETCore.DotNetAppHost"; version = "9.0.0-rc.2.24473.5"; hash = "sha512-zIGe6kxRaO8J+OU5LLvxUO1BMu3+GuTcS87aUggVNulwyHFjm60YS69VSpQ0JyWy5/m2cNTcTgcwRNAmU6He/g=="; })
(fetchNupkg { pname = "Microsoft.WindowsDesktop.App.Runtime.win-x86"; version = "9.0.0-rc.2.24474.4"; hash = "sha512-/CnYW1lQJ4npbgzEOOXXZcoO1bZxTmmi7uTNIZHOUFTlzaKXFtF42swUSnDThheshzHMQq87O6fmJCwCjpyzbg=="; })
];
};

Expand Down
5 changes: 3 additions & 2 deletions pkgs/development/compilers/dotnet/build-dotnet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ mkWrapper type (
stdenv.mkDerivation rec {
inherit pname version;

strictDeps = true;

# Some of these dependencies are `dlopen()`ed.
nativeBuildInputs =
[
makeWrapper
]
++ lib.optional (type == "sdk") xmlstarlet
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook
++ lib.optionals (type == "sdk" && stdenv.hostPlatform.isDarwin) [
xmlstarlet
sigtool
];

Expand All @@ -118,7 +120,6 @@ mkWrapper type (
icu
libkrb5
curl
xmlstarlet
] ++ lib.optional stdenv.hostPlatform.isLinux lttng-ust_2_12;

src = fetchurl (
Expand Down
19 changes: 9 additions & 10 deletions pkgs/development/compilers/dotnet/combine-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dotnetPackages:
makeWrapper,
lib,
symlinkJoin,
callPackage,
}:
# TODO: Rethink how we determine and/or get the CLI.
# Possible options raised in #187118:
Expand All @@ -12,15 +13,16 @@ dotnetPackages:
# 3. Something else?
let
cli = builtins.head dotnetPackages;
mkWrapper = callPackage ./wrapper.nix { };
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
];`'';
(buildEnv {
name = "dotnet-core-combined";
paths = map (x: x.unwrapped) dotnetPackages;
mkWrapper "sdk" (buildEnv {
name = "dotnet-combined";
paths = dotnetPackages;
pathsToLink = map (x: "/share/dotnet/${x}") [
"host"
"packs"
Expand All @@ -34,7 +36,7 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
postBuild =
''
mkdir -p "$out"/share/dotnet
cp "${cli.unwrapped}"/share/dotnet/dotnet $out/share/dotnet
cp "${cli}"/share/dotnet/dotnet $out/share/dotnet
cp -R "${cli}"/nix-support "$out"/
mkdir "$out"/bin
ln -s "$out"/share/dotnet/dotnet "$out"/bin/dotnet
Expand All @@ -43,6 +45,8 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
ln -s ${cli.man} $man
'';
passthru = {
pname = "dotnet";
version = "combined";
inherit (cli) icu;

versions = lib.catAttrs "version" dotnetPackages;
Expand All @@ -53,9 +57,4 @@ assert lib.assertMsg ((builtins.length dotnetPackages) > 0) ''
};

inherit (cli) meta;
}).overrideAttrs
({
outputs = [
"out"
] ++ lib.optional (cli ? man) "man";
})
})
2 changes: 2 additions & 0 deletions pkgs/development/compilers/dotnet/dotnet.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ let
hash = artifactsHash;
};

strictDeps = true;

sourceRoot = ".";

installPhase = ''
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/compilers/dotnet/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let
stdenvNoCC.mkDerivation (
args
// {
strictDeps = true;
outputs = args.outputs or [ "out" ] ++ [ "man" ];
postFixup =
args.postFixup or ""
Expand All @@ -41,6 +42,8 @@ let
src = vmr;
dontUnpack = true;

strictDeps = true;

nativeBuildInputs = [
xmlstarlet
nugetPackageHook
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/dotnet/update.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ let
pkg = stdenvNoCC.mkDerivation {
name = "update-dotnet-vmr-env";

strictDeps = true;

nativeBuildInputs = [
nix
curl
Expand Down
Loading
Loading