From cf8caed16990c1812bf7defdcccd0095de01b304 Mon Sep 17 00:00:00 2001 From: David McFarland Date: Tue, 24 Jun 2025 11:25:09 -0300 Subject: [PATCH] dotnet: add buildDotnetModule tests to sdk passthru.tests --- pkgs/development/compilers/dotnet/wrapper.nix | 11 +++++++++++ pkgs/test/dotnet/use-dotnet-from-env/default.nix | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/dotnet/wrapper.nix b/pkgs/development/compilers/dotnet/wrapper.nix index 2fcaa17f3c6a..e303e1d948d2 100644 --- a/pkgs/development/compilers/dotnet/wrapper.nix +++ b/pkgs/development/compilers/dotnet/wrapper.nix @@ -18,6 +18,7 @@ replaceVars, nugetPackageHook, xmlstarlet, + pkgs, }: type: unwrapped: stdenvNoCC.mkDerivation (finalAttrs: { @@ -280,6 +281,16 @@ stdenvNoCC.mkDerivation (finalAttrs: { }; } // lib.optionalAttrs (type == "sdk") ({ + buildDotnetModule = + (pkgs.appendOverlays [ + (self: super: { + dotnet-sdk = finalAttrs.finalPackage; + dotnet-runtime = finalAttrs.finalPackage.runtime; + }) + ]).callPackage + ../../../test/dotnet/default.nix + { }; + console = lib.recurseIntoAttrs { # yes, older SDKs omit the comma cs = mkConsoleTests "C#" "cs" "Hello,?\\ World!"; diff --git a/pkgs/test/dotnet/use-dotnet-from-env/default.nix b/pkgs/test/dotnet/use-dotnet-from-env/default.nix index 97f4b139a673..5e9d20aa1c97 100644 --- a/pkgs/test/dotnet/use-dotnet-from-env/default.nix +++ b/pkgs/test/dotnet/use-dotnet-from-env/default.nix @@ -26,7 +26,7 @@ let ''; }); - runtimeVersion = lib.getVersion dotnet-runtime; + runtimeVersion = lib.head (lib.splitString "-" (lib.getVersion dotnet-runtime)); runtimeVersionFile = builtins.toFile "dotnet-version.txt" runtimeVersion; in {