daml/bazel_tools/haskell-ghci-grpc.patch
Andreas Herrmann cf6814e93b Use cc_wrapper to shorten library and include paths and rpaths (#2791)
* Fix bazel query deps(//...)

* Add rules_haskell cc_wrapper

Updates to latest rules_haskell master and adds the cc_wrapper PR as a
patch, see https://github.com/tweag/rules_haskell/pull/1039.

* Shorten include dirs in cc-wrapper

When using `haskell_cabal_library` GHC constructs unnecessarily long
include directories which can quickly overflow the maximum command-line
length. This patch avoids the issue by normalizing include paths.

* glob --> breadth_first_walk
2019-09-09 15:50:51 +00:00

17 lines
785 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 9c6e1d5..e2952bd 100644
--- a/haskell/providers.bzl
+++ b/haskell/providers.bzl
@@ -264,6 +264,10 @@ def get_extra_libs(hs, cc_info, dynamic = False, pic = None, fixup_dir = "_libs"
static_lib = mangle_static_library(hs, dynamic_lib, static_lib, fixed_lib_dir)
+ if hs.toolchain.is_darwin and fixup_dir == "_ghci_libs" and dynamic_lib and get_lib_name(dynamic_lib) == "fat_cbits":
+ dynamic_libs.append(symlink_dynamic_library(hs, dynamic_lib, fixup_dir))
+ continue
+
if static_lib and not (dynamic and dynamic_lib):
static_libs.append(static_lib)
elif dynamic_lib: