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

Make friendlier error when libtinfo5 is missing #1535

Open
tanyabouman opened this issue Apr 12, 2021 · 0 comments
Open

Make friendlier error when libtinfo5 is missing #1535

tanyabouman opened this issue Apr 12, 2021 · 0 comments

Comments

@tanyabouman
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When missing the libtinfo5 package, the error is not that clear.

ERROR: Error fetching repository: Traceback (most recent call last):
	File "/root/.cache/bazel/_bazel_root/0d15a96fd12ed9dca003553c71536f42/external/rules_haskell/haskell/ghc_bindist.bzl", line 377, column 31, in _ghc_bindist_impl
		execute_or_fail_loudly(
	File "/root/.cache/bazel/_bazel_root/0d15a96fd12ed9dca003553c71536f42/external/rules_haskell/haskell/private/workspace_utils.bzl", line 27, column 13, in execute_or_fail_loudly
		fail("\n".join(["Command failed: " + " ".join(arguments), exec_result.stderr]))
Error in fail: Command failed: make install
/root/.cache/bazel/_bazel_root/0d15a96fd12ed9dca003553c71536f42/external/rules_haskell_ghc_linux_amd64/lib/bin/ghc-pkg: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
make[1]: *** [ghc.mk:991: install_packages] Error 127
make: *** [Makefile:51: install] Error 2
ERROR: /rules_haskell/examples/cat_hs/exec/cat_hs/BUILD.bazel:6:15: //cat_hs/exec/cat_hs:cat_hs depends on @rules_haskell_ghc_linux_amd64//:toolchain-impl in repository @rules_haskell_ghc_linux_amd64 which failed to fetch. no such package '@rules_haskell_ghc_linux_amd64//': Command failed: make install
/root/.cache/bazel/_bazel_root/0d15a96fd12ed9dca003553c71536f42/external/rules_haskell_ghc_linux_amd64/lib/bin/ghc-pkg: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
make[1]: *** [ghc.mk:991: install_packages] Error 127
make: *** [Makefile:51: install] Error 2

Reproduce with:

docker run --rm -it ubuntu:20.04 bash
# follow bazel instructions here https://docs.bazel.build/versions/master/install-ubuntu.html
apt update && apt install -y git
git clone https://github.com/tweag/rules_haskell
cd rules_haskell/examples
apt update && apt install -y build-essential libffi-dev libgmp-dev libtinfo-dev python python3
bazel build --verbose_failures //cat_hs/exec/cat_hs

The error is easily resolved by installing libtinfo5, as indicated in the list of dependencies.

apt update && apt install -y libtinfo5

Describe the solution you'd like
An error that clearly points to the missing library, and links to the other required dependencies, just in case those are missing too.

Describe alternatives you've considered
The current error is not that terrible, because it does mention libtinfo.so.5, and a quick internet search will probably find out that the problem is a missing package. However, that search also returns results about having the wrong version of libtinfo, which could be confusing.

Additional context
Inspired by #1416 and #1419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants