daml/bazel_tools/haskell-windows-extra-libraries.patch
Andreas Herrmann 93d8e01db2
Update rules_haskell and static GHC (#1515)
* Update rules_haskell and static GHC

Remove patches that have been upstreamed or are no longer required.
Update still required patches to match the new rules_haskell version.

Previously we patched rules_haskell to coerce GHC into using static
Haskell libraries in most places. In particular we moved hs-libraries
entries into extra-libraries entries in the package configuration files.
A much cleaner approach is to compile GHC with a static RTS, then GHC
will by itself choose to load static Haskell libraries.

* Remove haskell_cc_import

* da-hs-daml-cli -> daml-cli

* da-hs-damlc-app -> damlc-app
2019-07-01 13:26:19 +02:00

20 lines
823 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 2b56388..0c5c37c 100644
--- a/haskell/private/actions/package.bzl
+++ b/haskell/private/actions/package.bzl
@@ -107,7 +107,12 @@ def package(
"library-dirs": ["${pkgroot}"] + extra_lib_dirs,
"dynamic-library-dirs": ["${pkgroot}"] + extra_lib_dirs,
"hs-libraries": [pkg_id.library_name(hs, my_pkg_id)],
- "extra-libraries": extra_libs,
+ "extra-libraries": extra_libs + ([
+ "stdc++",
+ "crypt32",
+ "shlwapi",
+ "ws2_32",
+ ] if hs.toolchain.is_windows else []),
"depends": hs.package_ids,
})