-
Notifications
You must be signed in to change notification settings - Fork 848
GHC 8.8.4 fails sanity checks during install due to Cabal-3.0.1.0 being hidden #5412
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
Trying things out a bit, found that the presence of |
Luckily, it doesn't break if |
@hseg |
You misunderstand me. Sure, `~/.ghc` isn't _controlled_ by stack. But it still influences stack's operation where it shouldn't. Unless stack's portability guarantees are only in the absence of such configuration? Because it was my understanding that stack ignores the local configuration, preferring to eg install its own ghc whose settings it manages.
On March 18, 2021 4:08:48 PM GMT+02:00, Kirill Zaborsky ***@***.***> wrote:
***@***.*** `~/.ghc` doesn't look like a directory controlled by Stack and for example I don't have any files like that locally. Maybe your question should go to a tracker of some other tool? Maybe Cabal or ghcup?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#5412 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Sorry, I'm misinterpreted you. And this is a feature of GHC - https://downloads.haskell.org/ghc/8.8.4/docs/html/users_guide/packages.html#package-environments Line 322 in 60fee51
|
Unfortunately the environment in which I encountered this issue is now gone (I've switched back to Gentoo), but looking in the backup of my home folder, this is the contents of
I didn't write that file myself and am not entirely sure how it got there. There seem to be a number of bug reports floating around about issues caused by it (cabal bug #5559 appears to be the most central one). The only other file in I can't find any obvious way that |
I ran into this error. The file
Deleting the file (or the whole folder But I would agree with @qrilka that this is a bug in stack: |
This has bitten me several times lately. It turns up when using HLS in VS Code because it calls Yes, deleting Another workaround is to add a I also agree with @qrilka that the preferred solution is for |
If I follow the above correctly, the problem is that when Stack does its sanity check on the GHC it has fetched: -- | Perform a basic sanity check of GHC
sanityCheck :: (HasProcessContext env, HasLogFunc env)
=> Path Abs File -> RIO env ()
sanityCheck ghc = withSystemTempDir "stack-sanity-check" $ \dir -> do
let fp = toFilePath $ dir </> relFileMainHs
liftIO $ S.writeFile fp $ T.encodeUtf8 $ T.pack $ unlines
[ "import Distribution.Simple" -- ensure Cabal library is present
, "main = putStrLn \"Hello World\""
]
logDebug $ "Performing a sanity check on: " <> fromString (toFilePath ghc)
eres <- withWorkingDir (toFilePath dir) $ proc (toFilePath ghc)
[ fp
, "-no-user-package-db"
] $ try . readProcess_
case eres of
Left e -> prettyThrowIO $ GHCSanityCheckCompileFailed e ghc
Right _ -> pure () -- TODO check that the output of running the command is
-- correct it does not pass the GHC flag If |
I think pull request #6137 will fix this, but I would appreciate it if somebody who has experienced the problem could test that it is a cure. |
I tried your pull request, and it worked. See the PR for more details. Thanks for the fix! |
Fix #5412 sanityCheck passes GHC flag -hide-all-packages
Uh oh!
There was an error while loading. Please reload this page.
General summary/comments
The LTS resolvers for GHC 8.8.4 (currently 16.12–16.17) fail to install GHC 8.8.4 in my environment because GHC complains about Cabal 3.0.1.0 being hidden when trying to build the sanity checks. This is the output I get when running
stack setup
in a freshly-created Stack project:This is in an up-to-date Arch Linux environment. Neither the nightly resolver nor the latest LTS for 8.8.3 (16.11) turn up this issue when I run
stack setup
.Cabal-3.0.1.0
is present in~/.stack/programs/x86_64-linux/ghc-tinfo6-8.8.4/lib/ghc-8.8.4
.Steps to reproduce
stack new
.cd
into the project directory.stack setup
.Expected
I expected to see
Installed GHC
followed by thestack will use a sandboxed GHC it installed
etc. message.Actual
See here for output from
stack setup --verbose
.Stack version
Method of installation
get.haskellstack.org
to~/.local/bin
The text was updated successfully, but these errors were encountered: