Skip to content

Commit ee43f4a

Browse files
Merge pull request #361 from haskellfoundation/stack
Add the first documented Stack message
2 parents 26c5c12 + 6d4e156 commit ee43f4a

File tree

14 files changed

+120
-25
lines changed

14 files changed

+120
-25
lines changed

.fend.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ skip:
55
- message-index/js/highlight.min.js
66
- message-index/js/tablefilter.js
77

8+
# This one's empty and thus can't end with a newline
9+
- message-index/messages/S-6602/empty/before/empty.yaml
10+
811
extension:
912
- .hi
1013
- .o

.github/workflows/deploy.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Select GHC 9.2.4
17-
run: ghcup set 9.2.4
16+
- name: Install GHC 9.2.5
17+
run: ghcup install ghc 9.2.5
18+
19+
- name: Select GHC 9.2.5
20+
run: ghcup set ghc 9.2.5
1821

1922
- name: Check out repo
2023
uses: actions/checkout@v3

.github/workflows/pullrequest-ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Select GHC 9.2.4
15-
run: ghcup set 9.2.4
14+
- name: Install GHC 9.2.5
15+
run: ghcup install ghc 9.2.5
16+
17+
- name: Select GHC 9.2.5
18+
run: ghcup set ghc 9.2.5
1619

1720
- name: Check out repo
1821
uses: actions/checkout@v3

CONTRIBUTING.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,23 @@ To document a new error code, the following workflow can be convenient.
4848

4949
### Task Lists
5050

51-
We keep track of which errors are being worked on, and which still require documentation,
51+
We keep track of which GHC errors are being worked on, and which still require documentation,
5252
using a bunch of issues:
5353

5454
- [All error codes that still need documenting are collected here](https://github.com/haskellfoundation/error-message-index/issues/162). This issue contains links to individual issues for every error, allowing the list to be updated as PRs are merged. These individual issues for every error may also contain helpful links to test cases, suggestions on examples, and useful metadata to a contributor.
5555
- There is also an (incomplete) list of issues tagged `good first issue`; these are errors which are especially good for newer contributors to document (no incredibly esoteric type-level errors that are hard to understand, let alone describe!): https://github.com/haskellfoundation/error-message-index/labels/good%20first%20issue
5656
- Issues related to improving the site, the workflow for contributing, or other information are tagged `error-message-index-site`: https://github.com/haskellfoundation/error-message-index/labels/error-message-index-site
5757
- Issues related to improving, clarifying, or extending existing documentation are tagged `error-message-index-improvements`: https://github.com/haskellfoundation/error-message-index/labels/error-message-index-improvements
5858

59+
## Building Stack with Error Codes
60+
61+
The next release of Stack will also include error codes. Until it is
62+
released, building a Git version (which just requires an existing
63+
install of Stack) is sufficient to get the codes. An unreleased version
64+
of Stack can be obtained with Stack by using the command
65+
`stack upgrade --source-only --git`. However, if you used GHCup to
66+
install Stack, you should also use GHCup to upgrade Stack.
67+
5968
## Contributing New Messages
6069

6170
The Haskell Message Index is generated from a collection of files on
@@ -64,8 +73,8 @@ disk using Hakyll. Inside the top-level of the site source, there is a
6473
a message whose name is the message code. This subdirectory contains a
6574
file `index.md` that describes the message. Additionally,
6675
subdirectories of the message directory may represent examples - each
67-
example contains a file `index.md` as well as a number of Haskell
68-
files that represent the example.
76+
example contains a file `index.md` as well as a number of Haskell,
77+
Cabal, or YAML files that represent the example.
6978

7079
A message with ID `GHC-123` and two examples might have the following structure:
7180

@@ -87,10 +96,10 @@ named as specified here, while the other components may vary.
8796
You can also use the `makeFolder.sh` templating script. Usage is as follows:
8897

8998
```bash
90-
./makeFolder.sh <NUMERIC-ERROR-CODE> <HaskellModuleName>
99+
./makeFolder.sh <NAMESPACE>-<NUMERIC_ERROR_CODE> <HaskellModuleName>
91100
```
92101

93-
This will generate a folder called `GHC-NUMERIC_ERROR_CODE` containing an empty `index.md` file, a subfolder called `example1` with a corresponding `index.md`, and two blank `before`/`after` Haskell source files.
102+
This will generate a folder called `NAMESPACE-NUMERIC_ERROR_CODE` containing an empty `index.md` file, a subfolder called `example1` with a corresponding `index.md`, and two blank `before`/`after` Haskell source files. Use `GHC` as `NAMESPACE` to document GHC error messages, and `S` as `NAMESPACE` to document Stack errors.
94103

95104
### Message Descriptions
96105

@@ -133,7 +142,6 @@ field. All `.hs` files are shown in the list of files for the
133142
example. The `index.md` file should explain how the files illustrate
134143
the message.
135144

136-
137145
## Contributing to the Site
138146

139147
The site is generated using [Hakyll](https://jaspervdj.be/hakyll/).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
resolver: lts-19.17

message-index/messages/S-6602/empty/before/empty.yaml

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Stack does not accept empty YAML files
3+
---
4+
5+
When run with an empty YAML file, Stack fails to parse it. For example, `stack --stack-yaml empty.yaml build` results in the error:
6+
```
7+
Error: [S-6602]
8+
Stack could not load and parse /PATH/TO/empty.yaml as a YAML
9+
configuraton file.
10+
11+
While loading and parsing, Stack encountered the following exception:
12+
13+
Aeson exception:
14+
Error in $: parsing ProjectAndConfigMonoid failed, expected Object, but encountered Null
15+
16+
For help about the content of Stack's YAML configuration files, see (for the most recent release of
17+
Stack) http://docs.haskellstack.org/en/stable/yaml_configuration/.
18+
```
19+
20+
This error in a [project-level `stack.yaml` file](https://docs.haskellstack.org/en/stable/yaml_configuration/#project-specific-configuration) can be fixed by specifying a resolver, which is the minimal `stack.yaml` configuration.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Could not parse YAML configuration file
3+
summary: Test summary
4+
severity: error
5+
introduced: 2.9.3
6+
---
7+
8+
This error occurs when Stack is unable to parse a YAML configuration file, which could be a project-level `stack.yaml` file or a global `config.yaml` file. The error covers the following situations:
9+
10+
* The specified configuration file does not exist
11+
* The configuration file is not well-formed YAML
12+
* The file is well-formed YAML but does not match the expected data schema
13+
14+
The expected file formats are described in [the Stack documentation](https://docs.haskellstack.org/en/stable/yaml_configuration/).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
resolver: lts-19.17
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
]

0 commit comments

Comments
 (0)