forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to GHC 9.0.2 (digital-asset#12300)
changelog_begin changelog_end Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
- Loading branch information
1 parent
1238e1b
commit e4764cc
Showing
68 changed files
with
1,424 additions
and
1,175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/haskell/c2hs.bzl b/haskell/c2hs.bzl | ||
index 96dfd503..0fad061c 100644 | ||
--- a/haskell/c2hs.bzl | ||
+++ b/haskell/c2hs.bzl | ||
@@ -95,7 +95,8 @@ def _c2hs_library_impl(ctx): | ||
""" | ||
# Include libdir in include path just like hsc2hs does. | ||
libdir=$({ghc} --print-libdir) | ||
- {c2hs} -C-I$libdir/include "$@" | ||
+ # GHC >=9 on Windows stores the includes outside of libdir | ||
+ {c2hs} -C-I$libdir/include -C-I$libdir/../include "$@" | ||
""".format( | ||
ghc = hs.tools.ghc.path, | ||
c2hs = c2hs_exe.path, | ||
diff --git a/haskell/private/actions/compile.bzl b/haskell/private/actions/compile.bzl | ||
index ee5f3d02..a89e815b 100644 | ||
--- a/haskell/private/actions/compile.bzl | ||
+++ b/haskell/private/actions/compile.bzl | ||
@@ -82,16 +82,34 @@ def _process_hsc_file(hs, cc, hsc_flags, hsc_inputs, hsc_file): | ||
if hs.env.get("PATH") == None and hs.toolchain.is_windows: | ||
hs.env["PATH"] = "" | ||
|
||
- hs.actions.run( | ||
+ hs.actions.run_shell( | ||
inputs = depset(transitive = [ | ||
depset(cc.hdrs), | ||
depset([hsc_file]), | ||
depset(cc.files), | ||
depset(hsc_inputs), | ||
+ depset(hs.toolchain.bindir), | ||
]), | ||
outputs = [hs_out], | ||
mnemonic = "HaskellHsc2hs", | ||
- executable = hs.tools.hsc2hs, | ||
+ command = | ||
+ # cpp (called via c2hs) gets very unhappy if the mingw bin dir is | ||
+ # not in PATH so we add it to PATH explicitely. | ||
+ ( | ||
+ """ | ||
+ export PATH=$PATH:{mingw_bin} | ||
+ """.format(mingw_bin = paths.dirname(cc.tools.cc)) if hs.toolchain.is_windows else "" | ||
+ ) + | ||
+ """ | ||
+ # Include libdir in include path just like hsc2hs does. | ||
+ libdir=$({ghc} --print-libdir) | ||
+ # GHC >=9 on Windows stores the includes outside of libdir | ||
+ {hsc2hs} -C-I$libdir/include -C-I$libdir/../include "$@" | ||
+ """.format( | ||
+ ghc = hs.tools.ghc.path, | ||
+ hsc2hs = hs.tools.hsc2hs.path, | ||
+ ), | ||
+ | ||
arguments = [args], | ||
env = hs.env, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/haskell/assets/ghc_9_0_2_win.patch b/haskell/assets/ghc_9_0_2_win.patch | ||
index 6ae35350..340014db 100644 | ||
--- a/haskell/assets/ghc_9_0_2_win.patch | ||
+++ b/haskell/assets/ghc_9_0_2_win.patch | ||
@@ -286,14 +286,13 @@ | ||
+haddock-html: ${pkgroot}/../docs/html/libraries/process | ||
--- lib/package.conf.d/rts-1.0.2.conf | ||
+++ lib/package.conf.d/rts-1.0.2.conf | ||
-@@ -78,5 +78,5 @@ ld-options: | ||
+@@ -77,6 +77,3 @@ | ||
+ "-Wl,-u,hs_atomicread32" "-Wl,-u,hs_atomicwrite8" | ||
"-Wl,-u,hs_atomicwrite16" "-Wl,-u,hs_atomicwrite32" | ||
"-Wl,-u,base_GHCziEventziWindows_processRemoteCompletion_closure" | ||
- | ||
+- | ||
-haddock-interfaces: ${pkgroot}/../../docs/html/libraries/rts\rts.haddock | ||
-haddock-html: ${pkgroot}/../../docs/html/libraries/rts | ||
-+haddock-interfaces: ${pkgroot}/../docs/html/libraries/rts\rts.haddock | ||
-+haddock-html: ${pkgroot}/../docs/html/libraries/rts | ||
--- lib/package.conf.d/stm-2.5.0.0.conf | ||
+++ lib/package.conf.d/stm-2.5.0.0.conf | ||
@@ -34,5 +34,5 @@ dynamic-library-dirs: ${pkgroot}\x86_64-windows-ghc-9.0.2 | ||
diff --git a/haskell/assets/ghc_9_2_1_win.patch b/haskell/assets/ghc_9_2_1_win.patch | ||
index 584d7749..58cb4771 100644 | ||
--- a/haskell/assets/ghc_9_2_1_win.patch | ||
+++ b/haskell/assets/ghc_9_2_1_win.patch | ||
@@ -286,14 +286,13 @@ | ||
+haddock-html: ${pkgroot}/../docs/html/libraries/process | ||
--- lib/package.conf.d/rts-1.0.2.conf | ||
+++ lib/package.conf.d/rts-1.0.2.conf | ||
-@@ -78,5 +78,5 @@ ld-options: | ||
+@@ -77,6 +77,3 @@ | ||
+ "-Wl,-u,hs_atomicread32" "-Wl,-u,hs_atomicwrite8" | ||
"-Wl,-u,hs_atomicwrite16" "-Wl,-u,hs_atomicwrite32" | ||
"-Wl,-u,base_GHCziEventziWindows_processRemoteCompletion_closure" | ||
- | ||
+- | ||
-haddock-interfaces: ${pkgroot}/../../docs/html/libraries/rts\rts.haddock | ||
-haddock-html: ${pkgroot}/../../docs/html/libraries/rts | ||
-+haddock-interfaces: ${pkgroot}/../docs/html/libraries/rts\rts.haddock | ||
-+haddock-html: ${pkgroot}/../docs/html/libraries/rts | ||
--- lib/package.conf.d/stm-2.5.0.0.conf | ||
+++ lib/package.conf.d/stm-2.5.0.0.conf | ||
@@ -34,5 +34,5 @@ dynamic-library-dirs: ${pkgroot}\x86_64-windows-ghc-9.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/src/Turtle/Prelude.hs b/src/Turtle/Prelude.hs | ||
index 384fcb4..0e8d6b2 100644 | ||
--- a/src/Turtle/Prelude.hs | ||
+++ b/src/Turtle/Prelude.hs | ||
@@ -1237,10 +1237,14 @@ touch file = do | ||
Nothing | ||
(creationTime, _, _) <- Win32.getFileTime handle | ||
systemTime <- Win32.getSystemTimeAsFileTime | ||
+#if MIN_VERSION_Win32(2,12,0) | ||
+ Win32.setFileTime handle (Just creationTime) (Just systemTime) (Just systemTime) | ||
+#else | ||
Win32.setFileTime handle creationTime systemTime systemTime | ||
+#endif -- MIN_VERSION_Win32 | ||
#else | ||
then touchFile (Filesystem.encodeString file) | ||
-#endif | ||
+#endif -- mingw32_HOST_OS | ||
else output file empty ) | ||
|
||
{-| This type is the same as @"System.Directory".`System.Directory.Permissions`@ | ||
diff --git a/turtle.cabal b/turtle.cabal | ||
index 14af73d..6691e91 100644 | ||
--- a/turtle.cabal | ||
+++ b/turtle.cabal | ||
@@ -85,7 +85,7 @@ Library | ||
optional-args >= 1.0 && < 2.0 , | ||
unix-compat >= 0.4 && < 0.6 | ||
if os(windows) | ||
- Build-Depends: Win32 >= 2.2.0.1 && < 2.9 | ||
+ Build-Depends: Win32 >= 2.2.0.1 && < 2.13 | ||
else | ||
Build-Depends: unix >= 2.5.1.0 && < 2.8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.