daml/bazel_tools/haskell-darwin-symlink-dylib.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

19 lines
980 B
Diff

rules_haskell generates symbolic links for dynamic library dependencies to
avoid too long load commands and too many RUNPATH commands and to convert .so
file extensions to .dylib file extensions on MacOS. On Windows creating the
symbolic links can fail due to too long file paths. The symlinks are only
really required on MacOS, so we limit their creation to MacOS.
diff --git a/haskell/providers.bzl b/haskell/providers.bzl
index 7574456..e5b7c2e 100644
--- a/haskell/providers.bzl
+++ b/haskell/providers.bzl
@@ -266,7 +266,7 @@ def get_extra_libs(hs, cc_info, dynamic = False, pic = None, fixup_dir = "_libs"
elif lib_to_link.static_library and not pic_required:
static_lib = lib_to_link.static_library
- if dynamic_lib:
+ if dynamic_lib and hs.toolchain.is_darwin:
dynamic_lib = symlink_dynamic_library(hs, dynamic_lib, fixed_lib_dir)
static_lib = mangle_static_library(hs, dynamic_lib, static_lib, fixed_lib_dir)