Skip to content

Conversation

@sgillespie
Copy link
Collaborator

@sgillespie sgillespie commented Oct 28, 2025

This addds the GHC Project Unit ID store path to the cabal path output as "project-unit-id". The GHC "Project Unit ID" store path has been used in cabal-install since 3.12.1.0.

Example output:

compiler-flavour: ghc
compiler-id: ghc-9.10.1
compiler-path: /nix/store/367sp8xqvk70a050fm6f8a93lig0gx41-ghc-9.10.1/bin/ghc
compiler-store-path: /home/sgillespie/.local/state/cabal/store/ghc-9.10.1-be9a
cache-home: /home/sgillespie/.cache/cabal
remote-repo-cache: /home/sgillespie/.cache/cabal/packages
logs-dir: /home/sgillespie/.cache/cabal/logs
store-dir: /home/sgillespie/.local/state/cabal/store
config-file: /home/sgillespie/.config/cabal/config
installdir: /home/sgillespie/.local/bin

Note that the new value is "project-unit-id", although I'm not 100% this makes sense. Let me know if there's a better name.

EDIT: Changed name to "compiler-store-path"


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@sgillespie sgillespie changed the title Add GHC Unit ID store to cabal path output WIP: Add GHC Unit ID store to cabal path output Oct 28, 2025
@sgillespie sgillespie force-pushed the feature/cmd-path-ghc-store branch from f077536 to 248e488 Compare October 28, 2025 14:11
sgillespie added a commit to sgillespie/cabal that referenced this pull request Oct 29, 2025
This change modifies the output of `cabal path`, and therefore requires
a changelog entry.
sgillespie added a commit to sgillespie/cabal that referenced this pull request Oct 29, 2025
This change modifies the output of `cabal path`, and therefore requires
a changelog entry.
@sgillespie sgillespie force-pushed the feature/cmd-path-ghc-store branch from 54ebf30 to 1703168 Compare October 29, 2025 21:05
sgillespie added a commit to sgillespie/cabal that referenced this pull request Oct 29, 2025
This change modifies the output of `cabal path`, and therefore requires
a changelog entry.
@sgillespie sgillespie force-pushed the feature/cmd-path-ghc-store branch from 1703168 to eae337e Compare October 29, 2025 21:08
@fendor
Copy link
Collaborator

fendor commented Oct 29, 2025

The value of project-unit-id looks to me like the store dir that is actually used for this particular project. So perhaps, project-store-dir or compiler-store-dir is more fitting?

sgillespie added a commit to sgillespie/cabal that referenced this pull request Oct 29, 2025
This change modifies the output of `cabal path`, and therefore requires
a changelog entry.
@sgillespie sgillespie force-pushed the feature/cmd-path-ghc-store branch from eae337e to bb796cb Compare October 29, 2025 21:10
@fendor
Copy link
Collaborator

fendor commented Oct 30, 2025

Also, perhaps we want to print the compiler paired with its abi hash as well?

@sgillespie
Copy link
Collaborator Author

sgillespie commented Oct 30, 2025

Also, perhaps we want to print the compiler paired with its abi hash as well?

Say, something like this?

compiler-abi-hash: ghc-9.10.1-b7a5c6aad95a5a3e4903ce2272ab85e0

The GHC "Project Unit ID" store path has been used in cabal-install
since 3.12.1.0.

Resolves: haskell#10165
This change modifies the output of `cabal path`, and therefore requires
a changelog entry.
Update `compiler-project-unit-id` to `compiler-store-path` in the `cabal
path` output, as it is much more clear.
@sgillespie sgillespie force-pushed the feature/cmd-path-ghc-store branch from d83bb90 to e8a1785 Compare October 30, 2025 13:33
@sgillespie sgillespie changed the title WIP: Add GHC Unit ID store to cabal path output Add GHC Unit ID store to cabal path output Oct 30, 2025
@sgillespie sgillespie marked this pull request as ready for review October 30, 2025 13:34
@fendor
Copy link
Collaborator

fendor commented Oct 30, 2025

exactly! Then the field compiler-store-path would be strictly speaking redundant, but that's fine, imo.

@sgillespie
Copy link
Collaborator Author

exactly! Then the field compiler-store-path would be strictly speaking redundant, but that's fine, imo.

Wait, am I doing abi-hash, as in ghc --abi-hash, or the abi-tag, as in Distribution.Compiler.AbiTag? If it is the hash, I can't seem to find an straightforward way to get that, what should my strategy be?

@fendor
Copy link
Collaborator

fendor commented Nov 4, 2025

Ah, slight misunderstanding! I think adding the output of ghc --abi-hash is not necessary, as we provide the ghc executable path, and it is only one quick invocation of ghc away to get ghc --abi-hash.

Assuming /home/sgillespie/.local/state/cabal/store/ghc-9.10.1-be9a, I was referring to be9a, but if that's tricky right now to get out, I'd be fine with current change.

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

Successfully merging this pull request may close these issues.

2 participants