daml/bazel_tools/haskell-windows-remove-fake-libs.patch
Moritz Kiefer e0c5abd647
Switch to GHC 8.10.3 (#8394)
* Switch to GHC 8.10.3

changelog_begin
changelog_end

* Update bazel-haskell-deps.bzl

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Comment on rules_haskell patch

changelog_begin
changelog_end

* .

changelog_begin
changelog_end

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2021-01-25 11:53:53 +00:00

21 lines
1.2 KiB
Diff

diff --git a/haskell/ghc_bindist.bzl b/haskell/ghc_bindist.bzl
index aee64067..e049f37f 100644
--- a/haskell/ghc_bindist.bzl
+++ b/haskell/ghc_bindist.bzl
@@ -385,7 +385,11 @@ haskell_toolchain(
if os == "windows":
# These libraries cause linking errors on Windows when linking
- # pthreads, due to libwinpthread-1.dll not being loaded.
- execute_or_fail_loudly(ctx, ["rm", "mingw/lib/gcc/x86_64-w64-mingw32/7.2.0/libstdc++.dll.a"])
- execute_or_fail_loudly(ctx, ["rm", "mingw/x86_64-w64-mingw32/lib/libpthread.dll.a"])
- execute_or_fail_loudly(ctx, ["rm", "mingw/x86_64-w64-mingw32/lib/libwinpthread.dll.a"])
+ # pthreads, due to libwinpthread-1.dll not being loaded. It's
+ # hard to guesss the paths of these libraries, so we have to
+ # use dir to recursively find them.
+ result = ctx.execute(["cmd", "/c", "dir", "/s", "/b", "libstdc++.dll.a"])
+ for path in result.stdout.splitlines():
+ ctx.execute(["cmd", "/c", "del", path.strip()])
+ ctx.execute(["rm", "mingw/x86_64-w64-mingw32/lib/libpthread.dll.a"])
+ ctx.execute(["rm", "mingw/x86_64-w64-mingw32/lib/libwinpthread.dll.a"])