Repository navigation
Prevent dependency on private library - #5848
Conversation
|
Oops, of course on ghc <8.8 all libraries are private 🤦♂️ |
af482b4 to
6d5ab50
Compare
|
Hmm, this probably requires to add |
2d0bfac to
86daec5
Compare
|
This is now complete and reviewable (Sorry for the mass ping) |
|
@hvr why
? |
|
Concerns about the narrow ghc compatibility. As it is, this patch only allows multilibs on GHC<8.8 and doesn't provide an override. If it did (for example when using Also this makes cabal-install fail after build plan construction, which is not pleasant, but the only way to solve that is to make the solver sublibrary-aware. |
|
This has But in fact, i'm leaning towards disabling parsing of This is because I simply don't understand all the implications of the choices, and want to error on the safe side. |
|
I'm fine with postponing it until 3.2. |
|
I think we can, and in fact should merge this, even if we end up disabling Now, should we, in another pr, disable it? well...
TL;DR: +1 for merging, -1 for disabling multilibs, I'm for adding a new flag to allow future |
|
OK, I'll try to review this PR this week. Sorry for being slow. |
86daec5 to
fcbe835
Compare
|
np Added a negative package test |
please do! :-) |
|
The test is failing for ghc <=8.0.* Somehow for those versions sublibraries always appear as public. I'm investigating, but I don't see any clues in the ghc changelog edit: 8.2 included Cabal 2.0 (the first version with internal libraries and backpack), so it may be that. |
ghc-pkg<8.8 cannot read the visibility field, so all libraries were reported as private, even the main (unnamed) one. This commit forces the visibility of main libraries to be "public". This commit can be reverted once we stop supporting GHC<8.8, at the condition that we keep marking main libraries as public when registering them.
Related to the previous two commits (preventing dependency on private libraries and marking main libraries as public)
f88a8ad to
88ecdd7
Compare
|
OK, this should fix the older ghcs. I also added the Ping @23Skidoo |
This is intended to be used by tools like cabal-install so they can add multilibs-compatibility even to older ghcs
88ecdd7 to
3e31042
Compare
|
The travis failures are unrelated to this (I did not even modify ResponseFiles.hs). @23Skidoo can we merge? |
| (\v flags -> flags { configUseResponseFiles = v }) | ||
| (boolOpt' ([], ["disable-response-files"]) ([], [])) | ||
|
|
||
| ,option "" ["allow-depending-on-private-libs"] |
There was a problem hiding this comment.
This should be added to filterConfigureFlags as well, though since we don't set it anywhere, it's not a blocker for merging.
|
Merged, thanks! |
This will make Cabal error out when depending on a private library.
It does not give detailed info on which sublibrary is the culprit because that would require changing the
dependencySatisfiableandfinalizePDreturn types, and that touches A LOT of the codebase. It can be done later./cc @ezyang @phadej
TODO:
Closes #5806