daml/bazel_tools/haskell-ghci-grpc.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

17 lines
799 B
Diff

On MacOS GHCi fails to load grpc fat_cbits statically due to duplicate symbols.
diff --git a/haskell/providers.bzl b/haskell/providers.bzl
index 7574456..a5241e1 100644
--- a/haskell/providers.bzl
+++ b/haskell/providers.bzl
@@ -270,6 +270,10 @@ def get_extra_libs(hs, cc_info, dynamic = False, pic = None, fixup_dir = "_libs"
dynamic_lib = symlink_dynamic_library(hs, dynamic_lib, fixed_lib_dir)
static_lib = mangle_static_library(hs, dynamic_lib, static_lib, fixed_lib_dir)
+ if fixup_dir == "_ghci_libs" and dynamic_lib and get_lib_name(dynamic_lib) == "fat_cbits":
+ dynamic_libs.append(dynamic_lib)
+ continue
+
if static_lib and not (dynamic and dynamic_lib):
static_libs.append(static_lib)
elif dynamic_lib: