addLibrarySearchPath is not long-path aware
Currently several of the plugin tests are susceptible to failure on Windows due to long path issues in the linker. For instance,
--- "C:/GitLabRunner/builds/0/931185/tmp/ghctest-95sfucfd/test spaces/testsuite/tests/plugins/test-defaulting-plugin-fail.run/test-defaulting-plugin-fail.stderr.normalised" 2022-02-06 05:29:58.766619100 +0100
+++ "C:/GitLabRunner/builds/0/931185/tmp/ghctest-95sfucfd/test spaces/testsuite/tests/plugins/test-defaulting-plugin-fail.run/test-defaulting-plugin-fail.run.stderr.normalised" 2022-02-06 05:29:58.766619100 +0100
@@ -1,5 +1,7 @@
+
test-defaulting-plugin-fail.hs:25:19:
Cannot satisfy: 5 <= a0
In the second argument of ‘(+)’, namely ‘e’
In the second argument of ‘($)’, namely ‘q + w + e’
In a stmt of a 'do' block: print $ q + w + e
+ghc: addLibrarySearchPath: C:/GitLabRunner/builds/0/931185/tmp/ghctest-95sfucfd/test spaces/testsuite/tests/plugins/test-defaulting-plugin-fail.run/defaulting-plugin/pkg.test-defaulting-plugin-fail/install/x86_64-windows-ghc/defaulting-plugin-0.1.0.0-95h8UmMlwlI2ln7gWFoXnU (Win32 error 206): The filename or extension is too long.
The problem here appears to be that addLibrarySearchPath
does not normalise the given path to a UNC-style path before passing it to AllDllDirectory
, thus avoiding the path length limitation.