Skip to content

Commit 6c72c37

Browse files
committed
Merge remote-tracking branch 'origin/stable' into rc/v2.3
2 parents 7d41fc7 + fce0ec0 commit 6c72c37

File tree

6 files changed

+50
-166
lines changed

6 files changed

+50
-166
lines changed

doc/GUIDE.md

Lines changed: 3 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -573,45 +573,6 @@ will work.
573573

574574
(Note: yackage does not currently support hpack, but you can also hpack-convert should you need to generate a package.yaml).
575575

576-
#### External Dependencies
577-
578-
Given that LTS Haskell and Stackage Nightly have ~1400 of the most common
579-
Haskell packages, this will often be enough to build most packages. However,
580-
at times, you may find that not all dependencies required may be available in
581-
the Stackage snapshots.
582-
583-
Let's simulate an unsatisfied dependency by adding acme-missiles to the list of dependencies
584-
the build requires. This is done by including it in the `Build-depends` section in the .cabal file
585-
and then re-initing:
586-
587-
```
588-
cueball:~/yackage-0.8.0$ stack init --force
589-
# init failure output
590-
```
591-
592-
stack has tested six different snapshots, and in every case discovered that
593-
acme-missiles is not available. In the end it suggested that you use the
594-
`--solver` command line switch if you want to use packages outside Stackage. So
595-
let's give it a try:
596-
597-
```
598-
cueball:~/yackage-0.8.0$ stack init --force --solver
599-
# solver output ...
600-
```
601-
602-
stack will complain that it needs a `cabal-install` installation. Let's get that:
603-
604-
```
605-
cueball:~/yackage-0.8.0$ stack install cabal-install
606-
```
607-
608-
Then run the above `stack init` command again and it will succeed.
609-
610-
As you can verify by viewing `stack.yaml`, three external dependencies were added
611-
by stack init under the `extra-deps` field. Of course, you could have added the
612-
external dependencies by manually editing `stack.yaml` but stack init does the
613-
hard work for you.
614-
615576
#### Excluded Packages
616577

617578
Sometimes multiple packages in your project may have conflicting requirements.
@@ -625,10 +586,10 @@ works.
625586
To simulate a conflict we will use acme-missiles-0.3 in yackage and we will
626587
also copy `yackage.cabal` to another directory and change the name of the file
627588
and package to yackage-test. In this new package we will use acme-missiles-0.2
628-
instead. Let's see what happens when we run solver:
589+
instead. Let's see what happens when we re-run stack init:
629590

630591
```
631-
cueball:~/yackage-0.8.0$ stack init --force --solver --omit-packages
592+
cueball:~/yackage-0.8.0$ stack init --force --omit-packages
632593
# init failure output ...
633594
```
634595

