From 2aaafc8b9788e4a3447a10740479e0e7c0622cda Mon Sep 17 00:00:00 2001 From: Ben Gamari <ben@well-typed.com> Date: Mon, 23 Jan 2017 14:52:36 -0500 Subject: [PATCH] Bump Win32 version. Bump the version of `Win32` to `2.5.0.0` which is a major update and includes fixes for wrong alignments and wrong 64-bit types. Strangely enough this also seems to resolve #12713, where `T10858` was failing due to too-low allocations. The underlying type aliases have changed, so there is a potential for user programs not to compile anymore, but the types were incorrect. This also requires a bump in the `directory`, `Cabal`, and `process` submodules. Original author: Tamar Christina <tamar@zhox.com> Test Plan: ./validate Reviewers: bgamari, RyanGlScott, austin Subscribers: hvr, RyanGlScott, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2938 --- compiler/ghc.cabal.in | 2 +- compiler/main/SysTools.hs | 8 ++++++-- ghc/ghc-bin.cabal.in | 2 +- libraries/Cabal | 2 +- libraries/Win32 | 2 +- libraries/directory | 2 +- libraries/process | 2 +- testsuite/tests/deriving/perf/all.T | 4 +--- testsuite/timeout/WinCBindings.hsc | 5 +++-- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 63276b34dbdc..dea0be5ad1aa 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -68,7 +68,7 @@ Library hoopl >= 3.10.2 && < 3.11 if os(windows) - Build-Depends: Win32 == 2.3.* + Build-Depends: Win32 >= 2.3 && < 2.6 else if flag(terminfo) Build-Depends: terminfo == 0.4.* diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 5bd9fd1f4734..67771947ad34 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -85,7 +85,11 @@ import qualified System.Posix.Internals #else /* Must be Win32 */ import Foreign import Foreign.C.String -import qualified System.Win32.Info as Info +#if MIN_VERSION_Win32(2,5,0) +import qualified System.Win32.Types as Win32 +#else +import qualified System.Win32.Info as Win32 +#endif import Control.Exception (finally) import Foreign.Ptr (FunPtr, castPtrToFunPtr) import System.Win32.Types (DWORD, LPTSTR, HANDLE) @@ -1514,7 +1518,7 @@ getFinalPath name = do (fILE_ATTRIBUTE_NORMAL .|. fILE_FLAG_BACKUP_SEMANTICS) Nothing let fnPtr = makeGetFinalPathNameByHandle $ castPtrToFunPtr addr - path <- Info.try "GetFinalPathName" + path <- Win32.try "GetFinalPathName" (\buf len -> fnPtr handle buf len 0) 512 `finally` closeHandle handle return $ Just path diff --git a/ghc/ghc-bin.cabal.in b/ghc/ghc-bin.cabal.in index dce6142dce1b..9c9ca0e24640 100644 --- a/ghc/ghc-bin.cabal.in +++ b/ghc/ghc-bin.cabal.in @@ -38,7 +38,7 @@ Executable ghc ghc == @ProjectVersionMunged@ if os(windows) - Build-Depends: Win32 == 2.3.* + Build-Depends: Win32 >= 2.3 && < 2.6 else Build-Depends: unix == 2.7.* diff --git a/libraries/Cabal b/libraries/Cabal index 7502659b7684..824d0bae1aee 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit 7502659b7684e057047c68886df9c061645992c6 +Subproject commit 824d0bae1aee2a25cabdcef92e5e1dd470c7dac0 diff --git a/libraries/Win32 b/libraries/Win32 index bb9469ece0b8..8d3f144a902b 160000 --- a/libraries/Win32 +++ b/libraries/Win32 @@ -1 +1 @@ -Subproject commit bb9469ece0b882017fa7f3b51e8db1d2985d6720 +Subproject commit 8d3f144a902bd13e1c6192e62ac1b2cf7cef595d diff --git a/libraries/directory b/libraries/directory index 65d1d85a3fc3..4a4a19d1c46c 160000 --- a/libraries/directory +++ b/libraries/directory @@ -1 +1 @@ -Subproject commit 65d1d85a3fc3373a425a0298d572da9cd9ee3d86 +Subproject commit 4a4a19d1c46c70ffd9a3e1c4c283e2e16214258f diff --git a/libraries/process b/libraries/process index 85cc1d17e955..0524859137fc 160000 --- a/libraries/process +++ b/libraries/process @@ -1 +1 @@ -Subproject commit 85cc1d17e9550a075003a764a2429d4acde65159 +Subproject commit 0524859137fc01bdb2a4833fd0aa6b23a48c6b15 diff --git a/testsuite/tests/deriving/perf/all.T b/testsuite/tests/deriving/perf/all.T index a6f9cc9f3c8b..0c3e9a4d3edd 100644 --- a/testsuite/tests/deriving/perf/all.T +++ b/testsuite/tests/deriving/perf/all.T @@ -1,8 +1,6 @@ test('T10858', [compiler_stats_num_field('bytes allocated', [ (wordsize(64), 222312440, 8) ]), - only_ways(['normal']), - when(msys(), expect_broken(12713)) - ], + only_ways(['normal'])], compile, ['-O']) diff --git a/testsuite/timeout/WinCBindings.hsc b/testsuite/timeout/WinCBindings.hsc index 0c4ff3f5b459..a72cdcfafb63 100644 --- a/testsuite/timeout/WinCBindings.hsc +++ b/testsuite/timeout/WinCBindings.hsc @@ -259,9 +259,10 @@ foreign import WINDOWS_CCONV unsafe "windows.h WaitForSingleObject" type JOBOBJECTINFOCLASS = CInt type PVOID = Ptr () - -type ULONG_PTR = CUIntPtr type PULONG_PTR = Ptr ULONG_PTR +#if !MIN_VERSION_Win32(2,5,0) +type ULONG_PTR = CUIntPtr +#endif jobObjectExtendedLimitInformation :: JOBOBJECTINFOCLASS jobObjectExtendedLimitInformation = #const JobObjectExtendedLimitInformation -- GitLab