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

Handle missing library in haskell_toolchain_library #882

Merged
merged 2 commits into from
May 21, 2019
Merged

Conversation

aherrmann
Copy link
Member

haskell_toolchain_library expects the incoming lists of static and dynamic libraries to pair up exactly. As detailed in #881 this is currently not the case. This PR does not resolve issue #881. However, it makes the code in question more robust by making sure that in case a library component is missing the right libraries are paired up. E.g. it will prevent libCffi.a to be paired up with libHSrts-ghc*.so.

@aherrmann aherrmann requested a review from mboes May 21, 2019 14:27
@mboes mboes merged commit 7a97d5c into master May 21, 2019
@mboes mboes deleted the toolchain-libs branch May 21, 2019 15:24
mboes added a commit that referenced this pull request May 22, 2019
With `haskell_cabal_library` (added in #882), we have the ability to
make one-shot calls to Cabal, assuming,

1. that the sdist for the Cabal package has been fetched and unpacked, and
2. that dependencies have been declared correctly.

Declaring these dependencies by hand for all packages on Hackage is
a fool's errand. This commit uses Stack to,

1. resolve package names to package versions using the given snapshot,
2. fetch the sdist and unpack it,
3. find out the dependency graph and generate a `BUILD` file encoding it.

Stack only outputs dependency information in GraphViz format. So have
to parse that.

This assumes Stack is in the `PATH` (hence build is non-hermetic). But
it's pretty unreasonable to build our own Stack inside a workspace
rule (Bazel's build engine doesn't work there). The best we can do is
download prebuilt binaries, which we can do in the future (after
figuring out how to seamlessly work on NixOS).

Closes #874.
@mboes mboes mentioned this pull request May 22, 2019
mboes added a commit that referenced this pull request May 22, 2019
With `haskell_cabal_library` (added in #882), we have the ability to
make one-shot calls to Cabal, assuming,

1. that the sdist for the Cabal package has been fetched and unpacked, and
2. that dependencies have been declared correctly.

Declaring these dependencies by hand for all packages on Hackage is
a fool's errand. This commit uses Stack to,

1. resolve package names to package versions using the given snapshot,
2. fetch the sdist and unpack it,
3. find out the dependency graph and generate a `BUILD` file encoding it.

Stack only outputs dependency information in GraphViz format. So have
to parse that.

This assumes Stack is in the `PATH` (hence build is non-hermetic). But
it's pretty unreasonable to build our own Stack inside a workspace
rule (Bazel's build engine doesn't work there). The best we can do is
download prebuilt binaries, which we can do in the future (after
figuring out how to seamlessly work on NixOS).

Closes #874.
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.

2 participants