forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ghc lib 8.8.0.20190723 (digital-asset#2279)
* Upgrade ghc-lib * Patch bazel_tools : hazel-include-paths patch, no-isystem patch. * Provide "haskell_c2hs" for package name to cabal_haskell_package * Package name haskell_c2hs => c2hs. * Switch to less hacky patch for include dirs
- Loading branch information
1 parent
24b8a6d
commit ee5079d
Showing
6 changed files
with
69 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From 094c0a1a37f8131e457b24bdc2f37cd36bde00c0 Mon Sep 17 00:00:00 2001 | ||
From: Andreas Herrmann <andreas.herrmann@tweag.io> | ||
Date: Wed, 24 Jul 2019 09:41:43 +0200 | ||
Subject: [PATCH] Hazel: Fix includeDirs | ||
|
||
Hazel was adding bogus -I/<include-dir> flags, when instead it should be | ||
-Iexternal/haskell_<package_name>/<include-dir>. | ||
--- | ||
hazel/third_party/cabal2bazel/bzl/cabal_package.bzl | 9 ++++++++- | ||
1 file changed, 8 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/hazel/third_party/cabal2bazel/bzl/cabal_package.bzl b/hazel/third_party/cabal2bazel/bzl/cabal_package.bzl | ||
index 0e8238d8..1e177311 100644 | ||
--- a/hazel/third_party/cabal2bazel/bzl/cabal_package.bzl | ||
+++ b/hazel/third_party/cabal2bazel/bzl/cabal_package.bzl | ||
@@ -453,6 +453,12 @@ def _get_build_attrs( | ||
] + | ||
install_includes, | ||
) | ||
- ghcopts += ["-I" + native.package_name() + "/" + d for d in build_info.includeDirs] | ||
+ # repository_name starts with @, strip that bit off. Adding the include | ||
+ # directories to the cc_library below alone is not sufficient. The includes | ||
+ # attribute ends up in -isystem include flags. However, some Haskell | ||
+ # libraries attempt to include headers using #include "" syntax instead of | ||
+ # #include <>. | ||
+ includeOpts = ["-I" + paths.join("external", native.repository_name()[1:], native.package_name(), i) for i in build_info.includeDirs] | ||
+ ghcopts += includeOpts | ||
for xs in deps.values(): | ||
xs.append(cbits_name) | ||
|
||
@@ -474,6 +480,7 @@ def _get_build_attrs( | ||
srcs = build_info.cSources, | ||
includes = build_info.includeDirs, | ||
copts = ([o for o in build_info.ccOptions if not o.startswith("-D")] + | ||
+ includeOpts + | ||
[ | ||
"-D__GLASGOW_HASKELL__=" + ghc_version_string, | ||
"-w", |
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,13 @@ | ||
diff --git a/haskell/cc.bzl b/haskell/cc.bzl | ||
index cd42613..6c3e53a 100644 | ||
--- a/haskell/cc.bzl | ||
+++ b/haskell/cc.bzl | ||
@@ -59,7 +59,7 @@ def cc_interop_info(ctx): | ||
] + [ | ||
f | ||
for include in cc_ctx.system_includes.to_list() | ||
- for f in ["-isystem", include] | ||
+ for f in ["-I", include] | ||
], | ||
) | ||
|
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