Skip to content
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 #1133

Merged
merged 4 commits into from
May 20, 2019
Merged

Update rules_haskell #1133

merged 4 commits into from
May 20, 2019

Conversation

aherrmann-da
Copy link
Contributor

@aherrmann-da aherrmann-da commented May 14, 2019

  • rules_haskell now handles the global package db within Bazel Bazelify compiler's global package database tweag/rules_haskell#859
  • We no longer use the Nix provided c2hs. So, we drop it.
  • Rename ghcWithC2hs to ghcStatic to clarify that that's where the static linking patches are applied.
  • Extend package-db patches to align Nix store paths with the new $out. This works around a restriction in current rules_haskell, where the paths in the package config files must have the same prefix as the path to the package config files themselves. (This is also related to why we need to pull in libffi headers separately on Unix)
  • Adapt static linking patches to new rules_haskell
  • Simplify libffi headers on Windows. On Windows they are part of the GHC bindist and are now picked up by the new global package db handling, so we don't need to provide an additional target anymore.

Pull Request Checklist

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@aherrmann-da aherrmann-da force-pushed the rules_haskell-pkgdb branch 2 times, most recently from f9f9bfa to 23b5a21 Compare May 16, 2019 13:32
@aherrmann-da aherrmann-da marked this pull request as ready for review May 16, 2019 13:40
@aherrmann-da aherrmann-da force-pushed the rules_haskell-pkgdb branch 6 times, most recently from 3eb7b07 to 04fbb9d Compare May 17, 2019 13:57
@aherrmann-da aherrmann-da changed the title [WIP] Update rules_haskell - global package db Update rules_haskell May 17, 2019
@aherrmann-da aherrmann-da requested a review from cocreature May 17, 2019 14:09
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

deduped = list.dedup_on(get_lib_name, ext_libs)

for lib in deduped:
- # This test is a hack. When a CC library has a Haskell library
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the fact that we now have patches to remove hacks in rules_haskell is a good or a bad thing 😄

@@ -1,5 +1,5 @@
diff --git a/haskell/private/actions/compile.bzl b/haskell/private/actions/compile.bzl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should try to upstream that patch. Just haven’t had the time so far sadly 😞

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to just apply the patch on rules_haskell. Sadly it breaks plugins, haddock, and doctests.

nix/ghc.nix Outdated
@@ -24,7 +24,6 @@ let

# We need newer versions that build with GHC 8.6
language-c = super.callPackage ./overrides/language-c-0.8.2.nix {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably also get rid of the language-c override if we don’t need c2hs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we need it for grpc related stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Nix override seems to be unused. I could only find references to the Hazel package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

aherrmann added 4 commits May 20, 2019 13:21
This is a left-over from when the package was patched.
- rules_haskell now handles the global package db within Bazel
    tweag/rules_haskell#859
- We no longer use the Nix provided c2hs. So, we drop it.
- Rename `ghcWithC2hs` to `ghcStatic` to clarify that that's where the
    static linking patches are applied.
- Extend package-db patches to align Nix store paths with the new $out.
    This works around a restriction in current rules_haskell, where
    the paths in the package config files must have the same prefix as
    the path to the package config files themselves.
- Don't exclude haskell libraries from extra-libraries entries.
@aherrmann-da aherrmann-da force-pushed the rules_haskell-pkgdb branch from 04fbb9d to 76ec3db Compare May 20, 2019 11:21
@aherrmann-da aherrmann-da merged commit a89cbb2 into master May 20, 2019
@aherrmann-da aherrmann-da deleted the rules_haskell-pkgdb branch May 20, 2019 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants