Skip to content

Commit 64300ad

Browse files
authored
Merge pull request #9 from OxfordAbstracts/with-restaumatic
With restaumatic
2 parents b3c0a40 + 73ba6b8 commit 64300ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2708
-1089
lines changed

.github/workflows/ci.yml

Lines changed: 49 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: "CI"
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: ["master", "restaumatic"]
66
pull_request:
7-
branches: [ "master" ]
7+
branches: ["master", "restaumatic"]
88
paths:
99
- .github/workflows/**/*.yml
1010
- app/**/*
@@ -20,10 +20,11 @@ on:
2020
- purescript.cabal
2121
- Setup.hs
2222
- stack.yaml
23+
- stack.yaml.lock
2324
- update-changelog.hs
2425
- weeder.dhall
2526
release:
26-
types: [ "published" ]
27+
types: ["published"]
2728

2829
defaults:
2930
run:
@@ -32,7 +33,7 @@ defaults:
3233
env:
3334
CI_PRERELEASE: "${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}"
3435
CI_RELEASE: "${{ github.event_name == 'release' }}"
35-
STACK_VERSION: "2.15.1"
36+
STACK_VERSION: "3.3.1"
3637

3738
concurrency:
3839
# We never want two prereleases building at the same time, since they would
@@ -53,16 +54,18 @@ jobs:
5354
fail-fast: false # do not cancel builds for other OSes if one fails
5455
matrix:
5556
include:
56-
- # If upgrading the Haskell image, also upgrade it in the lint job below
57-
os: ["ubuntu-latest"]
58-
image: haskell:9.2.8@sha256:b3b2f3909c7381bb96b8f18766f9407a3d6f61e0f07ea95e812583ac4f442cbb
59-
- os: ["macOS-14"]
60-
- os: ["windows-2019"]
61-
- os: ["self-hosted", "macos", "ARM64"]
62-
- os: ["self-hosted", "Linux", "ARM64"]
57+
- image: haskell:9.6.6 # Also upgrade version in the lint job below
58+
os: ubuntu-latest # Exact version is not important, as it's only the container host)
59+
60+
- image: haskell:9.6.6
61+
os: ubuntu-24.04-arm # Exact version is not important, as it's only the container host
62+
63+
- os: macos-13 # x64
64+
- os: macos-14 # arm64
65+
- os: windows-2019 # x64
6366

6467
runs-on: "${{ matrix.os }}"
65-
container: "${{ matrix.image }}"
68+
container: "${{ matrix.image }}"
6669

6770
outputs:
6871
do-not-prerelease: "${{ steps.build.outputs.do-not-prerelease }}"
@@ -71,43 +74,40 @@ jobs:
7174
steps:
7275
- # We need `gh` installed on the Linux version. Otherwise, release artifacts won't be uploaded.
7376
name: "(Linux only) Install gh"
74-
if: "contains(matrix.os, 'ubuntu-latest')"
77+
if: startsWith(matrix.image, 'haskell')
7578
run: |
7679
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
7780
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
7881
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
7982
apt-get update
80-
apt-get install gh
83+
apt-get install -y gh
8184
82-
- uses: "actions/checkout@v2"
83-
- uses: "actions/setup-node@v2"
85+
- uses: "actions/checkout@v4"
86+
- uses: "actions/setup-node@v4"
8487
with:
85-
node-version: "16"
88+
node-version: "22"
8689

8790
- id: "haskell"
8891
name: "(Non-Linux only) Install Haskell"
89-
# Note: here we exclude the self-hosted runners because this action does not work on ARM
90-
# and their Haskell environment is instead provided by a nix-shell
91-
# See https://github.com/purescript/purescript/pulls/4455
92-
if: "!contains(matrix.os, 'ubuntu-latest') && !contains(matrix.os, 'self-hosted')"
92+
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')
9393
uses: "haskell-actions/setup@v2"
9494
with:
95+
ghc-version: "9.6.6"
9596
enable-stack: true
9697
stack-version: "${{ env.STACK_VERSION }}"
9798
stack-no-global: true
9899

99-
- name: "(Linux only) Check Stack version and fix working directory ownership"
100-
if: "contains(matrix.os, 'ubuntu-latest')"
100+
- name: "(Linux only) Fix working directory ownership"
101+
if: startsWith(matrix.image, 'haskell')
101102
run: |
102-
[ "$(stack --numeric-version)" = "$STACK_VERSION" ]
103103
chown root:root .
104104
105-
- uses: "actions/cache@v2"
105+
- uses: "actions/cache@v4"
106106
with:
107107
path: |
108108
/root/.stack
109109
${{ steps.haskell.outputs.stack-root }}
110-
key: "${{ matrix.image || runner.os }}--MdyPsf-${{ hashFiles('stack.yaml') }}"
110+
key: "${{ matrix.image || runner.os }}--MdyPsf-${{ hashFiles('stack.yaml.lock', 'purescript.cabal') }}"
111111

112112
- name: "(Windows only) Configure Stack to store its programs in STACK_ROOT"
113113
# This ensures that the local GHC and MSYS binaries that Stack installs
@@ -122,16 +122,16 @@ jobs:
122122
run: "ci/fix-home ci/build.sh"
123123

124124
- name: "(Linux only) Glob tests"
125-
if: "contains(matrix.os, 'ubuntu-latest')"
125+
if: startsWith(matrix.image, 'haskell')
126126
working-directory: "sdist-test"
127127
# We build in this directory in build.sh, so this is where we need to
128128
# launch `stack exec`. The actual glob checks happen in a temporary directory.
129129
run: |
130-
apt-get install tree
130+
apt-get install -y tree
131131
../ci/fix-home stack exec bash ../glob-test.sh
132132
133133
- name: "(Linux only) Build the entire package set"
134-
if: "contains(matrix.os, 'ubuntu-latest')"
134+
if: startsWith(matrix.image, 'haskell')
135135
# We build in this directory in build.sh, so this is where we need to
136136
# launch `stack exec`. The actual package-set building happens in a
137137
# temporary directory.
@@ -144,11 +144,11 @@ jobs:
144144
# Moreover, npm has a hook issue that will cause spago to fail to install
145145
# We upgrade npm to fix this
146146
run: |
147-
npm i -g npm@8.8.0
147+
apt-get install -y jq
148148
../ci/fix-home stack --haddock exec ../ci/build-package-set.sh
149149
150150
- name: Verify that 'libtinfo' isn't in binary
151-
if: "runner.os == 'Linux'"
151+
if: runner.os == 'Linux'
152152
working-directory: "sdist-test"
153153
run: |
154154
if [ $(ldd $(../ci/fix-home stack path --local-doc-root)/../bin/purs | grep 'libtinfo' | wc -l) -ge 1 ]; then
@@ -157,17 +157,6 @@ jobs:
157157
exit 1
158158
fi
159159
160-
- name: "(Self-hosted Linux ARM64 only) Patch the binary to work on non-Nix systems"
161-
if: "runner.os == 'Linux' && runner.arch == 'ARM64'"
162-
working-directory: "sdist-test"
163-
# The self-hosted build happens inside a nix-shell that provides a working stack binary
164-
# on ARM systems, and while the macOS binary is fine - because macOS binaries are almost
165-
# statically linked), the linux ones are all pointing at the nix store.
166-
# So here we first point the binary to the right linker that should work on a generic linux,
167-
# and then fix the RUNPATH with the right location to load the shared libraries from
168-
run: |
169-
patchelf --set-interpreter /usr/lib/ld-linux-aarch64.so.1 --set-rpath /usr/lib/aarch64-linux-gnu $(stack path --local-doc-root)/../bin/purs
170-
171160
- name: "(Release/prerelease only) Create bundle"
172161
if: "${{ env.CI_RELEASE == 'true' || env.CI_PRERELEASE == 'true' && steps.build.outputs.do-not-prerelease != 'true' }}"
173162
run: |
@@ -199,7 +188,7 @@ jobs:
199188
200189
- name: "(Prerelease only) Upload bundle"
201190
if: "${{ env.CI_PRERELEASE == 'true' && steps.build.outputs.do-not-prerelease != 'true' }}"
202-
uses: "actions/upload-artifact@v3"
191+
uses: "actions/upload-artifact@v4.6.0"
203192
with:
204193
name: "${{ runner.os }}-${{ runner.arch }}-bundle"
205194
path: |
@@ -208,86 +197,68 @@ jobs:
208197
209198
- name: "(Release only) Publish bundle"
210199
if: "${{ env.CI_RELEASE == 'true' }}"
211-
# This requires the gh command line tool to be installed on our
212-
# self-hosted runners
213200
env:
214201
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
215202
run: "gh release upload --clobber ${{ github.ref_name }} sdist-test/bundle/*.{tar.gz,sha}"
216203

