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

Backport #10699: Move cabal path to project configuration group #10748

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 62 additions & 62 deletions doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,68 +285,6 @@ cabal preferences. It is very useful when you are e.g. first configuring
Note how ``--augment`` syntax follows ``cabal user-config diff``
output.

cabal path
^^^^^^^^^^

``cabal path`` allows to query for paths used by ``cabal``.
For example, it allows to query for the directories of the cache, store,
installed binaries, and so on.

::

$ whoami
alice

$ cabal path
compiler-flavour: ghc
compiler-id: ghc-9.8.2
compiler-path: /home/alice/.ghcup/bin/ghc
cache-home: /home/alice/.cabal
remote-repo-cache: /home/alice/.cabal/packages
logs-dir: /home/alice/.cabal/logs
store-dir: /home/alice/.cabal/store
config-file: /home/alice/.cabal/config
installdir: /home/alice/.cabal/bin

Or using the json output:

::

$ cabal path --output-format=json | jq

.. code-block:: json

{
"cabal-version": "3.13.0.0",
"compiler": {
"flavour": "ghc",
"id": "ghc-9.8.2",
"path": "/home/alice/.ghcup/bin/ghc"
},
"cache-home": "/home/alice/.cabal",
"remote-repo-cache": "/home/alice/.cabal/packages",
"logs-dir": "/home/alice/.cabal/logs",
"store-dir": "/home/alice/.cabal/store",
"config-file": "/home/alice/.cabal/config",
"installdir": "/home/alice/.cabal/bin"
}

If ``cabal path`` is passed a single option naming a path, then that
path will be printed *without* any label:

::

$ cabal path --installdir
/home/alice/.cabal/bin

While this interface is intended to be used for scripting, it is an experimental command.
Scripting example:

::

$ ls $(cabal path --installdir)
...

.. _command-group-database:

Package database commands
Expand Down Expand Up @@ -734,6 +672,68 @@ Examples:
be used without arguments, in that case major version bumps are ignored for
all packages.

cabal path
^^^^^^^^^^

``cabal path`` allows to query for paths used by ``cabal``.
For example, it allows to query for the directories of the cache, store,
installed binaries, and so on.

::

$ whoami
alice

$ cabal path
compiler-flavour: ghc
compiler-id: ghc-9.8.2
compiler-path: /home/alice/.ghcup/bin/ghc
cache-home: /home/alice/.cabal
remote-repo-cache: /home/alice/.cabal/packages
logs-dir: /home/alice/.cabal/logs
store-dir: /home/alice/.cabal/store
config-file: /home/alice/.cabal/config
installdir: /home/alice/.cabal/bin

Or using the json output:

::

$ cabal path --output-format=json | jq

.. code-block:: json

{
"cabal-version": "3.13.0.0",
"compiler": {
"flavour": "ghc",
"id": "ghc-9.8.2",
"path": "/home/alice/.ghcup/bin/ghc"
},
"cache-home": "/home/alice/.cabal",
"remote-repo-cache": "/home/alice/.cabal/packages",
"logs-dir": "/home/alice/.cabal/logs",
"store-dir": "/home/alice/.cabal/store",
"config-file": "/home/alice/.cabal/config",
"installdir": "/home/alice/.cabal/bin"
}

If ``cabal path`` is passed a single option naming a path, then that
path will be printed *without* any label:

::

$ cabal path --installdir
/home/alice/.cabal/bin

While this interface is intended to be used for scripting, it is an experimental command.
Scripting example:

::

$ ls $(cabal path --installdir)
...

.. _command-group-build:

Project building and installing
Expand Down
Loading