@@ -652,21 +652,16 @@ _Duplicate package names_: If multiple packages under the directory tree have
652
652
same name, `stack init` will report those and automatically ignore one of them.
653
653
654
654
_Ignore subdirectories_ : By default `stack init` searches all the subdirectories
655
- for `.cabal` files. If you do not want that then you can use `--ignore-subdirs`
655
+ for Cabal files. If you do not want that then you can use `--ignore-subdirs`
656
656
command line switch.
657
657
658
658
_Cabal warnings_ : ` stack init` will show warnings if there were issues in
659
- reading a Cabal package file. You may want to pay attention to the warnings as
660
- sometimes they may result in incomprehensible errors later on during dependency
661
- solving.
659
+ reading a Cabal file. You may want to pay attention to the warnings as sometimes
660
+ they may result in incomprehensible errors later on during dependency solving.
662
661
663
662
_Package naming_ : If the `Name` field defined in a Cabal file does not match
664
663
with the Cabal file name then `stack init` will refuse to continue.
665
664
666
- _Cabal install errors_ : ` stack init` uses `cabal-install` to determine external
667
- dependencies. When `cabal-install` encounters errors, Cabal errors are displayed
668
- as is by `stack init` for diagnostics.
669
-
670
665
_User warnings_ : When packages are excluded or external dependencies added
671
666
Stack will show warnings every time configuration file is loaded. You can
672
667
suppress the warnings by editing the config file and removing the warnings from
@@ -809,9 +804,9 @@ This will:
809
804
810
805
# ## install and copy-bins
811
806
812
- It's worth calling out the behavior of the install command and `--copy-bins`
807
+ It's worth calling out the behavior of the ` install` command and `--copy-bins`
813
808
option, since this has confused a number of users (especially when compared to
814
- behavior of other tools like cabal-install ). The `install` command does
809
+ behavior of other tools like Cabal (the tool) ). The `install` command does
815
810
precisely one thing in addition to the build command : it copies any generated
816
811
executables to the local bin path. You may recognize the default value for that
817
812
path :
@@ -821,13 +816,13 @@ michael@d30748af6d3d:~/helloworld$ stack path --local-bin
821
816
/home/michael/.local/bin
822
817
` ` `
823
818
824
- That's why the download page recommends adding that directory to your ` PATH`
825
- environment variable. This feature is convenient, because now you can simply
826
- run `executable-name` in your shell instead of having to run
827
- ` stack exec executable-name ` from inside your project directory.
819
+ That's why the download page recommends adding that directory to your PATH. This
820
+ feature is convenient, because now you can simply run `executable-name` in your
821
+ shell instead of having to run `stack exec executable-name` from inside your
822
+ project directory.
828
823
829
824
Since it's such a point of confusion, let me list a number of things Stack does
830
- *not* do specially for the install command:
825
+ *not* do specially for the ` install` command:
831
826
832
827
* Stack will always build any necessary dependencies for your code. The install
833
828
command is not necessary to trigger this behavior. If you just want to build a
@@ -1176,12 +1171,12 @@ Flags worth mentioning:
1176
1171
* `--package foo` can be used to force a package to be installed before running
1177
1172
the given command.
1178
1173
* `--no-ghc-package-path` can be used to stop the `GHC_PACKAGE_PATH` environment
1179
- variable from being set. Some tools — notably cabal-install — do not behave
1174
+ variable from being set. Some tools — notably Cabal (the tool) — do not behave
1180
1175
well with that variable set.
1181
1176
1182
1177
You may also find it convenient to use `stack exec` to launch a subshell
1183
1178
(substitute `bash` with your preferred shell) where your compiled executable is
1184
- available at the front of your ` PATH` :
1179
+ available at the front of your PATH:
1185
1180
1186
1181
stack exec bash
1187
1182
@@ -1469,38 +1464,39 @@ not convincing a tool to do what you want.
1469
1464
1470
1465
Before jumping into the differences, let me clarify an important similarity:
1471
1466
1472
- __Same package format.__ Stack, cabal-install , and presumably all other tools
1473
- share the same underlying Cabal package format, consisting of a `.cabal` file,
1467
+ __Same package format.__ Stack, Cabal (the tool) , and presumably all other tools
1468
+ share the same underlying Cabal package format, consisting of a Cabal file,
1474
1469
modules, etc. This is a Good Thing: we can share the same set of upstream
1475
- libraries, and collaboratively work on the same project with Stack,
1476
- cabal-install , and NixOS. In that sense, we're sharing the same ecosystem.
1470
+ libraries, and collaboratively work on the same project with Stack, Cabal (the
1471
+ tool) , and NixOS. In that sense, we're sharing the same ecosystem.
1477
1472
1478
1473
Now the differences:
1479
1474
1480
1475
* __Curation vs dependency solving as a default__.
1481
1476
* Stack defaults to using curation (Stackage snapshots, LTS Haskell,
1482
1477
Nightly, etc) as a default instead of defaulting to dependency solving, as
1483
- cabal-install does. This is just a default: as described above, Stack can
1484
- use dependency solving if desired, and cabal-install can use curation.
1485
- However, most users will stick to the defaults. The Stack team firmly
1486
- believes that the majority of users want to simply ignore dependency
1487
- resolution nightmares and get a valid build plan from day 1, which is why
1488
- we've made this selection of default behavior.
1478
+ Cabal (the tool) does. This is just a default: as described above, Stack
1479
+ can use dependency solving if desired, and Cabal (the tool) can use
1480
+ curation. However, most users will stick to the defaults. The Stack team
1481
+ firmly believes that the majority of users want to simply ignore
1482
+ dependency resolution nightmares and get a valid build plan from day one,
1483
+ which is why we've made this selection of default behavior.
1489
1484
* __Reproducible__.
1490
1485
* Stack goes to great lengths to ensure that `stack build` today does the
1491
- same thing tomorrow. cabal-install does not: build plans can be affected
1492
- by the presence of preinstalled packages, and running `cabal update` can
1493
- cause a previously successful build to fail. With Stack, changing the
1494
- build plan is always an explicit decision.
1486
+ same thing tomorrow. Cabal (the tool) does not: build plans can be
1487
+ affected by the presence of pre-installed packages, and running
1488
+ `cabal update` can cause a previously successful build to fail. With
1489
+ Stack, changing the build plan is always an explicit decision.
1495
1490
* __Automatically building dependencies__.
1496
- * In cabal-install , you need to use `cabal install` to trigger dependency
1497
- building. This is somewhat necessary due to the previous point, since
1498
- building dependencies can, in some cases, break existing installed
1491
+ * With Cabal (the tool) , you need to use `cabal install` to trigger
1492
+ dependency building. This is somewhat necessary due to the previous point,
1493
+ since building dependencies can, in some cases, break existing installed
1499
1494
packages. So for example, in Stack, `stack test` does the same job as
1500
1495
`cabal install --run-tests`, though the latter *additionally* performs an
1501
- installation that you may not want. The closer command equivalent is
1502
- `cabal install --enable-tests --only-dependencies && cabal configure --enable-tests && cabal build && cabal test`
1503
- (newer versions of cabal-install may make this command shorter).
1496
+ installation that you may not want. The closer equivalent command sequence
1497
+ is: `cabal install --enable-tests --only-dependencies`,
1498
+ `cabal configure --enable-tests`, `cabal build && cabal test` (newer
1499
+ versions of Cabal (the tool) may make this command sequence shorter).
1504
1500
* __Isolated by default__.
1505
1501
* This has been a pain point for new Stack users. In Cabal, the default
1506
1502
behavior is a non-isolated build where working on two projects can
@@ -1511,22 +1507,22 @@ Now the differences:
1511
1507
1512
1508
__Other tools for comparison (including active and historical)__
1513
1509
1514
- * [cabal-dev](https://hackage.haskell.org/package/cabal-dev) (deprecated in
1515
- favor of cabal-install)
1510
+ * [cabal-dev](https://hackage.haskell.org/package/cabal-dev). This is deprecated
1511
+ in favor of Cabal (the tool).
1516
1512
* [cabal-meta](https://hackage.haskell.org/package/cabal-meta) inspired a lot of
1517
- the multi-package functionality of stack . If you're still using cabal-install,
1518
- cabal-meta is relevant. For Stack work, the feature set is fully subsumed by
1519
- Stack.
1513
+ the multi-package functionality of Stack . If you're still using Cabal (the
1514
+ tool), ` cabal-meta` is relevant. For Stack work, the feature set is fully
1515
+ subsumed by Stack.
1520
1516
* [cabal-src](https://hackage.haskell.org/package/cabal-src) is mostly
1521
1517
irrelevant in the presence of both Stack and Cabal sandboxes, both of which
1522
1518
make it easier to add additional package sources easily. The mega-sdist
1523
1519
executable that ships with cabal-src is, however, still relevant. Its
1524
1520
functionality may some day be folded into Stack
1525
1521
* [stackage-cli](https://hackage.haskell.org/package/stackage-cli) was an
1526
- initial attempt to make cabal-install work more easily with curated snapshots,
1527
- but due to a slight impedance mismatch between cabal.config constraints and
1528
- snapshots, it did not work as well as hoped. It is deprecated in favor of
1529
- Stack.
1522
+ initial attempt to make Cabal (the tool) work more easily with curated
1523
+ snapshots, but due to a slight impedance mismatch between cabal.config
1524
+ constraints and snapshots, it did not work as well as hoped. It is deprecated
1525
+ in favor of Stack.
1530
1526
1531
1527
## Fun features
1532
1528
0 commit comments