From c82bc74bcbdaa3c17b9e6dd453204bbd16f8dfd5 Mon Sep 17 00:00:00 2001 From: David McFarland Date: Fri, 15 May 2026 16:30:40 -0300 Subject: [PATCH] dotnet: remove cross-target tests from broken SDKs --- .../compilers/dotnet/binary/build-dotnet.nix | 2 ++ .../compilers/dotnet/combine-packages.nix | 2 +- .../development/compilers/dotnet/source/packages.nix | 12 +++--------- pkgs/development/compilers/dotnet/source/vmr.nix | 2 ++ pkgs/test/dotnet/cross-target/default.nix | 4 +++- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/dotnet/binary/build-dotnet.nix b/pkgs/development/compilers/dotnet/binary/build-dotnet.nix index b6c9165ae996..7711cc2fee65 100644 --- a/pkgs/development/compilers/dotnet/binary/build-dotnet.nix +++ b/pkgs/development/compilers/dotnet/binary/build-dotnet.nix @@ -197,6 +197,8 @@ mkWrapper type ( passthru = { inherit icu hasILCompiler; + # https://github.com/dotnet/sdk/pull/53405 + hasCrossTargetBug = lib.versionAtLeast version "10"; } // lib.optionalAttrs (type == "sdk") ( let diff --git a/pkgs/development/compilers/dotnet/combine-packages.nix b/pkgs/development/compilers/dotnet/combine-packages.nix index 8fe4e1217fb3..f6070922365e 100644 --- a/pkgs/development/compilers/dotnet/combine-packages.nix +++ b/pkgs/development/compilers/dotnet/combine-packages.nix @@ -58,7 +58,7 @@ mkWrapper "sdk" ( passthru = { pname = "dotnet"; version = "combined"; - inherit (cli) icu; + inherit (cli) icu hasCrossTargetBug; versions = lib.catAttrs "version" dotnetPackages; packages = lib.concatLists (lib.catAttrs "packages" dotnetPackages); diff --git a/pkgs/development/compilers/dotnet/source/packages.nix b/pkgs/development/compilers/dotnet/source/packages.nix index 1d4fe78cec83..4836c3162d55 100644 --- a/pkgs/development/compilers/dotnet/source/packages.nix +++ b/pkgs/development/compilers/dotnet/source/packages.nix @@ -28,6 +28,9 @@ let (allow mach-lookup (global-name "com.apple.SecurityServer") (global-name "com.apple.system.opendirectoryd.membership")) ''; + passthru = args.passthru or { } // { + inherit (vmr) icu hasCrossTargetBug; + }; } ) ); @@ -184,7 +187,6 @@ let passthru = { inherit (vmr) - icu targetRid hasILCompiler ; @@ -221,10 +223,6 @@ let runHook postInstall ''; - passthru = { - inherit (vmr) icu; - }; - meta = vmr.meta // { mainProgram = "dotnet"; }; @@ -252,10 +250,6 @@ let runHook postInstall ''; - passthru = { - inherit (vmr) icu; - }; - meta = vmr.meta // { mainProgram = "dotnet"; }; diff --git a/pkgs/development/compilers/dotnet/source/vmr.nix b/pkgs/development/compilers/dotnet/source/vmr.nix index 2ce2721bb021..5f7ceb2d7a15 100644 --- a/pkgs/development/compilers/dotnet/source/vmr.nix +++ b/pkgs/development/compilers/dotnet/source/vmr.nix @@ -149,6 +149,7 @@ stdenv.mkDerivation { ./fix-aspnetcore-portable-build.patch ./vmr-compiler-opt-v8.patch ] + # see passthru.hasCrossTargetBug ++ lib.optional ( lib.versionAtLeast version "10" && lib.versionOlder version "11" ) ./Prefer-DOTNET_ROOT-over-directory-traversal-when-fin.patch @@ -515,6 +516,7 @@ stdenv.mkDerivation { icu = _icu; # ilcompiler is currently broken: https://github.com/dotnet/source-build/issues/1215 hasILCompiler = lib.versionAtLeast version "9"; + hasCrossTargetBug = false; }; meta = { diff --git a/pkgs/test/dotnet/cross-target/default.nix b/pkgs/test/dotnet/cross-target/default.nix index be1595d27216..4ada55016d56 100644 --- a/pkgs/test/dotnet/cross-target/default.nix +++ b/pkgs/test/dotnet/cross-target/default.nix @@ -44,4 +44,6 @@ let }; in -lib.recurseIntoAttrs (lib.mapAttrs (_: mkTest) sdks) +lib.optionalAttrs (!dotnet-sdk.hasCrossTargetBug) ( + lib.recurseIntoAttrs (lib.mapAttrs (_: mkTest) sdks) +)