daml/bazel_tools/haskell-windows-extra-libraries.patch
Andreas Herrmann 559c78003e
Update rules_haskell (#4751)
* Update rules_haskell

The workaround for linking against `Cffi` in the REPL has been
upstreamed in a more generalized form.

CHANGELOG_BEGIN
CHANGELOG_END

* ghcide: Use rules_haskell's hie-bios support

* Document `ghcide` Bazel integration

* Rename files to match module names

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
2020-03-13 16:49:34 +01:00

21 lines
902 B
Diff

Some packages, network in particular, require to link additional libraries to
avoid missing symbol errors when linking on Windows.
diff --git a/haskell/private/actions/package.bzl b/haskell/private/actions/package.bzl
index bcb83c73..46148f16 100644
--- a/haskell/private/actions/package.bzl
+++ b/haskell/private/actions/package.bzl
@@ -97,7 +97,12 @@ def package(
"library-dirs": ["${pkgroot}"] + extra_lib_dirs,
"dynamic-library-dirs": ["${pkgroot}"] + extra_dynamic_lib_dirs,
"hs-libraries": [pkg_id.library_name(hs, my_pkg_id)] if has_hs_library else [],
- "extra-libraries": extra_libs,
+ "extra-libraries": extra_libs + ([
+ "stdc++",
+ "crypt32",
+ "shlwapi",
+ "ws2_32",
+ ] if hs.toolchain.is_windows else []),
"depends": hs.package_ids,
"exposed-modules": exposed_modules,
})