From 507eff880d1f07988dbff228306a2eadceac4c10 Mon Sep 17 00:00:00 2001 From: David McFarland Date: Fri, 30 Sep 2022 16:02:32 -0300 Subject: [PATCH] build-dotnet: make passthru.packages a derivation --- .../dotnet/build-dotnet-module/default.nix | 5 +---- pkgs/development/compilers/dotnet/build-dotnet.nix | 10 +++++++++- .../continuous-integration/github-runner/default.nix | 10 ++-------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 932ebceceac1..4ca6ca0f2470 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix @@ -112,10 +112,7 @@ let # this contains all the nuget packages that are implicitly referenced by the dotnet # build system. having them as separate deps allows us to avoid having to regenerate # a packages dependencies when the dotnet-sdk version changes - sdkDeps = mkNugetDeps { - name = "dotnet-sdk-${dotnet-sdk.version}-deps"; - nugetDeps = dotnet-sdk.passthru.packages; - }; + sdkDeps = dotnet-sdk.packages; sdkSource = mkNugetSource { name = "dotnet-sdk-${dotnet-sdk.version}-source"; diff --git a/pkgs/development/compilers/dotnet/build-dotnet.nix b/pkgs/development/compilers/dotnet/build-dotnet.nix index 308bd64dc7fd..c51eca24b58c 100644 --- a/pkgs/development/compilers/dotnet/build-dotnet.nix +++ b/pkgs/development/compilers/dotnet/build-dotnet.nix @@ -24,6 +24,7 @@ assert if type == "sdk" then packages != null else true; , testers , runCommand , writeShellScript +, mkNugetDeps }: let @@ -40,6 +41,12 @@ let runtime = ".NET Runtime ${version}"; sdk = ".NET SDK ${version}"; }; + + packageDeps = mkNugetDeps { + name = "${pname}-${version}-deps"; + nugetDeps = packages; + }; + in stdenv.mkDerivation (finalAttrs: rec { inherit pname version; @@ -120,7 +127,8 @@ stdenv.mkDerivation (finalAttrs: rec { ''; passthru = rec { - inherit icu packages; + inherit icu; + packages = packageDeps; updateScript = if type == "sdk" then diff --git a/pkgs/development/tools/continuous-integration/github-runner/default.nix b/pkgs/development/tools/continuous-integration/github-runner/default.nix index ab762a13e99f..351b8e5e4d47 100644 --- a/pkgs/development/tools/continuous-integration/github-runner/default.nix +++ b/pkgs/development/tools/continuous-integration/github-runner/default.nix @@ -28,10 +28,6 @@ let inherit sha256; }; - sdkSource = linkFarmFromDrvs "nuget-sdk-packages" ( - dotnetSdk.passthru.packages { inherit fetchNuGet; } - ); - nugetSource = linkFarmFromDrvs "nuget-packages" ( import ./deps.nix { inherit fetchNuGet; } ); @@ -51,8 +47,6 @@ stdenv.mkDerivation rec { pname = "github-runner"; version = "2.300.0"; - inherit sdkSource; - src = fetchFromGitHub { owner = "actions"; repo = "runner"; @@ -124,7 +118,7 @@ stdenv.mkDerivation rec { # Restore the dependencies dotnet restore src/ActionsRunner.sln \ --runtime "${runtimeId}" \ - --source "${sdkSource}" \ + --source "${dotnetSdk.packages}" \ --source "${nugetSource}" runHook postConfigure @@ -353,7 +347,7 @@ stdenv.mkDerivation rec { '') (lib.attrValues runtimeIds)} printf "\n* Make %s file\n" "$(basename "$deps_file")" - nuget-to-nix "$workdir/nuget_pkgs" "${sdkSource}" > "$deps_file" + nuget-to-nix "$workdir/nuget_pkgs" "${dotnetSdk.packages}" > "$deps_file" printf "\n* Dependency file writen to %s" "$deps_file" ''; };