@@ -696,70 +657,6 @@ Warning: Some packages were found to be incompatible with the resolver and have
696657
Warning: Specified resolver could not satisfy all dependencies. Some external packages have been added as dependencies.
697658
You can suppress this message by removing it from stack.yaml
698659
```
699-
### stack solver
700-
701-
While `stack init` is used to create stack configuration file from existing
702-
cabal files, `stack solver` can be used to fine tune or fix an existing stack
703-
configuration file.
704-
705-
`stack solver` uses the existing file as a constraint. For example it will
706-
use only those packages specified in the existing config file or use existing
707-
external dependencies as constraints to figure out other dependencies.
708-
709-
Let's try `stack solver` to verify the config that we generated earlier with
710-
`stack init`:
711-
712-
```
713-
cueball:~/yackage-0.8.0$ stack solver
714-
# solver output ...
715-
```
716-
717-
It says there are no changes needed to your configuration. Notice that it also reports
718-
`example/yackage-test.cabal` as missing from the config. It was purposely
719-
omitted by `stack init` to resolve a conflict.
720-
721-
Sometimes `stack init` may not be able to give you a perfect configuration. In
722-
that case, you can tweak the configuration file as per your requirements and then
723-
run `stack solver`, it will check the file and suggest or apply any fixes
724-
needed.
725-
726-
For example, if `stack init` ignored certain packages due to name conflicts or
727-
dependency conflicts, the choice that `stack init` made may not be the correct
728-
one. In that case you can revert the choice and use solver to fix things.
729-
730-
Let's try commenting out `.` and uncommenting `examples/` in our previously
731-
generated `stack.yaml` and then run `stack solver`:
732-
733-
```
734-
cueball:~/yackage-0.8.0$ stack solver
735-
# solver failure output ...
736-
```
737-
738-
Due to the change that we made, solver suggested some new dependencies.
739-
By default it does not make changes to the config. As it suggested you can use
740-
`--update-config` to make changes to the config.
741-
742-
NOTE: You should probably back up your `stack.yaml` before doing this, such as
743-
committing to Git/Mercurial/Darcs.
744-
745-
Sometimes, you may want to use specific versions of certain packages for your
746-
project. To do that you can fix those versions by specifying them in the
747-
extra-deps section and then use `stack solver` to figure out whether it is
748-
feasible to use those or what other dependencies are needed as a result.
749-
750-
If you want to change the resolver for your project, you can run
751-
`stack solver --resolver <resolver name>` and it will figure out the changes needed for you.
752-
753-
Let's see what happens if we change the resolver to an older resolver - lts-2.22:
754-
755-
```
756-
cueball:~/yackage-0.8.0$ stack solver --resolver lts-2.22
757-
# solver failure output ...
758-
```
759-
760-
As you can see, it automatically suggested changes in `extra-deps` due to the
761-
change of resolver.
762-
763660
## Different databases
764661

765662
Time to take a short break from hands-on examples and discuss a little
@@ -1741,9 +1638,7 @@ users. Here's a quick rundown:
17411638
17421639
* `stack update` will download the most recent set of packages from your package
17431640
indices (e.g. Hackage). Generally, stack runs this for you automatically
1744-
when necessary, but it can be useful to do this manually sometimes (e.g.,
1745-
before running `stack solver`, to guarantee you have the most recent
1746-
upstream packages available).
1641+
when necessary, but it can be useful to do this manually sometimes.
17471642
* `stack unpack` is a command we've already used quite a bit for examples, but
17481643
most users won't use it regularly. It does what you'd expect: downloads a
17491644
tarball and unpacks it. It accept optional `--to` argument to specify

doc/faq.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ directory. None of this should affect any existing Haskell tools at all.
4747
* Cabal-the-library is used by stack to build your Haskell code. See the
4848
[Architecture: Plan Execution](architecture.md#plan-execution) section for
4949
more detail, including how the Cabal version is chosen.
50-
* cabal-install (the executable) is used by stack for its dependency solver
51-
functionality.
5250
* A .cabal file is provided for each package, and defines all package-level
5351
metadata just like it does in the cabal-install world: modules, executables,
5452
test suites, etc. No change at all on this front.
@@ -76,39 +74,35 @@ extra-deps:
7674
7775
## I need to use a package (or version of a package) that is not available on hackage, what should I do?
7876
79-
Add it to the `packages` list in your project's `stack.yaml`, specifying the
80-
package's source code location relative to the directory where your
81-
`stack.yaml` file lives, e.g.
77+
Add it to the
78+
[`extra-deps`](yaml_configuration.md#extra-deps) list in your project's
79+
`stack.yaml`, specifying the package's source code location relative to the
80+
directory where your `stack.yaml` file lives, e.g.
8281

8382
```yaml
8483
resolver: lts-2.10
8584
packages:
8685
- '.'
86+
extra-deps:
8787
- third-party/proprietary-dep
8888
- github-version-of/conduit
8989
- patched/diagrams
90-
extra-deps: []
9190
```
9291

93-
The above example specifies that it should include the package at the root
94-
directory (`'.'`), that the `proprietary-dep` package is found in the project's
95-
`third-party` folder, that the `conduit` package is found in the project's
96-
`github-version-of` folder, and that the `diagrams` package is found in the
97-
project's `patched` folder. This autodetects changes and reinstalls the
92+
The above example specifies that the `proprietary-dep` package is found in the
93+
project's `third-party` folder, that the `conduit` package is found in the
94+
project's `github-version-of` folder, and that the `diagrams` package is found
95+
in the project's `patched` folder. This autodetects changes and reinstalls the
9896
package.
9997

10098
To install packages directly from a Git repository, use e.g.:
10199

102100
```yaml
103-
resolver: lts-2.10
104-
packages:
105-
- location:
106-
git: https://github.com/githubuser/reponame.git
101+
extra-deps:
102+
- git: https://github.com/githubuser/reponame.git
107103
commit: somecommitID
108104
```
109105

110-
Note that the `- '.'` line has been omitted, so the package in the root directory will not be used.
111-
112106
## What is the meaning of the arguments given to stack build, test, etc?
113107

114108
Those are the targets of the build, and can have one of three formats:
@@ -129,13 +123,6 @@ your `packages` list in stack.yaml. (See the previous question.)
129123
Another would be to add the upstream package as a submodule to your
130124
project.
131125

132-
## Am I required to use a Stackage snapshot to use stack?
133-
134-
No, not at all. If you prefer dependency solving to curation, you can continue
135-
with that workflow. Instead of describing the details of how that works here,
136-
it's probably easiest to just say: run `stack init --solver` and look at the
137-
generated stack.yaml.
138-
139126
## How do I use this with sandboxes?
140127

141128
Explicit sandboxing on the part of the user is not required by stack. All

doc/maintainers/ghc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
cd stack && ./update-global-hints.hs ghc-X.Y.Z
4242

43-
and command the changes.
43+
and commit the changes.
4444

4545

4646
## Building GHC

doc/nonstandard_project_init.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ general, your stack packages should also end up being valid cabal-install
1818
packages.
1919

2020
### Issues Referenced
21-
- https://github.com/commercialhaskell/stack/issues/105
21+
- <https://github.com/commercialhaskell/stack/issues/105>
2222

2323
## Passing Flags to Cabal
2424

@@ -50,12 +50,12 @@ change in a future release.
5050

5151

5252
### Issues Referenced
53-
- https://github.com/commercialhaskell/stack/issues/191
54-
- https://github.com/commercialhaskell/stack/issues/417
55-
- https://github.com/commercialhaskell/stack/issues/335
56-
- https://github.com/commercialhaskell/stack/issues/301
57-
- https://github.com/commercialhaskell/stack/issues/365
58-
- https://github.com/commercialhaskell/stack/issues/105
53+
- <https://github.com/commercialhaskell/stack/issues/191>
54+
- <https://github.com/commercialhaskell/stack/issues/417>
55+
- <https://github.com/commercialhaskell/stack/issues/335>
56+
- <https://github.com/commercialhaskell/stack/issues/301>
57+
- <https://github.com/commercialhaskell/stack/issues/365>
58+
- <https://github.com/commercialhaskell/stack/issues/105>
5959

6060
## Selecting a Resolver
6161

@@ -75,8 +75,8 @@ default so as to avoid unnecessary recompilation time.
7575
:TODO: Document `--solver`
7676

7777
### Issues Referenced
78-
- https://github.com/commercialhaskell/stack/issues/468
79-
- https://github.com/commercialhaskell/stack/issues/464
78+
- <https://github.com/commercialhaskell/stack/issues/468>
79+
- <https://github.com/commercialhaskell/stack/issues/464>
8080

8181
## Using git Repositories
8282

@@ -86,8 +86,8 @@ documentation](yaml_configuration.md#git-and-mercurial-repos) for more
8686
information.
8787

8888
### Issues Referenced
89-
- https://github.com/commercialhaskell/stack/issues/254
90-
- https://github.com/commercialhaskell/stack/issues/199
89+
- <https://github.com/commercialhaskell/stack/issues/254>
90+
- <https://github.com/commercialhaskell/stack/issues/199>
9191

9292
## Private Hackage
9393
Working with a private Hackage is currently supported in certain situations.
@@ -105,16 +105,16 @@ eliminating the need to manage a Hackage database and pointless version bumps.
105105
For further information see [YAML configuration](yaml_configuration.md)
106106

107107
### Issues Referenced
108-
- https://github.com/commercialhaskell/stack/issues/445
109-
- https://github.com/commercialhaskell/stack/issues/565
108+
- <https://github.com/commercialhaskell/stack/issues/445>
109+
- <https://github.com/commercialhaskell/stack/issues/565>
110110

111111
## Custom Snapshots
112112
See [Custom Snapshots](custom_snapshot.md).
113113

114114
### Issues Referenced
115-
- https://github.com/commercialhaskell/stack/issues/111
116-
- https://github.com/commercialhaskell/stack/issues/253
117-
- https://github.com/commercialhaskell/stack/issues/137
115+
- <https://github.com/commercialhaskell/stack/issues/111>
116+
- <https://github.com/commercialhaskell/stack/issues/253>
117+
- <https://github.com/commercialhaskell/stack/issues/137>
118118

119119
## Intra-package Targets
120120
Stack supports intra-package targets, similar to `cabal build COMPONENTS` for
@@ -129,4 +129,4 @@ stack test stack:test:stack-integration-test
129129
Note: this does require prefixing the component name with the package name.
130130

131131
### Issues referenced
132-
- https://github.com/commercialhaskell/stack/issues/201
132+
- <https://github.com/commercialhaskell/stack/issues/201>

etc/scripts/get-stack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ post_install_separator() {
7272

7373
# determines the the CPU's instruction set
7474
get_isa() {
75-
if arch | grep -q armv7 ; then
75+
if arch | grep -Eq 'armv[78]l?' ; then
7676
echo arm
7777
elif arch | grep -q aarch64 ; then
7878
echo aarch64

etc/scripts/mirror-ghc-bindists-to-github.sh

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# https://downloads.haskell.org/~ghc/X.Y.Z/.
2121
#
2222

23-
GHCVER=8.8.3
23+
GHCVER=8.10.1
2424

2525
if [[ -z "$GITHUB_AUTH_TOKEN" ]]; then
2626
echo "$0: GITHUB_AUTH_TOKEN environment variable is required" >&2
@@ -42,13 +42,26 @@ mirror_ () {
4242
destsuffix="$1"; shift
4343
srcext="$1"; shift
4444
destext="$1"; shift
45+
local srcurl="$base_url/ghc-$GHCVER-${suffix}.tar.${srcext}"
4546
local srcfn=ghc-$GHCVER-${suffix}${destsuffix:+_}${destsuffix}.tar.${srcext}
4647
if [[ ! -s "$srcfn.downloaded" ]]; then
4748
rm -f "$srcfn"
48-
curl -Lo "$srcfn" --fail "$base_url/ghc-$GHCVER-${suffix}.tar.${srcext}"
49+
curl -Lo "$srcfn" --fail "$srcurl"
4950
date >"$srcfn.downloaded"
5051
fi
5152
local destfn=ghc-$GHCVER-${suffix}${destsuffix:+_}${destsuffix}.tar.${destext}
53+
while [[ $# -gt 0 ]]; do
54+
alias="$1"
55+
echo " $alias:" >>stack-setup-$GHCVER.yaml
56+
echo " $GHCVER:" >>stack-setup-$GHCVER.yaml
57+
echo " # Mirrored from $srcurl" >>stack-setup-$GHCVER.yaml
58+
echo " url: \"https://github.com/commercialhaskell/ghc/releases/download/ghc-$GHCVER-release/$destfn\"" >>stack-setup-$GHCVER.yaml
59+
echo " content-length: $(stat --printf="%s" "$destfn" 2>/dev/null || stat -f%z "$destfn")" >>stack-setup-$GHCVER.yaml
60+
echo " sha1: $(shasum -a 1 $destfn |cut -d' ' -f1)" >>stack-setup-$GHCVER.yaml
61+
echo " sha256: $(shasum -a 256 $destfn |cut -d' ' -f1)" >>stack-setup-$GHCVER.yaml
62+
echo "" >>stack-setup-$GHCVER.yaml
63+
shift
64+
done
5265
if [[ ! -s "$destfn.uploaded" ]]; then
5366
if [[ "${srcext}" == "xz" && "${destext}" == "bz2" ]]; then
5467
xzcat "$srcfn" | bzip2 -c > "$destfn"
@@ -61,18 +74,6 @@ mirror_ () {
6174
curl --fail -X POST --data-binary "@$destfn" -H "Content-type: application/octet-stream" -H "Authorization: token $GITHUB_AUTH_TOKEN" "$UPLOAD_URL?name=$destfn"
6275
date >"$destfn.uploaded"
6376
fi
64-
while [[ $# -gt 0 ]]; do
65-
alias="$1"
66-
echo " $alias:" >>stack-setup-$GHCVER.yaml
67-
echo " $GHCVER:" >>stack-setup-$GHCVER.yaml
68-
echo " # Mirrored from $base_url/$srcfn" >>stack-setup-$GHCVER.yaml
69-
echo " url: \"https://github.com/commercialhaskell/ghc/releases/download/ghc-$GHCVER-release/$destfn\"" >>stack-setup-$GHCVER.yaml
70-
echo " content-length: $(stat --printf="%s" "$destfn" 2>/dev/null || stat -f%z "$destfn")" >>stack-setup-$GHCVER.yaml
71-
echo " sha1: $(shasum -a 1 $destfn |cut -d' ' -f1)" >>stack-setup-$GHCVER.yaml
72-
echo " sha256: $(shasum -a 256 $destfn |cut -d' ' -f1)" >>stack-setup-$GHCVER.yaml
73-
echo "" >>stack-setup-$GHCVER.yaml
74-
shift
75-
done
7677
}
7778

7879
mirror () {
@@ -83,14 +84,15 @@ mirror () {
8384
# https://github.com/fpco/stackage-content/blob/master/stack/stack-setup-2.yaml
8485

8586
mirror i386-deb9-linux "" xz xz linux32
86-
mirror x86_64-deb8-linux "" xz xz linux64
87+
mirror x86_64-deb9-linux "" xz xz linux64
8788
#mirror x86_64-centos67-linux "" xz xz linux64-gmp4
8889
mirror x86_64-fedora27-linux "" xz xz linux64-tinfo6
8990
mirror x86_64-apple-darwin "" xz bz2 macosx
9091
#mirror i386-unknown-mingw32 "" xz xz windows32
9192
mirror x86_64-unknown-mingw32 "" xz xz windows64
9293
#mirror x86_64-portbld-freebsd11 "" xz xz freebsd64-11
9394
mirror aarch64-deb9-linux "" xz xz linux-aarch64
95+
mirror armv7-deb9-linux "" xz xz linux-armv7
9496

9597
mirror_ https://github.com/redneb/ghc-alt-libc/releases/download/ghc-$GHCVER-musl i386-unknown-linux-musl "" xz xz linux32-musl
9698
mirror_ https://github.com/redneb/ghc-alt-libc/releases/download/ghc-$GHCVER-musl x86_64-unknown-linux-musl "" xz xz linux64-musl

0 commit comments

Comments
 (0)