From 08e378f0d43d01fc5ee19d52a732a03a82500ba1 Mon Sep 17 00:00:00 2001 From: mdarocha Date: Thu, 29 Dec 2022 22:39:28 +0100 Subject: [PATCH] buildDotnetModule: proper escaping of disabledTests --- .../dotnet/build-dotnet-module/hooks/default.nix | 6 +++++- .../dotnet/build-dotnet-module/hooks/dotnet-check-hook.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix index 2309ae6240d2..bce3d799fbb1 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix @@ -43,7 +43,11 @@ in substitutions = { inherit buildType libraryPath; disabledTests = lib.optionalString (disabledTests != []) - (lib.concatStringsSep "&FullyQualifiedName!=" disabledTests); + (let + escapedNames = lib.lists.map (n: lib.replaceStrings [","] ["%2C"] n) disabledTests; + filters = lib.lists.map (n: "FullyQualifiedName!=${n}") escapedNames; + in + "${lib.concatStringsSep "&" filters}"); }; } ./dotnet-check-hook.sh) { }; diff --git a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-check-hook.sh b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-check-hook.sh index fcb77c063bfc..fdcf8d54be46 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-check-hook.sh +++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-check-hook.sh @@ -7,7 +7,7 @@ dotnetCheckHook() { runHook preCheck if [ "${disabledTests-}" ]; then - local -r disabledTestsFlag="--filter FullyQualifiedName!=@disabledTests@" + local -r disabledTestsFlag="--filter @disabledTests@" fi if [ "${enableParallelBuilding-}" ]; then