cabal
cabal copied to clipboard
Add the cabal store ghc sub-directory to `cabal path` output
% 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 https://github.com/haskell/cabal/pull/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.
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
Sounds like a great addition to the cabal path command.
Yea, I think it should be part of the path command.