Skip to content

Commit d46bf1a

Browse files
authored
Merge branch 'master' into fix1369
2 parents 2fc553b + 6a7bd5d commit d46bf1a

27 files changed

+462
-113
lines changed

CONTRIBUTING.md

Lines changed: 118 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,106 @@
11
# Contributors Guide
22

3+
Thank you for considering contributing to the maintenance or development of
4+
Stack, or otherwise supporting users of Stack! We hope that the following
5+
information will encourage and assist you. We start with some advice about
6+
Stack's goals and governance, and approach to supporting users.
7+
8+
## Stack's goals
9+
10+
Stack's current goals are:
11+
12+
* To provide easy to use tooling for Haskell development
13+
* To provide complete support for at least the following three development
14+
environments: Linux, macOS, and Windows
15+
* To address the needs of industrial users, open source maintainers, and other
16+
people
17+
* To focus on the 'curated package set' use case
18+
* To prioritize reproducible build plans
19+
20+
The goals above are not set in stone. However, any major changes to them
21+
should involve significant public discussion and a public vote by the Stack
22+
maintainer team.
23+
24+
## Stack's governance
25+
26+
People involved in maintaining or developing Stack with rights to make commits
27+
to the repository can be classified into two groups: 'committers' and
28+
'maintainers'.
29+
30+
### Stack's committers
31+
32+
We encourages a wide range of people to be granted rights to make commits to the
33+
repository.
34+
35+
People are encouraged to take initiative to make non-controversial
36+
changes, such as documentation improvements, bug fixes, performance
37+
improvements, and feature enhancements.
38+
39+
Maintainers should be included in discussions of controversial changes and
40+
tricky code changes.
41+
42+
Our general approach is **"it's easier to ask forgiveness than permission"**. If
43+
there is ever a bad change, it can always be rolled back.
44+
45+
### Stack's maintainers
46+
47+
Stack's maintainers are long-term contributors to the project. Michael Snoyman
48+
(@snoyberg) was the founder of Stack, and its initial maintainer - and he has
49+
added others. Michael's current interests and priorties mean that he is no
50+
longer actively involved in adding new features to Stack.
51+
52+
Maintainers are recognized for their contributions including:
53+
54+
* Direct code contribution
55+
* Review of pull requests
56+
* Interactions on the GitHub issue tracker
57+
* Documentation management
58+
* External support - for example, hosting or training
59+
60+
The maintainer team make certain decisions when that is necessary, specifically:
61+
62+
* How to proceed, if there is disagreement on how to do so on a specific topic
63+
* Whether to add or remove (see further below) a maintainer
64+
65+
Generally, maintainers are only removed due to non-participation or actions
66+
unhealthy to the project. Removal due to non-participation is not a punishment,
67+
simply a recognition that maintainership is for active participants only.
68+
69+
We hope that removal due to unhealthy actions will never be necessary, but would
70+
include protection for cases of:
71+
72+
* Disruptive behavior in public channels related to Stack
73+
* Impairing the codebase through bad commits/merges
74+
75+
Like committers, maintainers are broadly encouraged to make autonomous
76+
decisions. Each maintainer is empowered to make a unilateral decision. However,
77+
maintainers should favor getting consensus first if:
78+
79+
* They are uncertain what is the best course of action
80+
* They anticipate that other maintainers or users of Stack will disagree on the
81+
decision
82+
83+
## Stack's support
84+
85+
A large part of the general discussion around Stack is on support-related
86+
topics, and that is reflected in the current issue tracker content. Assistance
87+
in responding to such matters is greatly appreciated.
88+
89+
While support-related matters can be posted here as an 'issue', we encourage the
90+
use of other forums, in particular
91+
[Haskell's Discourse](https://discourse.haskell.org/). We also recommend
92+
Haskell's Discourse for general discussions about Stack's current or desired
93+
features. Stack is also discussed on Reddit's
94+
[Haskell community](https://www.reddit.com/r/haskell/).
95+
96+
We encourage use of those other forums because support-related discussions can
97+
clog up the issue tracker and make it more difficult to maintain the project.
98+
People needing support may also get a faster and fuller response on other
99+
forums.
100+
101+
Additions to the issue tracker are better suited to concrete feature proposals,
102+
bug reports, and other code base discussions (for example, refactorings).
103+
3104
## Bug Reports
4105

5106
Please [open an issue](https://github.com/commercialhaskell/stack/issues/new)
@@ -19,7 +120,8 @@ If you would like to help with documentation, please note that for most cases
19120
the Wiki has been deprecated in favor of markdown files placed in a new `/doc`
20121
subdirectory of the repository itself. Please submit a
21122
[pull request](https://help.github.com/articles/using-pull-requests/) with your
22-
changes/additions based off the [the stable branch](https://github.com/commercialhaskell/stack/tree/stable).
123+
changes/additions based off the
124+
[the stable branch](https://github.com/commercialhaskell/stack/tree/stable).
23125

24126
The documentation is rendered on [haskellstack.org](http://haskellstack.org) by
25127
readthedocs.org using Sphinx and CommonMark. Since links and formatting vary
@@ -72,16 +174,18 @@ quality tool.
72174

73175
Note that stack contributors need not dogmatically follow the suggested hints
74176
but are encouraged to debate their usefulness. If you find a hint is not useful
75-
and detracts from readability, consider marking it in the [configuration
76-
file](https://github.com/commercialhaskell/stack/blob/master/.hlint.yaml) to
77-
be ignored. Please refer to the [HLint manual](https://github.com/ndmitchell/hlint#readme)
177+
and detracts from readability, consider marking it in the
178+
[configuration file](https://github.com/commercialhaskell/stack/blob/master/.hlint.yaml)
179+
to be ignored. Please refer to the
180+
[HLint manual](https://github.com/ndmitchell/hlint#readme)
78181
for configuration syntax.
79182

80-
Quoting [@mgsloan](https://github.com/commercialhaskell/stack/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Amgsloan):
183+
Quoting
184+
[@mgsloan](https://github.com/commercialhaskell/stack/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Amgsloan):
81185

82186
> We are optimizing for code clarity, not code concision or what HLint thinks.
83187
84-
You can install HLint with stack. You might want to install it in the global
188+
You can install HLint with Stack. You might want to install it in the global
85189
project in case you run into dependency conflicts. HLint can report hints in
86190
your favourite text editor. Refer to the HLint repository for more details.
87191

@@ -100,10 +204,12 @@ $ ./etc/scripts/hlint.sh
100204
## Testing
101205

102206
The Stack code has both unit tests and integration tests. Integration tests can
103-
be found in the [test/integration](https://github.com/commercialhaskell/stack/tree/master/test/integration)
104-
folder and unit tests, in the [src/test](https://github.com/commercialhaskell/stack/tree/master/src/test)
105-
folder. Tests are written using the [Hspec](https://hspec.github.io/) framework. In
106-
order to run the full test suite, you can simply do:
207+
be found in the
208+
[test/integration](https://github.com/commercialhaskell/stack/tree/master/test/integration)
209+
folder and unit tests, in the
210+
[src/test](https://github.com/commercialhaskell/stack/tree/master/src/test)
211+
folder. Tests are written using the [Hspec](https://hspec.github.io/) framework.
212+
In order to run the full test suite, you can simply do:
107213

108214
```bash
109215
$ stack test
@@ -197,13 +303,12 @@ if you have the appropriate permissions. If you'd specifically like a
197303
branch or PR to run integration tests, add a comment in the PR and we
198304
can queue one up.
199305

200-
201306
### Skipping build
202307

203308
There are times (like a minor type fix) where you don't want the CI to
204309
run. For those cases, you can add `[skip ci]` or `[ci skip]` in your
205-
commit message to skip the builds. For more details, [refer
206-
here](https://github.com/Microsoft/azure-pipelines-agent/issues/858#issuecomment-475768046).
310+
commit message to skip the builds. For more details,
311+
[refer here](https://github.com/Microsoft/azure-pipelines-agent/issues/858#issuecomment-475768046).
207312

208313
## Slack channel
209314

ChangeLog.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Changelog
22

3-
43
## Unreleased changes
54

65
Release notes:
@@ -35,6 +34,9 @@ Other enhancements:
3534
* Add build option `--cabal-verbosity=VERBOSITY` to specify the Cabal verbosity
3635
level (the option accepts Cabal's numerical and extended syntax).
3736
See [#1369](https://github.com/commercialhaskell/stack/issues/809)
37+
* Add the possibility of a `sh` script to customise fully GHC installation. See
38+
[#5585](https://github.com/commercialhaskell/stack/pull/5585)
39+
* `tools` subcommand added to `stack ls`, to list stack's installed tools.
3840

3941
Bug fixes:
4042

@@ -43,6 +45,11 @@ Bug fixes:
4345
* Fix an inconsistency in the pretty formatting of the output of
4446
`stack build --coverage`
4547
* Fix repeated warning about missing parameters when using `stack new`
48+
* Include `pantry-0.5.6`: Remove operational and mirror keys from bootstrap key
49+
set [#53](https://github.com/commercialhaskell/pantry/pull/53)
50+
* Pass any CPP options specified via `cpp-options:` in the `.cabal` file to GHCi
51+
using GHC's `-optP` flag. See
52+
[#5608](https://github.com/commercialhaskell/stack/pull/5608)
4653

4754
## v2.7.5
4855

doc/GUIDE.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,14 +447,17 @@ Remember above when `stack new` selected some
447447
our build plan and available packages. When we tried using the `text` package,
448448
it just worked, because it was part of the LTS *package set*.
449449

450-
But `acme-missiles` is not part of that package set, so building failed.
450+
We've specified the `acme-missiles` package in the `package.yaml` file (see
451+
above), but `acme-missiles` is not part of that LTS package set, so building
452+
failed.
451453

452-
To add this new dependency, we'll use the `extra-deps` field in `stack.yaml` to
453-
define extra dependencies not present in the resolver. You can add this like so:
454+
To add `acme-missles` to the available packages, we'll use the `extra-deps`
455+
field in the `stack.yaml` file. That field defines extra packages, not present
456+
in the resolver, that will be needed as dependencies. You can add this like so:
454457

455458
```yaml
456459
extra-deps:
457-
- acme-missiles-0.3 # not in the LTS
460+
- acme-missiles-0.3 # not in the LTS resolver
458461
```
459462
460463
Now `stack build` will succeed.

doc/yaml_configuration.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,5 +1198,69 @@ has the following effect:
11981198

11991199
This field is convenient in setups that restrict access to GitHub, for instance closed corporate setups. In this setting, it is common for the development environment to have general access to the internet, but not for testing/building environments. To avoid the firewall, one can run a local snapshots mirror and then use a custom `snapshot-location-base` in the closed environments only.
12001200

1201-
12021201
Since 2.5.0
1202+
1203+
## Customisation
1204+
1205+
### GHC installation customisation (experimental)
1206+
1207+
On Unix-like operating systems and Windows, Stack's installation procedure can
1208+
be fully customised by placing a `sh` shell script (a 'hook') in the Stack root
1209+
directory at `hooks/ghc-install.sh`. On Unix-like operating systems, the script
1210+
file must be made executable. The script is run by the `sh` application (which
1211+
is provided by MSYS2 on Windows).
1212+
1213+
The script **must** return an exit code of `0` and the standard output **must**
1214+
be the absolute path to the GHC binary that was installed. Otherwise Stack will
1215+
ignore the script and possibly fall back to its own installation procedure.
1216+
1217+
The script is not run when `system-ghc: true`.
1218+
1219+
When `install-ghc: false`, the script is still run, which allows you to ensure
1220+
that only your script will install GHC and Stack won't default to its own
1221+
installation logic, even when the script fails.
1222+
1223+
An example script is:
1224+
1225+
```sh
1226+
#!/bin/sh
1227+
1228+
set -eu
1229+
1230+
case $HOOK_GHC_TYPE in
1231+
bindist)
1232+
# install GHC here, not printing to stdout, e.g.:
1233+
# command install $HOOK_GHC_VERSION >/dev/null
1234+
;;
1235+
git)
1236+
>&2 echo "Hook doesn't support installing from source"
1237+
exit 1
1238+
;;
1239+
*)
1240+
>&2 echo "Unsupported GHC installation type: $HOOK_GHC_TYPE"
1241+
exit 2
1242+
;;
1243+
esac
1244+
1245+
echo "location/to/ghc/executable"
1246+
```
1247+
1248+
The following environment variables are always available to the script:
1249+
1250+
* `HOOK_GHC_TYPE = "bindist" | "git" | "ghcjs"`
1251+
1252+
For "bindist", additional variables are:
1253+
1254+
* `HOOK_GHC_VERSION = <ver>`
1255+
1256+
For "git", additional variables are:
1257+
1258+
* `HOOK_GHC_COMMIT = <commit>`
1259+
* `HOOK_GHC_FLAVOR = <flavor>`
1260+
1261+
For "ghcjs", additional variables are:
1262+
1263+
* `HOOK_GHC_VERSION = <ver>`
1264+
* `HOOK_GHCJS_VERSION = <ver>`
1265+
1266+
Since 2.7.X

etc/scripts/get-stack.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ post_install_separator() {
7171

7272
# determines the the CPU's instruction set
7373
get_isa() {
74-
if arch | grep -Eq 'armv[78]l?' ; then
74+
if uname -m | grep -Eq 'armv[78]l?' ; then
7575
echo arm
76-
elif arch | grep -q aarch64 ; then
76+
elif uname -m | grep -q aarch64 ; then
7777
echo aarch64
7878
else
7979
echo x86

package.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,15 @@ dependencies:
9292
- network-uri
9393
- open-browser
9494
- optparse-applicative >= 0.14.3.0
95-
- pantry >= 0.5.3
95+
- pantry >= 0.5.6
9696
- casa-client
9797
- casa-types
9898
- path
9999
- path-io
100-
- persistent
100+
# In order for Cabal (the tool) to build Stack, it needs to be told of the
101+
# upper bound on persistent. See
102+
# https://github.com/commercialhaskell/stack/pull/5677#issuecomment-1193318542
103+
- persistent < 2.14
101104
- persistent-sqlite
102105
- persistent-template
103106
- pretty

0 commit comments

Comments
 (0)