You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observe that compilation fails with the following error message
Starting local Bazel server and connecting to it...
INFO: Analyzed 6 targets (31 packages loaded, 1247 targets configured).
INFO: Found 6 targets...
ERROR: /Users/jkachmar/src/bazel-test/BUILD.bazel:21:1: HaskellLinkDynamicLibrary libHSexample-lib-ghc8.6.5.dylib failed (Exit 1) ghc_wrapper failed: error executing command bazel-out/host/bin/external/rules_haskell/haskell/ghc_wrapper bazel-out/darwin-fastbuild/bin/compile_flags_example_lib_HaskellLinkDynamicLibrary ... (remaining 1 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
ld: library not found for -liconv
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
`cc_wrapper-python' failed in phase `Linker'. (Exit code: 1)
Expected behavior
The project should compile without errors.
Environment
OS name + version: macOS 10.14.6 (Mojave)
Bazel version: 2.1.0
Version of the rules: 0.12
Additional context
It seems like @Profpatsch has run into something like this before (cf. #884 (comment)).
The text was updated successfully, but these errors were encountered:
Using the GHC bindist within a Nix shell is not supported. If you are using rules_haskell within a Nix shell then you should use the Nix provided CC and GHC toolchain as well. See also #718 for the same kind of issue on Linux. Is there any reason why you're not using a Nix provided GHC toolchain?
What seems to be happening is that Bazel's autoconfigured CC toolchain (which the reproduction is using) will pick up the clang instance provided by the Nix shell. That clang does not look for libraries like libiconv in standard system locations. So, linking against it will fail.
Describe the bug
rules_haskell
compilation fails when using a GHC bindist within a Nix shell on macOS.To Reproduce
nix-shell
bazel build //...
Expected behavior
The project should compile without errors.
Environment
Additional context
It seems like @Profpatsch has run into something like this before (cf. #884 (comment)).
The text was updated successfully, but these errors were encountered: