-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update rules_haskell and static GHC #1515
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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: |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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, | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be upstreamed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, for Linux there is also a benefit in reducing the number of required
RUNPATH
entries. The dynamic linker has to traverse less directories to find libraries. Indaml
we're not strongly affect by this, since we're mostly only linking statically.