Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upBefore testing if libraries link, do a vanilla run to check if the compiler is misconfigured #4395
Comments
ezyang
added
Cabal: cmd/configure
attention: pr-welcome
labels
Mar 14, 2017
This comment has been minimized.
This comment has been minimized.
I thought we had it: https://github.com/haskell/cabal/blob/master/Cabal/Distribution/Simple/Utils.hs#L1333 |
This comment has been minimized.
This comment has been minimized.
Doesn't do you much good if you don't plumb it where necessary ;)
|
This comment has been minimized.
This comment has been minimized.
That's a backwards compat shim for Custom setups. I suppose we could deprecate it. |
ezyang
added
newcomer: 4-small-feature
and removed
newcomer: 4-small-feature
labels
Apr 27, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ezyang commentedMar 14, 2017
@angerman was reporting on IRC that Cabal couldn't find
iconv
, but everything seemed like it was in order. When he posted-v3
logs, the true error came to light:The failure of
clang
had nothing to do with linkingiconv
: rather, it was failing because ofclang: error: invalid linker name in argument '-fuse-ld=gold'
.The way to solve this problem is, before we test if any of the libraries fail the linker, FIRST check if we can build a vanilla C file at all. If we can't, that means that there's something wrong with the options: output the error message verbatim.
There's a few other lessons too:
Even after the failure, Cabal goes off and tries to compile the headers. This caused me to take more time to diagnose the problem, because the true "failure" was further up the scrollback. We should error more quickly.
The error message should suggest running at higher verbosity to see the error message the compiler output, or just unconditionally report the actual error that caused the problem. None of this cloak and dagger "I ran something but I'm not going to tell you what I did, neener-neener."
Also, can we finally get
keep-tmp-files
for Cabal? This thing where the temporary files disappear before I can look at them is really annoying.