Skip to content

Commit 07cce4e

Browse files
committed
Remove v2- prefix from docs.
The v2- style commands have been default since version 3.0.0.0, so when looking at the latest version of the docs it should assume the defaults. I left the explicit v2- prefix in the nix-style docs since it is explicitly discussing the difference between the old and new style commands. Also fix some small errors.
1 parent 7e29625 commit 07cce4e

File tree

3 files changed

+79
-79
lines changed

3 files changed

+79
-79
lines changed

Cabal/doc/cabal-commands.rst

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ cabal-install Commands
44
We now give an in-depth description of all the commands, describing the
55
arguments and flags they accept.
66

7-
cabal v2-configure
7+
cabal configure
88
-------------------
99

10-
``cabal v2-configure`` takes a set of arguments and writes a
10+
``cabal configure`` takes a set of arguments and writes a
1111
``cabal.project.local`` file based on the flags passed to this command.
12-
``cabal v2-configure FLAGS; cabal new-build`` is roughly equivalent to
13-
``cabal v2-build FLAGS``, except that with ``new-configure`` the flags
14-
are persisted to all subsequent calls to ``v2-build``.
12+
``cabal configure FLAGS; cabal build`` is roughly equivalent to
13+
``cabal build FLAGS``, except that with ``configure`` the flags
14+
are persisted to all subsequent calls to ``build``.
1515

16-
``cabal v2-configure`` is intended to be a convenient way to write out
16+
``cabal configure`` is intended to be a convenient way to write out
1717
a ``cabal.project.local`` for simple configurations; e.g.,
18-
``cabal v2-configure -w ghc-7.8`` would ensure that all subsequent
19-
builds with ``cabal v2-build`` are performed with the compiler
18+
``cabal configure -w ghc-7.8`` would ensure that all subsequent
19+
builds with ``cabal build`` are performed with the compiler
2020
``ghc-7.8``. For more complex configuration, we recommend writing the
2121
``cabal.project.local`` file directly (or placing it in
2222
``cabal.project``!)
2323

24-
``cabal v2-configure`` inherits options from ``Cabal``. semantics:
24+
``cabal configure`` inherits options from ``Cabal``. semantics:
2525

2626
- Any flag accepted by ``./Setup configure``.
2727

@@ -42,24 +42,24 @@ to happen if a flag actually applied to every transitive dependency). To
4242
apply options to an external package, use a ``package`` stanza in a
4343
``cabal.project`` file.
4444

45-
cabal v2-update
45+
cabal update
4646
----------------
4747

48-
``cabal v2-update`` updates the state of the package index. If the
48+
``cabal update`` updates the state of the package index. If the
4949
project contains multiple remote package repositories it will update
5050
the index of all of them (e.g. when using overlays).
5151

5252
Some examples:
5353

5454
::
5555

56-
$ cabal v2-update # update all remote repos
57-
$ cabal v2-update head.hackage # update only head.hackage
56+
$ cabal update # update all remote repos
57+
$ cabal update head.hackage # update only head.hackage
5858

59-
cabal v2-build
59+
cabal build
6060
---------------
6161

62-
``cabal v2-build`` takes a set of targets and builds them. It
62+
``cabal build`` takes a set of targets and builds them. It
6363
automatically handles building and installing any dependencies of these
6464
targets.
6565

@@ -97,30 +97,30 @@ Some example targets:
9797

9898
::
9999

100-
$ cabal v2-build lib:foo-pkg # build the library named foo-pkg
101-
$ cabal v2-build foo-pkg:foo-tests # build foo-tests in foo-pkg
100+
$ cabal build lib:foo-pkg # build the library named foo-pkg
101+
$ cabal build foo-pkg:foo-tests # build foo-tests in foo-pkg
102102

103103
(There is also syntax for specifying module and file targets, but it
104104
doesn't currently do anything.)
105105

106-
Beyond a list of targets, ``cabal v2-build`` accepts all the flags that
107-
``cabal v2-configure`` takes. Most of these flags are only taken into
106+
Beyond a list of targets, ``cabal build`` accepts all the flags that
107+
``cabal configure`` takes. Most of these flags are only taken into
108108
consideration when building local packages; however, some flags may
109109
cause extra store packages to be built (for example,
110110
``--enable-profiling`` will automatically make sure profiling libraries
111111
for all transitive dependencies are built and installed.)
112112

113-
In addition ``cabal v2-build`` accepts these flags:
113+
In addition ``cabal build`` accepts these flags:
114114

115115
- ``--only-configure``: When given we will forgoe performing a full build and
116116
abort after running the configure phase of each target package.
117117

118118

119-
cabal v2-repl
119+
cabal repl
120120
--------------
121121

122-
``cabal v2-repl TARGET`` loads all of the modules of the target into
123-
GHCi as interpreted bytecode. In addition to ``cabal v2-build``'s flags,
122+
``cabal repl TARGET`` loads all of the modules of the target into
123+
GHCi as interpreted bytecode. In addition to ``cabal build``'s flags,
124124
it takes an additional ``--repl-options`` flag.
125125

126126
To avoid ``ghci`` specific flags from triggering unneeded global rebuilds these
@@ -130,8 +130,8 @@ other repls). Instead, you should use the new ``--repl-options`` flag to
130130
specify these options to the invoked repl. (This flag also works on ``cabal
131131
repl`` and ``Setup repl`` on sufficiently new versions of Cabal.)
132132

133-
Currently, it is not supported to pass multiple targets to ``v2-repl``
134-
(``v2-repl`` will just successively open a separate GHCi session for
133+
Currently, it is not supported to pass multiple targets to ``repl``
134+
(``repl`` will just successively open a separate GHCi session for
135135
each target.)
136136

137137
It also provides a way to experiment with libraries without needing to download
@@ -142,34 +142,34 @@ of the ``vector`` package matching that specification exposed.
142142

143143
::
144144

145-
$ cabal v2-repl --build-depends "vector >= 0.12 && < 0.13"
145+
$ cabal repl --build-depends "vector >= 0.12 && < 0.13"
146146

147147
Both of these commands do the same thing as the above, but only exposes ``base``,
148148
``vector``, and the ``vector`` package's transitive dependencies even if the user
149149
is in a project context.
150150

151151
::
152152

153-
$ cabal v2-repl --ignore-project --build-depends "vector >= 0.12 && < 0.13"
154-
$ cabal v2-repl --project='' --build-depends "vector >= 0.12 && < 0.13"
153+
$ cabal repl --ignore-project --build-depends "vector >= 0.12 && < 0.13"
154+
$ cabal repl --project='' --build-depends "vector >= 0.12 && < 0.13"
155155

156156
This command would add ``vector``, but not (for example) ``primitive``, because
157157
it only includes the packages specified on the command line (and ``base``, which
158158
cannot be excluded for technical reasons).
159159

160160
::
161161

162-
$ cabal v2-repl --build-depends vector --no-transitive-deps
162+
$ cabal repl --build-depends vector --no-transitive-deps
163163

164-
cabal v2-run
164+
cabal run
165165
-------------
166166

167-
``cabal v2-run [TARGET [ARGS]]`` runs the executable specified by the
167+
``cabal run [TARGET [ARGS]`` runs the executable specified by the
168168
target, which can be a component, a package or can be left blank, as
169169
long as it can uniquely identify an executable within the project.
170170
Tests and benchmarks are also treated as executables.
171171

172-
See `the v2-build section <#cabal-new-build>`__ for the target syntax.
172+
See `the build section <#cabal-new-build>`__ for the target syntax.
173173

174174
Except in the case of the empty target, the strings after it will be
175175
passed to the executable as arguments.
@@ -180,17 +180,17 @@ have to separate them with ``--``.
180180

181181
::
182182

183-
$ cabal v2-run target -- -a -bcd --argument
183+
$ cabal run target -- -a -bcd --argument
184184

185-
'v2-run' also supports running script files that use a certain format. With
185+
'run' also supports running script files that use a certain format. With
186186
a script that looks like:
187187

188188
::
189189

190190
#!/usr/bin/env cabal
191191
{- cabal:
192192
build-depends: base ^>= 4.11
193-
, shelly ^>= 1.8.1
193+
, shelly ^>= 1.8.1
194194
-}
195195

196196
main :: IO ()
@@ -202,13 +202,13 @@ interpreter, or through this command:
202202

203203
::
204204

205-
$ cabal v2-run script.hs
206-
$ cabal v2-run script.hs -- --arg1 # args are passed like this
205+
$ cabal run script.hs
206+
$ cabal run script.hs -- --arg1 # args are passed like this
207207

208-
cabal v2-freeze
208+
cabal freeze
209209
----------------
210210

211-
``cabal v2-freeze`` writes out a **freeze file** which records all of
211+
``cabal freeze`` writes out a **freeze file** which records all of
212212
the versions and flags which that are picked by the solver under the
213213
current index and flags. Default name of this file is
214214
``cabal.project.freeze`` but in combination with a
@@ -235,66 +235,66 @@ users see a consistent set of dependencies. For libraries, this is not
235235
recommended: users often need to build against different versions of
236236
libraries than what you developed against.
237237

238-
cabal v2-bench
238+
cabal bench
239239
---------------
240240

241-
``cabal v2-bench [TARGETS] [OPTIONS]`` runs the specified benchmarks
241+
``cabal bench [TARGETS] [OPTIONS]`` runs the specified benchmarks
242242
(all the benchmarks in the current package by default), first ensuring
243243
they are up to date.
244244

245-
cabal v2-test
245+
cabal test
246246
--------------
247247

248-
``cabal v2-test [TARGETS] [OPTIONS]`` runs the specified test suites
248+
``cabal test [TARGETS] [OPTIONS]`` runs the specified test suites
249249
(all the test suites in the current package by default), first ensuring
250250
they are up to date.
251251

252-
cabal v2-haddock
252+
cabal haddock
253253
-----------------
254254

255-
``cabal v2-haddock [FLAGS] [TARGET]`` builds Haddock documentation for
255+
``cabal haddock [FLAGS] [TARGET]`` builds Haddock documentation for
256256
the specified packages within the project.
257257

258258
If a target is not a library :cfg-field:`haddock-benchmarks`,
259259
:cfg-field:`haddock-executables`, :cfg-field:`haddock-internal`,
260260
:cfg-field:`haddock-tests` will be implied as necessary.
261261

262-
cabal v2-exec
262+
cabal exec
263263
---------------
264264

265-
``cabal v2-exec [FLAGS] [--] COMMAND [--] [ARGS]`` runs the specified command
265+
``cabal exec [FLAGS] [--] COMMAND [--] [ARGS]`` runs the specified command
266266
using the project's environment. That is, passing the right flags to compiler
267267
invocations and bringing the project's executables into scope.
268268

269-
cabal v2-install
269+
cabal install
270270
-----------------
271271

272-
``cabal v2-install [FLAGS] PACKAGES`` builds the specified packages and
272+
``cabal install [FLAGS] PACKAGES`` builds the specified packages and
273273
symlinks/copies their executables in ``installdir`` (usually ``~/.cabal/bin``).
274274

275275
For example this command will build the latest ``cabal-install`` and symlink
276276
its ``cabal`` executable:
277277

278278
::
279279

280-
$ cabal v2-install cabal-install
280+
$ cabal install cabal-install
281281

282-
In addition, it's possible to use ``cabal v2-install`` to install components
282+
In addition, it's possible to use ``cabal install`` to install components
283283
of a local project. For example, with an up-to-date Git clone of the Cabal
284284
repository, this command will build cabal-install HEAD and symlink the
285285
``cabal`` executable:
286286

287287
::
288288

289-
$ cabal v2-install exe:cabal
289+
$ cabal install exe:cabal
290290

291291
Where symlinking is not possible (eg. on some Windows versions) the ``copy``
292292
method is used by default. You can specify the install method
293293
by using ``--install-method`` flag:
294294

295295
::
296296

297-
$ cabal v2-install exe:cabal --install-method=copy --installdir=$HOME/bin
297+
$ cabal install exe:cabal --install-method=copy --installdir=$HOME/bin
298298

299299
Note that copied executables are not self-contained, since they might use
300300
data-files from the store.
@@ -304,67 +304,67 @@ example, this command will build the latest Cabal library and install it:
304304

305305
::
306306

307-
$ cabal v2-install --lib Cabal
307+
$ cabal install --lib Cabal
308308

309309
This works by managing GHC environments. By default, it is writing to the
310310
global environment in ``~/.ghc/$ARCH-$OS-$GHCVER/environments/default``.
311-
``v2-install`` provides the ``--package-env`` flag to control which of
311+
``install`` provides the ``--package-env`` flag to control which of
312312
these environments is modified.
313313

314314
This command will modify the environment file in the current directory:
315315

316316
::
317317

318-
$ cabal v2-install --lib Cabal --package-env .
318+
$ cabal install --lib Cabal --package-env .
319319

320320
This command will modify the environment file in the ``~/foo`` directory:
321321

322322
::
323323

324-
$ cabal v2-install --lib Cabal --package-env foo/
324+
$ cabal install --lib Cabal --package-env foo/
325325

326-
Do note that the results of the previous two commands will be overwritten by
327-
the use of other v2-style commands, so it is not recommended to use them inside
328-
a project directory.
326+
Do note that the results of the previous two commands will be overwritten by the
327+
use of other commands, so it is not recommended to use them inside a project
328+
directory.
329329

330330
This command will modify the environment in the "local.env" file in the
331331
current directory:
332332

333333
::
334334

335-
$ cabal v2-install --lib Cabal --package-env local.env
335+
$ cabal install --lib Cabal --package-env local.env
336336

337337
This command will modify the ``myenv`` named global environment:
338338

339339
::
340340

341-
$ cabal v2-install --lib Cabal --package-env myenv
341+
$ cabal install --lib Cabal --package-env myenv
342342

343343
If you wish to create a named environment file in the current directory where
344344
the name does not contain an extension, you must reference it as ``./myenv``.
345345

346346
You can learn more about how to use these environments in `this section of the
347347
GHC manual <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#package-environments>`_.
348348

349-
cabal v2-clean
349+
cabal clean
350350
---------------
351351

352-
``cabal v2-clean [FLAGS]`` cleans up the temporary files and build artifacts
352+
``cabal clean [FLAGS]`` cleans up the temporary files and build artifacts
353353
stored in the ``dist-newstyle`` folder.
354354

355355
By default, it removes the entire folder, but it can also spare the configuration
356356
and caches if the ``--save-config`` option is given, in which case it only removes
357357
the build artefacts (``.hi``, ``.o`` along with any other temporary files generated
358358
by the compiler, along with the build output).
359359

360-
cabal v2-sdist
360+
cabal sdist
361361
---------------
362362

363-
``cabal v2-sdist [FLAGS] [TARGETS]`` takes the crucial files needed to build ``TARGETS``
363+
``cabal sdist [FLAGS] [TARGETS]`` takes the crucial files needed to build ``TARGETS``
364364
and puts them into an archive format ready for upload to Hackage. These archives are stable
365365
and two archives of the same format built from the same source will hash to the same value.
366366

367-
``cabal v2-sdist`` takes the following flags:
367+
``cabal sdist`` takes the following flags:
368368

369369
- ``-l``, ``--list-only``: Rather than creating an archive, lists files that would be included.
370370
Output is to ``stdout`` by default. The file paths are relative to the project's root
@@ -377,10 +377,10 @@ and two archives of the same format built from the same source will hash to the
377377
- ``--null-sep``: Only used with ``--list-only``. Separates filenames with a NUL
378378
byte instead of newlines.
379379

380-
``v2-sdist`` is inherently incompatible with sdist hooks (which were removed in `Cabal-3.0`),
380+
``sdist`` is inherently incompatible with sdist hooks (which were removed in `Cabal-3.0`),
381381
not due to implementation but due to fundamental core invariants
382382
(same source code should result in the same tarball, byte for byte)
383-
that must be satisfied for it to function correctly in the larger v2-build ecosystem.
383+
that must be satisfied for it to function correctly in the larger build ecosystem.
384384
``autogen-modules`` is able to replace uses of the hooks to add generated modules, along with
385385
the custom publishing of Haddock documentation to Hackage.
386386

Cabal/doc/cabal-package.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2825,7 +2825,7 @@ The availability of the
28252825
``MIN_VERSION_package_(A,B,C)`` CPP macros
28262826
inside ``Setup.hs`` scripts depends on the condition that either
28272827

2828-
- a ``custom-setup`` section has been declared (or ``cabal v2-build`` is being
2828+
- a ``custom-setup`` section has been declared (or ``cabal build`` is being
28292829
used which injects an implicit hard-coded ``custom-setup`` stanza if it's missing), or
28302830
- GHC 8.0 or later is used (which natively injects package version CPP macros)
28312831

0 commit comments

Comments
 (0)