[commit: ghc] wip/T16466: base: Depend upon shlwapi on Windows (b817d41)

git at git.haskell.org git at git.haskell.org
Wed Mar 20 15:27:36 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T16466
Link       : http://ghc.haskell.org/trac/ghc/changeset/b817d41381f7bdc1631dffbc7e00a0dfbc7edb64/ghc

>---------------------------------------------------------------

commit b817d41381f7bdc1631dffbc7e00a0dfbc7edb64
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Mar 20 09:16:15 2019 -0400

    base: Depend upon shlwapi on Windows
    
    As noted in #16466, `System.Environment.getExecutablePath` depends upon
    `PathFileExistsW` which is defined by `shlwapi`.
    
    Fixes #16466.


>---------------------------------------------------------------

b817d41381f7bdc1631dffbc7e00a0dfbc7edb64
 libraries/base/base.cabal             | 3 ++-
 libraries/base/tests/System/T16466.hs | 6 ++++++
 libraries/base/tests/System/all.T     | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal
index 4e809e7..630ff91 100644
--- a/libraries/base/base.cabal
+++ b/libraries/base/base.cabal
@@ -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
index 0000000..28cb259
--- /dev/null
+++ b/libraries/base/tests/System/T16466.hs
@@ -0,0 +1,6 @@
+import System.Environment
+
+-- Make sure that getExecutablePath works on Windows. See #16466.
+main :: IO ()
+main = () <$ getExecutablePath
+
diff --git a/libraries/base/tests/System/all.T b/libraries/base/tests/System/all.T
index 3cadf35..50ebb59 100644
--- a/libraries/base/tests/System/all.T
+++ b/libraries/base/tests/System/all.T
@@ -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, [''])



More information about the ghc-commits mailing list