Drop haskell-rts-docs.patch and haskell-ghc-includes.patch (#14045)

* Update rules_haskell version and hash

* remove `haskell-rts-docs.patch`
* remove `haskell-ghc-includes.patch`

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Claudio Bley 2022-06-16 13:52:24 +02:00 committed by GitHub
parent 3177786b1d
commit 21ef82066a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 106 deletions

View File

@ -1,56 +0,0 @@
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/process_hsc_file.bzl b/haskell/private/actions/process_hsc_file.bzl
index 07bdec29..76dd195a 100644
--- a/haskell/private/actions/process_hsc_file.bzl
+++ b/haskell/private/actions/process_hsc_file.bzl
@@ -60,17 +60,35 @@ 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),
]),
input_manifests = cc.manifests,
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,
)

View File

@ -1,44 +0,0 @@
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

View File

@ -34,18 +34,14 @@ load("//:canton_dep.bzl", "canton")
rules_scala_version = "17791a18aa966cdf2babb004822e6c70a7decc76" rules_scala_version = "17791a18aa966cdf2babb004822e6c70a7decc76"
rules_scala_sha256 = "6899cddf7407d09266dddcf6faf9f2a8b414de5e2b35ef8b294418f559172f28" rules_scala_sha256 = "6899cddf7407d09266dddcf6faf9f2a8b414de5e2b35ef8b294418f559172f28"
rules_haskell_version = "e1017b429526e6549ef327e80ce7b3f3af3470a3" rules_haskell_version = "d3caf0cc94a8dc6af682da42d3b89ef7e85cb987"
rules_haskell_sha256 = "f527f0e1a654cf2031a6540f674af328dc5f32a0fae55b5ac588861aa7a608e6" rules_haskell_sha256 = "16f6ba4997fa4847d7dc26db2c08f71087b591e53ac8c334b1e7f62f6cf3a5da"
rules_haskell_patches = [ rules_haskell_patches = [
# This is a daml specific patch and not upstreamable. # This is a daml specific patch and not upstreamable.
"@com_github_digital_asset_daml//bazel_tools:haskell-windows-extra-libraries.patch", "@com_github_digital_asset_daml//bazel_tools:haskell-windows-extra-libraries.patch",
# This should be made configurable in rules_haskell. # This should be made configurable in rules_haskell.
# Remove this patch once that's available. # Remove this patch once that's available.
"@com_github_digital_asset_daml//bazel_tools:haskell-opt.patch", "@com_github_digital_asset_daml//bazel_tools:haskell-opt.patch",
# This should be upstreamed
"@com_github_digital_asset_daml//bazel_tools:haskell-rts-docs.patch",
# This should be upstreamed
"@com_github_digital_asset_daml//bazel_tools:haskell-ghc-includes.patch",
] ]
rules_nixpkgs_version = "210d30a81cedde04b4281fd163428722278fddfb" rules_nixpkgs_version = "210d30a81cedde04b4281fd163428722278fddfb"
rules_nixpkgs_sha256 = "61b24e273821a15146f9ae7577e64b53f6aa332d5a7056abe8221ae2c346fdbd" rules_nixpkgs_sha256 = "61b24e273821a15146f9ae7577e64b53f6aa332d5a7056abe8221ae2c346fdbd"