217204
lint:
218-
runs-on: "ubuntu-latest"
219-
# At the moment, this is a different image from the image used for
220-
# compilation, though the GHC versions match. This is because the
221-
# compilation image uses an old version of glibc, which we want because it
222-
# means our published binaries will work on the widest number of platforms.
223-
# But the HLint binary downloaded by this job requires a newer glibc
224-
# version.
225-
container: haskell:9.2.8@sha256:b3b2f3909c7381bb96b8f18766f9407a3d6f61e0f07ea95e812583ac4f442cbb
205+
container: haskell:9.6.6
206+
runs-on: ubuntu-latest # Exact version is not important, as it's only the container host
226207

227208
steps:
228-
- uses: "actions/checkout@v2"
209+
- uses: "actions/checkout@v4"
229210

230211
- name: "Fix working directory ownership"
231212
run: |
232213
chown root:root .
233214
234-
- uses: "actions/cache@v2"
215+
- uses: "actions/cache@v4"
235216
with:
236217
path: |
237218
/root/.stack
238-
key: "lint-${{ hashFiles('stack.yaml') }}"
219+
key: "lint-${{ hashFiles('stack.yaml.lock', 'purescript.cabal') }}"
239220

240221
- run: "ci/fix-home ci/run-hlint.sh --git"
241222
env:
242223
VERSION: "3.5"
243224

244-
# Note: the weeder version will need to be updated when we next update our version
245-
# of GHC.
246-
#
247-
# weeder-2.2.0 has somewhat strange version deps. It doesn't appear to
248-
# support the exact versions of dhall and generic-lens in LTS-18.
249-
# However, forcing it to use the versions of dhall and generic-lens in
250-
# LTS-18 doesn't cause any problems when building, so the following
251-
# commands build weeder while ignoring version constraints.
252225
- name: Install weeder
253226
run: |
254-
# The `stack.yaml` file is copied to a separate file so that
255-
# adding `allow-newer: true` doesn't affect any subsequant
256-
# calls to `stack`.
257-
cp stack.yaml stack-weeder.yaml
258-
# `allow-newer: true` is needed so that weeder-2.2.0 can be
259-
# installed with the dependencies present in LTS-18.
260-
echo 'allow-newer: true' >> stack-weeder.yaml
261-
ci/fix-home stack --no-terminal --jobs=2 build --copy-compiler-tool --stack-yaml ./stack-weeder.yaml weeder-2.4.0
227+
ci/fix-home stack --no-terminal --jobs=2 \
228+
build --copy-compiler-tool weeder-2.8.0
262229
263-
- run: "ci/fix-home stack --no-terminal --jobs=2 build --fast --ghc-options -fwrite-ide-info"
230+
- run: |
231+
ci/fix-home stack --no-terminal --jobs=2 \
232+
build --fast --ghc-options -fwrite-ide-info
264233
265234
- run: "ci/fix-home stack exec weeder"
266235

267236
# Now do it again, with the test suite included. We don't want a
268237
# reference from our test suite to count in the above check; the fact
269238
# that a function is tested is not evidence that it's needed. But we also
270239
# don't want to leave weeds lying around in our test suite either.
271-
- run: "ci/fix-home stack --no-terminal --jobs=2 build --fast --test --no-run-tests --ghc-options -fwrite-ide-info"
240+
- run: |
241+
ci/fix-home stack --no-terminal --jobs=2 \
242+
build --fast --test --no-run-tests --ghc-options -fwrite-ide-info
272243
273244
- run: "ci/fix-home stack exec weeder"
274245

275246
make-prerelease:
276-
runs-on: "ubuntu-latest"
247+
runs-on: ubuntu-latest
277248
needs:
278249
- "build"
279250
- "lint"
280251
if: "${{ github.event_name == 'push' && needs.build.outputs.do-not-prerelease != 'true' }}"
281252
steps:
282-
- uses: "actions/download-artifact@v3"
253+
- uses: "actions/download-artifact@v4"
283254
- uses: "ncipollo/release-action@v1.10.0"
284255
with:
285256
tag: "v${{ needs.build.outputs.version }}"
286257
artifacts: "*-bundle/*"
287258
prerelease: true
288259
body: "This is an automated preview release. Get the latest stable release [here](https://github.com/purescript/purescript/releases/latest)."
289-
- uses: "actions/checkout@v3"
290-
- uses: "actions/setup-node@v3"
260+
- uses: "actions/checkout@v4"
261+
- uses: "actions/setup-node@v4"
291262
with:
292263
node-version: "16.x"
293264
registry-url: "https://registry.npmjs.org"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ bin
33
dist
44
cabal-dev
55
.cabal-sandbox
6-
stack.yaml.lock
76
cabal.sandbox.config
87
dist-newstyle/
98
cabal.project.local*
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Upgrade GHC to [`9.6.6`](https://downloads.haskell.org/~ghc/9.6.6/docs/users_guide/9.6.6-notes.html), Stackage LTS `22.43`
2+
* Minimum required glibc version is bumped from [`2.28` to `2.31`](https://sourceware.org/glibc/wiki/Glibc%20Timeline)

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ If you would prefer to use different terms, please use the section below instead
1616
| :------- | :--- | :------ |
1717
| [@5outh](https://github.com/5outh) | Benjamin Kovach | [MIT license] |
1818
| [@actionshrimp](https://github.com/actionshrimp) | David Aitken | [MIT license] |
19+
| [@ad-si](https://github.com/ad-si) | Adrian Sieber | [MIT license] |
1920
| [@adnelson](https://github.com/adnelson) | Allen Nelson | [MIT license] |
2021
| [@alexbiehl](https://github.com/alexbiehl) | Alexander Biehl | [MIT license] |
2122
| [@andreypopp](https://github.com/andreypopp) | Andrey Popp | [MIT license] |

INSTALL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ If you are having difficulty installing the PureScript compiler, feel free to as
44

55
## Requirements
66

7-
The PureScript compiler is built using GHC 9.2.8, and should be able to run on any operating system supported by GHC 9.2.8. In particular:
7+
The PureScript compiler is built using GHC 9.6.6, and should be able to run on any operating system supported by GHC 9.6.6.
8+
In particular:
89

910
* for Windows users, versions predating Vista are not officially supported,
1011
* for macOS / OS X users, versions predating Mac OS X 10.7 (Lion) are not officially supported.
1112

12-
See also <https://www.haskell.org/ghc/download_ghc_9_2_8.html> for more details about the operating systems which GHC 9.2.8 supports.
13+
See also <https://www.haskell.org/ghc/download_ghc_9_6_6.html> for more details about the operating systems which GHC 9.6.6 supports.
1314

1415
## Official prebuilt binaries
1516

LICENSE

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ PureScript uses the following Haskell library packages. Their license files foll
107107
optparse-applicative
108108
parallel
109109
parsec
110-
pattern-arrows
111110
pretty
112111
primitive
113112
process
@@ -3186,29 +3185,6 @@ parsec LICENSE file:
31863185
negligence or otherwise) arising in any way out of the use of this software,
31873186
even if advised of the possibility of such damage.
31883187

3189-
pattern-arrows LICENSE file:
3190-
3191-
The MIT License (MIT)
3192-
3193-
Copyright (c) 2013 Phil Freeman
3194-
3195-
Permission is hereby granted, free of charge, to any person obtaining a copy of
3196-
this software and associated documentation files (the "Software"), to deal in
3197-
the Software without restriction, including without limitation the rights to
3198-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
3199-
the Software, and to permit persons to whom the Software is furnished to do so,
3200-
subject to the following conditions:
3201-
3202-
The above copyright notice and this permission notice shall be included in all
3203-
copies or substantial portions of the Software.
3204-
3205-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3206-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
3207-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
3208-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
3209-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3210-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3211-
32123188
pretty LICENSE file:
32133189

32143190
This library (libraries/pretty) is derived from code from

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package = purescript
44
exe_target = purs
55
stack_yaml = STACK_YAML="stack.yaml"
66
stack = $(stack_yaml) stack
7+
stack_dir = .stack-work
78

89
.DEFAULT_GOAL := help
910

@@ -14,6 +15,10 @@ $(bin_dir)/hlint: ci/install-hlint.sh
1415
clean: ## Remove build artifacts
1516
rm -fr $(bin_dir)
1617
rm -fr $(build_dir)
18+
rm -fr $(stack_dir)
19+
rm -fr dist-newstyle
20+
rm -fr .psci_modules
21+
rm -fr .test_modules
1722

1823
help: ## Print documentation
1924
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

app/Command/Compile.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ compile PSCMakeOptions{..} = do
7575
let filePathMap = M.fromList $ map (\(fp, pm) -> (P.getModuleName $ CST.resPartial pm, Right fp)) ms
7676
foreigns <- inferForeignModules filePathMap
7777
let makeActions = buildMakeActions pscmOutputDir filePathMap foreigns pscmUsePrefix
78-
P.make makeActions (map snd ms)
78+
P.make_ makeActions (map snd ms)
7979
printWarningsAndErrors (P.optionsVerboseErrors pscmOpts) pscmJSONErrors moduleFiles makeWarnings makeErrors
8080
exitSuccess
8181

0 commit comments

Comments
 (0)