-
Notifications
You must be signed in to change notification settings - Fork 711
Dependency on installed public sublibrary without --dependency flag #7270
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
Comments
It's sad that reproducing this needs messing with global-db. Whatever this is, it does look like a bug. Compare to running
So |
By the way that was on cabal 3.2, I updated the OP with the behavior of @grayjay's solver patch |
Yeah. That --package-db flag should really be implemented (#5773), so that it's easier to provide prebuilt packages to cabal from many sources |
@gbaz I think this is only a bug in Cabal's solver, not cabal-install's, since it can be reproduced with the Setup.hs interface too edit: nevermind, i even wrote it in the op:
|
I found that one reason for the issue in cabal-install is that multilibs aren't fully supported by the solver. I think that that part of the issue is covered by #6039, so I commented there and removed the solver label from this issue. |
After yesterday's discussion with @grayjay, I investigated this further and found that the information that Cabal needs is all there: the So I dug into the code and found a subtle misuse of
|
Same for "visibility is experimental feature" With haskell#7270 fixed, it's time to allow hackage uploads Closes haskell#6801
Same for "visibility is experimental feature" With haskell#7270 fixed, it's time to allow hackage uploads. PWTExperimental is not used anymore, but for now I'm keeping it in case we add other experimental features in the future, so we don't keep removing and adding it (pushing CPP on users). Since it isn't used though there is no way to run cabal-testsuite/PackageTests/DuplicateExperimental/cabal.project so I'm just removing that test. Closes haskell#6801
Same for "visibility is experimental feature" With haskell#7270 fixed, it's time to allow hackage uploads. PWTExperimental is not used anymore, but for now I'm keeping it in case we add other experimental features in the future, so we don't keep removing and adding it (pushing CPP on users). Since it isn't used though there is no way to run cabal-testsuite/PackageTests/DuplicateExperimental so I'm just removing that test. Closes haskell#6801
When Cabal is passed --exact-configuration, it knows from --dependency flags the ids of all dependencies, including sublibraries. When this flag does not exists though, Cabal tries to locate them by looking them up in the package databases. lookupDependency was used for this, but it only looks up main (unnamed) libraries (LMainLibName), so Cabal was failing to locate installed public sublibraries. Using lookupInternalDependency and passing the library name fixes this. Fixes haskell#7270
Same for "visibility is experimental feature" With haskell#7270 fixed, it's time to allow hackage uploads. PWTExperimental is not used anymore, but for now I'm keeping it in case we add other experimental features in the future, so we don't keep removing and adding it (pushing CPP on users). Since it isn't used though there is no way to run cabal-testsuite/PackageTests/DuplicateExperimental so I'm just removing that test. Closes haskell#6801
Uh oh!
There was an error while loading. Please reload this page.
follow-up from #5660 (comment)
Depending on a globally installed public sublibrary is problematic unless
--dependency=pkgname:sublibname=installed-id
is specified.The bug (?) does not get triggered when that flag is used, for example:
Here are two occasions in which it can manifest (
b
depends ona:foo
):In nix, which I think does not use --dependency and instead relies on Cabal's basic solver, I get this error:
build log
in cabal-install: when depending on a globally installed package (for which the .cabal is not available)
build log
It's the same error!
Unfortunately due to the failure it isn't possible to extract the plan.json, but by looking at the output it would seem that either cabal-install or Cabal decided to depend on the main
a
library (7i1EAAn7OKY8zea1XCf99I
is the id of the main library)In fact, the same error happens when manually invoking Setup.hs configure without the --dependency flag or with an invalid one (either by changing a:foo to a, or by changing the ipid):
The above was on cabal 3.2. On master:
So even the solver tries to use the main library
Questions:
The text was updated successfully, but these errors were encountered: