Skip to content
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

doctest-0.23 seems to look for ghc in hardwired path #459

Open
andreasabel opened this issue Oct 30, 2024 · 1 comment
Open

doctest-0.23 seems to look for ghc in hardwired path #459

andreasabel opened this issue Oct 30, 2024 · 1 comment

Comments

@andreasabel
Copy link
Collaborator

Latest doctest seems to want to access /usr/local/bin/ghc-VERSION even though I reinstalled ghc with ghcup:

$ ghc -V
The Glorious Glasgow Haskell Compilation System, version 9.10.1

$ which ghc
/Users/abel/.ghcup/bin/ghc

$ cabal install doctest --ignore-project
Resolving dependencies...
Copying 'doctest' to '/Users/abel/.cabal/bin/doctest'

$ doctest -V
doctest: /usr/local/bin/ghc-9.10.1: getPermissions:getFileStatus: does not exist (No such file or directory)
HasCallStack backtrace:
  collectBacktraces, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:92:13 in ghc-internal:GHC.Internal.Exception
  toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/IO.hs:260:11 in ghc-internal:GHC.Internal.IO
  throwIO, called at libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs:315:19 in ghc-internal:GHC.Internal.IO.Exception
  ioException, called at libraries/ghc-internal/src/GHC/Internal/IO/Exception.hs:319:20 in ghc-internal:GHC.Internal.IO.Exception

The problem seems that doctest is relying on the ghc-paths to provide the path to GHC.
Cabal does not seem provision for the case that one removes GHC and installs it in another place; i.e. it is happy to reuse the .cabal/store/ghc-xyz database for a compiler that is in a different location.
In combination with a ghc-paths library that fixes static paths at its own compile time, this crashes doctest.

Removing the build products for ghc-paths and doctest from the cabal store fixes the problem.

@sol
Copy link
Owner

sol commented Nov 4, 2024

I'm not sure if this issue is "actionable". This is how things have been working for 15 years. It's the same approach that haddock uses. I'm not exactly sure what doctest should do about it.

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants