-
Notifications
You must be signed in to change notification settings - Fork 81
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
Cannot run tests with bindist using shell.nix missing lib gmp #704
Comments
We don’t officially support bindist on NixOS, do you expect it to work inside of a nix-shell? |
I don't know what we could do here. If you're using Nix, don't use bindists and vice versa, and the error message as-is clearly states what is missing. Tempted to close this as wontfix. |
Clarification: I'm on Ubuntu:
I have libgmp installed globally. I actually have two versions, installed with this command:
The bindist can find the libgmp SO without issues: $ wget https://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-x86_64-deb8-linux.tar.xz
$ tar -xf ghc-8.6.2-x86_64-deb8-linux.tar.xz
$ ldd ghc-8.6.2/libraries/integer-gmp/dist-install/build/libHSinteger-gmp-1.0.2.0-ghc8.6.2.so
linux-vdso.so.1 (0x00007ffd2e2da000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f655da2b000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f655d7aa000)
libHSghc-prim-0.5.3-ghc8.6.2.so => not found
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f655d3b9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f655ddc9000) This suggests that bazel is sanitizing the environment or at least not passing |
Adding this line to the toolchain builder fixes the issue:
So the linker doesn't search (by default) the directory where libgmp is installed. Another way to fix the build is to create a symlink to the library in
Both solutions are really work arounds. Open questions:
|
We still don't have clear repro instructions in this ticket. Quoting myself above:
Furthermore, bindists are working in CI. So how do I reproduce this? Is the nix-shell necessary here to get the error, or do I get it even without the nix-shell? I need a sequence of steps. |
To answer the question above:
Most likely Nix's
|
Clarification: to reproduce the issue:
|
Can you confirm that the issue does not arise when not using a |
Yes I confirm. Turns out this was a misunderstanding on my side: I didn't understand that we didn't want to support the bindist when using the nix-shell. I'll close this and update the README. |
Ah - you already gave the answer to my question, a few minutes before I asked it. OK so the new description for the ticket could be this: "GHC bindists don't work inside a nix-shell". If so, then I move to close this issue, because this is an upstream problem, and because I would argue that you never need a bindist if you are inside a nix-shell. GHC bindists fail even without Bazel. |
When running the tests on a fresh Ubuntu 16.04 LTS VM, I experience the exact same problem, when not inside a nix-shell. Inside If I symlink the
@flokli mentioned that on the BuildKite issue, so we can assume it’s generally broken on Ubuntu. |
I tend to encounter this issue on opensuse when using the GHC bindist while
|
@Profpatsch if you're going to reopen an old issue, can we have a repro? Also, I've seen scant evidence so far that this issue is at all rules_haskell specific. |
So the issue arises because if |
wtf wtf wtf wtf That’s what toolchains should be for, isn’t it. We can’t just suddenly do different things if the user goes and installs a tool. But anyway, it’s not (just) that abberation. When removing nixpkgs from the environment, I still get a different error:
|
@Profpatsch The |
It's not. CC rules don't use that (yet, or maybe never, I don't know). They have a single external repo that contains symlink to the one compiler it's supposed to use for building C/C++ code. |
Filed an issue upstream: tweag/rules_nixpkgs#88. Closing this one, since there's nothing rules_haskell can do. |
Build fails when using the ghc bindist if libgmp is not installed on the system. Even adding it to the nix-shell does not help:
The link cannot find libgmp during build:
Passing
action_env
andtest_env
does not help:Specifying
--linkopt=-L/path/to/lib
fixes some builds:But not all, the
java_classpath
now fails with a different error:The text was updated successfully, but these errors were encountered: