-
Notifications
You must be signed in to change notification settings - Fork 703
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
package-tests LBI reading (still) doesn't work #3694
Comments
IMO this is the only proposal that'll keep us sane, and we want to do this anyway for #3667. |
What about reading LBI through a separate process linked against the right Cabal version? |
Yes that would work. The problem is making sure it links against the right Cabal. |
So I guess I should keep my suggestion to #2395 and refrain from derailing; someday this problem should be solved as a side effect of #2395, but we're not there yet. |
If I understand correctly, the way cabal-helper decides what version of Cabal to build against is it attempts to parse the top of the LocalBuildInfo to get out a version, which it then compiles. How does it know where to find the Cabal library? It has a pile of heuristics This strategy is annoying and I'd prefer not to use it. There is a single obviously correct version of Cabal to use (the one you used to build the package) and we should figure out how to get that information to the right place. |
I guess you just made an excellent argument for supporting this properly in cabal 😄 |
Fixed now when I separated out cabal-testsuite (#4054) |
@phadej and I had a discussion about this on IRC and I thought I should record the problem for posterity.
When we run the
package-tests
test suite (and some other test suites), we need to call GHC to build some Haskell files against the Cabal library which we are currently testing against. In particular, we need to know what package databases to use; depending on whether or not sandboxes, or new-build, or Stack are used, these databases will vary. The canonical location that this information is stored is in theLocalBuildInfo
that the bootstrapping Cabal (the Cabal that builds Cabal) writes out.Now, here's the problem:
package-tests
is linked against the NEW Cabal, not the bootstrapping Cabal. Which means there is no reason that the new Cabal should be able to read the bootstrapped LocalBuildInfo. And indeed, in most cases it does not (case in point, Travis's invocation of package-tests fails to read the LBI, and so it just "reconfigures" to try to come up with the parameters necessary.)How can we fix this? There are a few ways but none of them seem to be convenient:
build-depends
syntax)The text was updated successfully, but these errors were encountered: