Skip to content

Commit 22fb59a

Browse files
authored
Merge branch 'master' into lsTools
2 parents f07c9cc + fc2ffeb commit 22fb59a

31 files changed

+733
-257
lines changed

.github/workflows/integration-tests.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,20 @@ jobs:
3333
steps:
3434
- name: Clone project
3535
uses: actions/checkout@v2
36-
- name: Cache dependencies
37-
uses: actions/cache@v1
36+
- name: Cache dependencies on Unix-like OS
37+
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
38+
uses: actions/cache@v3
3839
with:
3940
path: ~/.stack
4041
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
42+
- name: Cache dependencies on Windows
43+
if: startsWith(runner.os, 'Windows')
44+
uses: actions/cache@v3
45+
with:
46+
path: |
47+
~\AppData\Roaming\stack
48+
~\AppData\Local\Programs\stack
49+
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}${{ matrix.cache-bust }}
4150
- shell: bash
4251
name: Install deps and run checks
4352
run: |

.github/workflows/unit-tests.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,20 @@ jobs:
7373
steps:
7474
- name: Clone project
7575
uses: actions/checkout@v2
76-
- name: Cache dependencies
77-
uses: actions/cache@v1
76+
- name: Cache dependencies on Unix-like OS
77+
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
78+
uses: actions/cache@v3
7879
with:
7980
path: ~/.stack
8081
key: ${{ runner.os }}-${{ hashFiles( matrix.stack-yaml ) }}-${{ matrix.extra-suffix }}
82+
- name: Cache dependencies on Windows
83+
if: startsWith(runner.os, 'Windows')
84+
uses: actions/cache@v3
85+
with:
86+
path: |
87+
~\AppData\Roaming\stack
88+
~\AppData\Local\Programs\stack
89+
key: ${{ runner.os }}-${{ hashFiles( matrix.stack-yaml ) }}-${{ matrix.extra-suffix }}
8190
- shell: bash
8291
run: |
8392
set -ex

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ tags
2828
.hspec-failures
2929
better-cache/
3030
stack*.yaml.lock
31+
dist-newstyle/

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: 16 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:
@@ -21,6 +20,19 @@ Other enhancements:
2120
* Bump to `hpack-0.35.0`.
2221
* On Windows, the installer now sets `DisplayVersion` in the registry, enabling
2322
tools like `winget` to properly read the version number.
23+
* Adds flag `--script-no-run-compile` (disabled by default) that uses the
24+
`--no-run` option with `stack script` (and forces the `--compile` option).
25+
This enables a command like `stack --script-no-run-compile Script.hs` to
26+
behave like `stack script <arguments> --no-run --compile -- Script.hs` but
27+
without having to list all the `<arguments>` in the stack interpreter options
28+
comment in `Script.hs` on the command line. That may help test that scripts
29+
compile in CI (continuous integration). See
30+
[#5755](https://github.com/commercialhaskell/stack/issues/5755)
31+
* Fuller help is provided at the command line if a subcommand is missing (for
32+
example, `stack ls` now yields the equivalent of `stack ls --help`). See
33+
[#809](https://github.com/commercialhaskell/stack/issues/809)
34+
* Add the possibility of a `sh` script to customise fully GHC installation. See
35+
[#5585](https://github.com/commercialhaskell/stack/pull/5585)
2436
* `tools` subcommand added to `stack ls`, to list stack's installed tools.
2537

2638
Bug fixes:
@@ -29,6 +41,9 @@ Bug fixes:
2941
[#5714](https://github.com/commercialhaskell/stack/issues/5714)
3042
* Fix an inconsistency in the pretty formatting of the output of
3143
`stack build --coverage`
44+
* Fix repeated warning about missing parameters when using `stack new`
45+
* Include `pantry-0.5.6`: Remove operational and mirror keys from bootstrap key
46+
set [#53](https://github.com/commercialhaskell/pantry/pull/53)
3247

3348
## v2.7.5
3449

doc/GUIDE.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,6 @@ arguments, or by providing a comma or space separated list. For example:
12781278
--package http-client,http-conduit
12791279
-}
12801280
```
1281-
12821281
### Stack configuration for scripts
12831282
12841283
With the `script` command, all Stack configuration files are ignored to provide
@@ -1315,6 +1314,33 @@ a multi line block comment with ghc options:
13151314
-}
13161315
```
13171316
1317+
### Testing scripts
1318+
1319+
You can use the flag `--script-no-run-compile` on the command line to enable (it
1320+
is disabled by default) the use of the `--no-run` option with `stack script`
1321+
(and forcing the `--compile` option). The flag may help test that scripts
1322+
compile in CI (continuous integration).
1323+
1324+
For example, consider the following simple script, in a file named `Script.hs`,
1325+
which makes use of the joke package
1326+
[`acme-missiles`](https://hackage.haskell.org/package/acme-missiles):
1327+
```
1328+
{- stack script
1329+
--resolver lts-19.9
1330+
--package acme-missiles
1331+
-}
1332+
import Acme.Missiles (launchMissiles)
1333+
1334+
main :: IO ()
1335+
main = launchMissiles
1336+
```
1337+
The command `stack --script-no-run-compile Script.hs` then behaves as if the
1338+
command
1339+
`stack script --resolver lts-19.9 --package acme-missiles --no-run --compile -- Script.hs`
1340+
had been given (see further below about the `stack script` command). `Script.hs`
1341+
is compiled (without optimisation) and the resulting executable is not run: no
1342+
missiles are launched in the process!
1343+
13181344
### Writing independent and reliable scripts
13191345
13201346
With the release of Stack 1.4.0, there is a new command, `script`, which will

0 commit comments

Comments
 (0)