-
Notifications
You must be signed in to change notification settings - Fork 710
Missing package database if only installing boot packages #9310
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
I can reproduce and confirm that cabal should not write an invalid environment file. Mind if I ask: what is the use case of installing |
HLS (outside a cabal or stack project) doesn't pick up on |
It seems to work for me. But I had to admit I had to do some troubleshooting to get it to work. I had a stray .cabal file in a directory above which was confusing everything. I usually do
Anyway, thank you for reporting this bug. |
And the PR claims "Also resolves #8825 by checking that filepaths of specificpackagedbs exist before adding them to the env file." so it should prevent the very issue that package ghc is added but not in the db, unless I'm mixing up the dbs in question. Are these the same paths and dbs as in this here ticket? |
So, you can run -- Test.hs
import GHC.Tc.Plugin
main = putStrLn "Hello, World!" After a few seconds, I'm getting an error like this:
I'll try
|
I can reproduce with this script
|
Did we have test? As a mathematician once told me: untested code is wrong with probability 1-epsilon |
Yeah, no automated tests, though a couple of people manually tested it resolves their particular issues. This may just be yet another slightly different iteration of the problem needing a slightly different tweak. |
@noughtmare: good catch! So it's backported to 3.10 branch, but will only we released in 3.10.2.0. Does 3.10.2.0 fix it for you? An pre-release can be obtained with "ghcup install cabal -u 'https://downloads.haskell.org/~cabal/cabal-install-3.10.2.0/cabal-install-3.10.2.0-x86_64-linux-alpine.tar.xz' 3.10.2.0-a1". |
@Mikolaj yes that version works. Although I noticed it reports itself as being 3.8.1.0 and it shows warnings like this:
Edit: Oh, I'm using MacOS and that version doesn't seem to work on my platform so it selects 3.8.1.0 as a fallback. And I'm using NixOS on my other PC, so I can't test it there either. Edit 2: I've now installed cabal-install-3.10.2.0-x86_64-darwin.tar.xz and that does indeed also work. |
Apologies, that was Linux-centric of me. But I'm confused: did you say above that 3.8.1.0 worked in this attempt? Is the bug non-deterministic? |
3.8.1.0 indeed does seem to work. I think the bug was introduced in 3.10. |
Oh, I see, thank you. Works in 3.8.*, fails in 3.10.1.0, works again in 3.10.2.0. |
Describe the bug
I recently installed GHC 9.6.3 and now I ran the command
cabal install --lib --package-env . base ghc
. This creates a environment file like this:However, I did not actually have a package.db for ghc-9.6.3 yet and this command does not create it. So, now when I try to run GHC using this environment file I get the error:
I would expect that this command either would actually ensure that the package db is created (or alternatively leave out that package-db line from the environment file).
To work around this issue I can just run a command that does actually build a package, e.g.:
cabal repl -b tasty
.System information
cabal
3.10.1.0,ghc
9.6.3The text was updated successfully, but these errors were encountered: