summary refs log tree commit diff
path: root/pkgs/build-support/dotnet
diff options
context:
space:
mode:
authormdarocha <git@mdarocha.pl>2022-06-28 22:47:20 +0200
committermdarocha <git@mdarocha.pl>2022-07-13 17:15:36 +0200
commit3d79e4871b8db65b613761a29295b07d89f059d1 (patch)
tree469004ceaa00eaad50d8462898d64ac4e4ad935e /pkgs/build-support/dotnet
parent070314b62d7b243ee127bda8710e0020776c48a8 (diff)
downloadnixpkgs-3d79e4871b8db65b613761a29295b07d89f059d1.tar
nixpkgs-3d79e4871b8db65b613761a29295b07d89f059d1.tar.gz
nixpkgs-3d79e4871b8db65b613761a29295b07d89f059d1.tar.bz2
nixpkgs-3d79e4871b8db65b613761a29295b07d89f059d1.tar.lz
nixpkgs-3d79e4871b8db65b613761a29295b07d89f059d1.tar.xz
nixpkgs-3d79e4871b8db65b613761a29295b07d89f059d1.tar.zst
nixpkgs-3d79e4871b8db65b613761a29295b07d89f059d1.zip
buildDotnetModule: set LD_LIBRARY_PATH from runtimeDeps in dotnetCheckHook
Tests should execute in a similar environment to the final app
Diffstat (limited to 'pkgs/build-support/dotnet')
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix7
-rw-r--r--pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-check-hook.sh2
2 files changed, 6 insertions, 3 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 76f7eea5bfe..5f5916d08b1 100644
--- a/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix
+++ b/pkgs/build-support/dotnet/build-dotnet-module/hooks/default.nix
@@ -11,6 +11,9 @@
 , buildType
 }:
 
+let
+  libraryPath = lib.makeLibraryPath runtimeDeps;
+in
 {
   dotnetConfigureHook = callPackage ({ }:
     makeSetupHook {
@@ -35,7 +38,7 @@
       name = "dotnet-check-hook";
       deps = [ dotnet-test-sdk ];
       substitutions = {
-        inherit buildType;
+        inherit buildType libraryPath;
         disabledTests = lib.optionalString (disabledTests != [])
           (lib.concatStringsSep "&FullyQualifiedName!=" disabledTests);
       };
@@ -56,7 +59,7 @@
       deps = [ dotnet-runtime makeWrapper ];
       substitutions = {
         dotnetRuntime = dotnet-runtime;
-        runtimeDeps = lib.makeLibraryPath runtimeDeps;
+        runtimeDeps = libraryPath;
       };
     } ./dotnet-fixup-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 6b3deaa52f9..bc7b1b5c3d8 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
@@ -11,7 +11,7 @@ dotnetCheckHook() {
     fi
 
     for project in ${testProjectFile[@]}; do
-        env \
+        env "LD_LIBRARY_PATH=@libraryPath@" \
             dotnet test "$project" \
               -maxcpucount:$maxCpuFlag \
               -p:ContinuousIntegrationBuild=true \