-
Notifications
You must be signed in to change notification settings - Fork 701
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
ghc-pkg list is not finding packages I install with cabal 3.0 and ghc 8.8.1 #6262
Comments
I think this is expected behaviour, at least from the cabal side of things. Version 3.0.0.0 switched to using v2-build by default so installed libraries are now registered into the "default" package environment file in AFAICS ghc-pkg simply doesn't have support for listing package environments which sort of kind of makes sense but also breaks this workflow. I think this should be reported as a GHC bug but I'm not sure it would even be a good idea to add pkg-env support to ghc-pkg. |
cc @hvr |
Thanks Daniel
I thought it might be a ghc issue but since nobody else was complaining I
assumed I must have done something wrong. I can file a ghc bug if people
want.
Cheers
George
…On Mon, Oct 7, 2019 at 2:58 AM Daniel Gröber (dxld) < ***@***.***> wrote:
cc @hvr <https://github.com/hvr>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6262?email_source=notifications&email_token=ABQIJ62KAVHHP7PVFRQHTB3QNLFXLA5CNFSM4I3MHL4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAPDLEY#issuecomment-538850707>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQIJ6ZESTAS3OMI6YBTN6LQNLFXLANCNFSM4I3MHL4A>
.
|
I filed a ghc bug: https://gitlab.haskell.org/ghc/ghc/issues/17341
This feels to me like a step backwards from just typing "ghc-pkg list" as the user doesn't have to know anything about package dbs or their location. Not sure how to go about improving the current state but thanks for your help. |
So I think there's two things. First a feature request for The thing in scope for this tracker is more documentation about how v2-build works in cabal 3.0, which is covered by this ticket among others: #6104 So going to close this out. |
see https://gitlab.haskell.org/ghc/ghc/issues/17341 for the feature request that ghc-pkg become env file aware. |
I worked around this for now by saying: EDIT: It seems to me that the problem is simply that there isn't a wildcard option to expose all visible packages in the database. With this, ghc-pkg wouldn't need to be environment-aware, as the default environment could just use the wildcard. |
I strongly feel like this issue should not have been closed, or at least document that this is broken. |
This is not a cabal issue. |
I just re-read @DanielG 's comment, saying that cabal adds the newly-installed library to the default environment, so I did some experiments and found that this is only partially true. This may be the root of the problem. If I say cabal install xxx --lib, where xxx is a library package, then it is indeed added to the default environment. However, if I just say cabal install xxx, as is habitual, then it warns: The warning message feels odd to me, as I didn't ask Cabal to install executables, I just asked it for xxx. I'd expect it to realise that the package contains only libraries and behave accordingly. So this issue feels to me like a bug, inasmuch as the behaviour I'm seeing surprises me. |
That behavior has nothing to do with this ticket. That's the behavior of install under 3.0 semantics. Further, the warning seems like it explains this behavior pretty clearly. |
@BardurArantsson I agree the Do we have a tracking issue for revisiting the v2-install semantics yet? |
Hey! I am having a similar issue, I download succesfully any package with cabal install and they are stored in .cabal/store/ghc but when I import them on ghci it gives the error Module not found. |
I just worked around it for now by using |
Hey dstibbe, thank you very much. You are my savior, I was so desperate that I was ready to format the whole hardisk. Thanks :) |
And Haskell is not widely used because? |
@1chb: would you like to elaborate constructively? Ideally, perhaps you'd also like to contribute? |
The comment is indeed snarky, but it highlights the fact that Haskell tooling offers a sub-optimal experience for newcomers. The toolchain is both opaque and fragile. Furthermore, when hunting down a bug like the one in this thread, it is frustrating to be met with variations of "Not our problem" at every turn. Just think about how this looks. |
@cobordism: I'm afraid finger-pointing (to other issues on the tracker, to other tools, to direct and direct causes, etc.) is an unavoidable part of the development process. I'm not claiming cabal contributors are perfect or the process is perfect or the toolchain is perfect, but I won't accept discouraging contributors just because the world is not perfect and somebody likes to express his understandable disappointment in passive-aggressive way towards (mostly) innocent bystanders or, worse, people equally disappointed, but trying to actually improve the situation. At the same time, I'm absolutely open to constructive criticism. If you have ideas how to improve the |
I'd also add that we do have a solution for the original problem (listing packaes added to an env) on our side: |
That is fair. 1chb's comment was very unhelpful. Personally, I am not a coder and I only code very rarely. When I do I like to play around with anything from Python to Lean. However I stopped using Haskell for several of my (admittedly tiny) coding problems after realising that every time I spent the better part of a day just getting the tools to work again. Every. Single. Time. If I might make one suggestion it would be the following: PS just saw your latest comment. Thanks for those links. |
@cobordism: I hear you. Thank you for sharing your (sad) user story and the bit about ending issues in a clear statement is a directly useful feedback. I hope next time you'd find Haskell tooling stable enough for casual use (I'm afraid the v1 to v2 transition was quite extreme in this regard and it's not entirely finished yet). Repeating @fgaz, because it got buried again:
|
Sorry, I was struggling with a similar package problem myself. Some packages were hidden, I could use them by explicitly specify -package flags to ghc (without that flags ghc was confused and suggested I should use :set ... as if I was using ghci). Also I couldn't see my hidden packages at all (not within parenthesis or in blue) when I did ghc-pkg list. Although, not as helpful, but I don't think my comment was more snarky than cabal's warning about missing --lib. As I understand it, that part worked better in earlier versions. My hidden packages didn't become visible until I removed all my packages in ~/.cabal and ~/.ghc and reinstalled ghc and the packages. So, maybe a bad state on my folder. |
@1chb: I sympathize. Indeed, this workflow (mixing cabal and ghc-pkg and generally installing packages globally instead of per-project) worked better previously. Citing links to places where we work on these precise issues, in case you'd like to help/follow/cheer:
|
As the original filer of this bug here is my summary of the current state of this issue which has moved from cabal to ghc which seems to be overlooked here.
|
@fgaz in what versions of ghc/Cabal do we have the solution
|
Hi @GeorgeCo, As mentioned on #6481,
|
Currently there is s no way to list packages installed by `cabal install --lib` Related: haskell/cabal#6262
Describe the bug
ghc-pkg list is not finding packages I install with cabal 3.0 and ghc 8.8.1
To Reproduce
ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.1
cabal --version
cabal-install version 3.0.0.0
bash-3.2$ cabal install QuickCheck
Resolving dependencies...
Up to date
Warning: You asked to install executables, but there are no executables in
target: QuickCheck. Perhaps you want to use --lib to install libraries
instead.
bash-3.2$ cabal install --lib QuickCheck
Resolving dependencies...
Up to date
bash-3.2$ ghc-pkg list|fgrep -i Quick
Expected behavior
I expect ghc-pkg list to show QuickCheck
System informataion
macOS 10.14.6
cabal
,ghc
versionscabal 3.0
ghc 8.8.1
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: