Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
ed25bb12
Commit
ed25bb12
authored
3 years ago
by
Phil de Joux
Browse files
Options
Downloads
Patches
Plain Diff
Add a doc section on cabal list-bin.
parent
dea70de5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/cabal-commands.rst
+94
-2
94 additions, 2 deletions
doc/cabal-commands.rst
with
94 additions
and
2 deletions
doc/cabal-commands.rst
+
94
−
2
View file @
ed25bb12
cabal-install Commands
======================
We now give an in-depth description of all the commands, first describing the
arguments and flags that are common to some or all of them.
``cabal help`` groups commands into global, package, new-style project and
legacy sections. We talk in detail about all of the new-style project commands,
``help`` and ``list-bin`` but there are other commands.
::
$ cabal help
Command line interface to the Haskell Cabal infrastructure.
See http://www.haskell.org/cabal/ for more information.
Usage: cabal [GLOBAL FLAGS] [COMMAND [FLAGS]]
Commands:
[global]
help Help about commands.
[package]
list-bin list path to a single executable.
[new-style projects (forwards-compatible aliases)]
v2-build Compile targets within the project.
v2-configure Add extra project configuration
v2-repl Open an interactive session for the given component.
v2-run Run an executable.
v2-test Run test-suites
v2-bench Run benchmarks
v2-freeze Freeze dependencies.
v2-haddock Build Haddock documentation
v2-exec Give a command access to the store.
v2-update Updates list of known packages.
v2-install Install packages.
v2-clean Clean the package store and remove temporary files.
v2-sdist Generate a source distribution file (.tar.gz).
[legacy command aliases]
No legacy commands are described.
Common Arguments and Flags
--------------------------
Arguments and flags common to some or all commands are:
.. option:: --default-user-config=file
...
...
@@ -142,6 +182,58 @@ arguments and flags that are common to some or all of them.
Already generated `build-info.json` files will be removed since they would be stale otherwise.
cabal list-bin
--------------
``cabal list-bin`` will either; (a) display the path for a single exe or (b)
complain that the target doesn't resolve to a single binary. It won't list
multiple binary paths but knows which build products a package has.
::
$ cabal list-bin cabal-install
cabal: The list-bin command is for finding a single binary at once. The target
'cabal-install' refers to the package cabal-install-3.7.0.0 which includes the
executable 'cabal', the test suite 'unit-tests', the test suite
'memory-usage-tests', the test suite 'long-tests' and the test suite
'integration-tests2'.
For a scope that results in only one item we'll get a path.
::
$ cabal list-bin cabal-install:exes
/.../dist-newstyle/build/.../cabal/cabal
$ cabal list-bin cabal-install:cabal
/.../dist-newstyle/build/.../cabal/cabal
We can't scope to ``all:exes`` and ``all`` is not the same as giving no scope.
::
$ cabal list-bin cabal-install:all:exes
cabal: Unknown target 'cabal-install:all:exes'.
The package cabal-install has no component 'all'.
$ cabal list-bin cabal-install:all
cabal: Unknown target 'cabal-install:all'.
The package cabal-install has no component 'all'.
We can also scope to test suite targets as they produce binaries.
::
$ cabal list-bin cabal-install:tests
cabal: The list-bin command is for finding a single binary at once. The target
'cabal-install:tests' refers to the test suites in the package
cabal-install-3.7.0.0 which includes the test suite 'unit-tests', the test
suite 'memory-usage-tests', the test suite 'long-tests' and the test suite
'integration-tests2'.
$ cabal list-bin cabal-install:unit-tests
/.../dist-newstyle/.../unit-tests/unit-tests
cabal v2-configure
-------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment