base: Depend upon shlwapi on Windows
authorBen Gamari <ben@smart-cactus.org>
Wed, 20 Mar 2019 13:16:15 +0000 (09:16 -0400)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Thu, 21 Mar 2019 00:29:20 +0000 (20:29 -0400)
As noted in #16466, `System.Environment.getExecutablePath` depends upon
`PathFileExistsW` which is defined by `shlwapi`.

Fixes #16466.

libraries/base/base.cabal
libraries/base/tests/System/T16466.hs [new file with mode: 0644]
libraries/base/tests/System/all.T

index 4e809e7..630ff91 100644 (file)
@@ -365,7 +365,8 @@ Library
         -- mingw32: Unfortunately required because of a resource leak between
         --          mingwex and mingw32. the __math_err symbol is defined in
         --          mingw32 which is required by mingwex.
-        extra-libraries: wsock32, user32, shell32, msvcrt, mingw32, mingwex
+        -- shlwapi: provides PathFileExistsW
+        extra-libraries: wsock32, user32, shell32, msvcrt, mingw32, mingwex, shlwapi
         exposed-modules:
             GHC.IO.Encoding.CodePage.API
             GHC.IO.Encoding.CodePage.Table
diff --git a/libraries/base/tests/System/T16466.hs b/libraries/base/tests/System/T16466.hs
new file mode 100644 (file)
index 0000000..28cb259
--- /dev/null
@@ -0,0 +1,6 @@
+import System.Environment
+
+-- Make sure that getExecutablePath works on Windows. See #16466.
+main :: IO ()
+main = () <$ getExecutablePath
+
index 3cadf35..50ebb59 100644 (file)
@@ -7,3 +7,4 @@ test('T5930',   normal, compile_and_run, [''])
 test('system001',   when(opsys("mingw32"), skip), \
        compile_and_run, [''])
 test('Timeout001', normal, compile_and_run, [''])
+test('T16466', normal, compile_and_run, [''])