Skip to content

Add the cabal store ghc sub-directory to cabal path output #10165

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

Open
phadej opened this issue Jul 1, 2024 · 3 comments
Open

Add the cabal store ghc sub-directory to cabal path output #10165

phadej opened this issue Jul 1, 2024 · 3 comments

Comments

@phadej
Copy link
Collaborator

phadej commented Jul 1, 2024

% cabal-3.12.1.0 path                                            
compiler-flavour: ghc
compiler-id: ghc-9.2.8
compiler-path: /opt/ghcup/.ghcup/bin/ghc
cache-home: /home/phadej/.cache/cabal
remote-repo-cache: /cabal/packages
logs-dir: /cabal/logs
store-dir: /cabal/store
config-file: /cabal/config
installdir: /cabal/bin

However due #9326, this information is not enough to find the ghc specific store directory, which is /caba/store/ghc-9.8.2-6af5 for GHC-9.8.2 I have.

@phadej phadej changed the title Add the cabal store directory to cabal path output Add the cabal store ghc sub-directory to cabal path output Jul 1, 2024
lyokha added a commit to lyokha/nginx-haskell-module that referenced this issue Jul 31, 2024
Cabal plan does not contain GHC's Project Unit Id!
See also haskell/cabal#10165
@hellwolf
Copy link

hellwolf commented May 11, 2025

Found a one liner:

$ ghc --info | ghci -e 'readFile "/dev/stdin" >>= putStrLn . snd . (!! 0) . filter ((== "Project Unit Id"). fst) . (read :: String -> [(String, String)])'
ghc-9.10.1-0348

@fendor
Copy link
Collaborator

fendor commented May 11, 2025

Sounds like a great addition to the cabal path command.

@hellwolf
Copy link

Yea, I think it should be part of the path command.

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

No branches or pull requests

5 participants