Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 46 additions & 75 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- purescript.cabal
- Setup.hs
- stack.yaml
- stack.yaml.lock
- update-changelog.hs
- weeder.dhall
release:
Expand All @@ -32,7 +33,7 @@ defaults:
env:
CI_PRERELEASE: "${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}"
CI_RELEASE: "${{ github.event_name == 'release' }}"
STACK_VERSION: "2.15.1"
STACK_VERSION: "3.3.1"

concurrency:
# We never want two prereleases building at the same time, since they would
Expand All @@ -53,16 +54,18 @@ jobs:
fail-fast: false # do not cancel builds for other OSes if one fails
matrix:
include:
- # If upgrading the Haskell image, also upgrade it in the lint job below
os: ["ubuntu-latest"]
image: haskell:9.2.8@sha256:b3b2f3909c7381bb96b8f18766f9407a3d6f61e0f07ea95e812583ac4f442cbb
- os: ["macOS-14"]
- os: ["windows-2019"]
- os: ["self-hosted", "macos", "ARM64"]
- os: ["self-hosted", "Linux", "ARM64"]
- image: haskell:9.6.6 # Also upgrade version in the lint job below
os: ubuntu-latest # Exact version is not important, as it's only the container host)

- image: haskell:9.6.6
os: ubuntu-24.04-arm # Exact version is not important, as it's only the container host

- os: macos-13 # x64
- os: macos-14 # arm64
- os: windows-2019 # x64

runs-on: "${{ matrix.os }}"
container: "${{ matrix.image }}"
container: "${{ matrix.image }}"

outputs:
do-not-prerelease: "${{ steps.build.outputs.do-not-prerelease }}"
Expand All @@ -71,43 +74,40 @@ jobs:
steps:
- # We need `gh` installed on the Linux version. Otherwise, release artifacts won't be uploaded.
name: "(Linux only) Install gh"
if: "contains(matrix.os, 'ubuntu-latest')"
if: startsWith(matrix.image, 'haskell')
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
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
apt-get update
apt-get install gh
apt-get install -y gh

- uses: "actions/checkout@v2"
- uses: "actions/setup-node@v2"
- uses: "actions/checkout@v4"
- uses: "actions/setup-node@v4"
with:
node-version: "16"
node-version: "22"

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

- name: "(Linux only) Check Stack version and fix working directory ownership"
if: "contains(matrix.os, 'ubuntu-latest')"
- name: "(Linux only) Fix working directory ownership"
if: startsWith(matrix.image, 'haskell')
run: |
[ "$(stack --numeric-version)" = "$STACK_VERSION" ]
chown root:root .

- uses: "actions/cache@v2"
- uses: "actions/cache@v4"
with:
path: |
/root/.stack
${{ steps.haskell.outputs.stack-root }}
key: "${{ matrix.image || runner.os }}--MdyPsf-${{ hashFiles('stack.yaml') }}"
key: "${{ matrix.image || runner.os }}--MdyPsf-${{ hashFiles('stack.yaml.lock', 'purescript.cabal') }}"

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

- name: "(Linux only) Glob tests"
if: "contains(matrix.os, 'ubuntu-latest')"
if: startsWith(matrix.image, 'haskell')
working-directory: "sdist-test"
# We build in this directory in build.sh, so this is where we need to
# launch `stack exec`. The actual glob checks happen in a temporary directory.
run: |
apt-get install tree
apt-get install -y tree
../ci/fix-home stack exec bash ../glob-test.sh

- name: "(Linux only) Build the entire package set"
if: "contains(matrix.os, 'ubuntu-latest')"
if: startsWith(matrix.image, 'haskell')
# We build in this directory in build.sh, so this is where we need to
# launch `stack exec`. The actual package-set building happens in a
# temporary directory.
Expand All @@ -144,11 +144,11 @@ jobs:
# Moreover, npm has a hook issue that will cause spago to fail to install
# We upgrade npm to fix this
run: |
npm i -g npm@8.8.0
apt-get install -y jq
../ci/fix-home stack --haddock exec ../ci/build-package-set.sh

- name: Verify that 'libtinfo' isn't in binary
if: "runner.os == 'Linux'"
if: runner.os == 'Linux'
working-directory: "sdist-test"
run: |
if [ $(ldd $(../ci/fix-home stack path --local-doc-root)/../bin/purs | grep 'libtinfo' | wc -l) -ge 1 ]; then
Expand All @@ -157,17 +157,6 @@ jobs:
exit 1
fi

- name: "(Self-hosted Linux ARM64 only) Patch the binary to work on non-Nix systems"
if: "runner.os == 'Linux' && runner.arch == 'ARM64'"
working-directory: "sdist-test"
# The self-hosted build happens inside a nix-shell that provides a working stack binary
# on ARM systems, and while the macOS binary is fine - because macOS binaries are almost
# statically linked), the linux ones are all pointing at the nix store.
# So here we first point the binary to the right linker that should work on a generic linux,
# and then fix the RUNPATH with the right location to load the shared libraries from
run: |
patchelf --set-interpreter /usr/lib/ld-linux-aarch64.so.1 --set-rpath /usr/lib/aarch64-linux-gnu $(stack path --local-doc-root)/../bin/purs

- name: "(Release/prerelease only) Create bundle"
if: "${{ env.CI_RELEASE == 'true' || env.CI_PRERELEASE == 'true' && steps.build.outputs.do-not-prerelease != 'true' }}"
run: |
Expand Down Expand Up @@ -199,7 +188,7 @@ jobs:

- name: "(Prerelease only) Upload bundle"
if: "${{ env.CI_PRERELEASE == 'true' && steps.build.outputs.do-not-prerelease != 'true' }}"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4.6.0"
with:
name: "${{ runner.os }}-${{ runner.arch }}-bundle"
path: |
Expand All @@ -208,86 +197,68 @@ jobs:

- name: "(Release only) Publish bundle"
if: "${{ env.CI_RELEASE == 'true' }}"
# This requires the gh command line tool to be installed on our
# self-hosted runners
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: "gh release upload --clobber ${{ github.ref_name }} sdist-test/bundle/*.{tar.gz,sha}"

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

steps:
- uses: "actions/checkout@v2"
- uses: "actions/checkout@v4"

- name: "Fix working directory ownership"
run: |
chown root:root .

- uses: "actions/cache@v2"
- uses: "actions/cache@v4"
with:
path: |
/root/.stack
key: "lint-${{ hashFiles('stack.yaml') }}"
key: "lint-${{ hashFiles('stack.yaml.lock', 'purescript.cabal') }}"

- run: "ci/fix-home ci/run-hlint.sh --git"
env:
VERSION: "3.5"

# Note: the weeder version will need to be updated when we next update our version
# of GHC.
#
# weeder-2.2.0 has somewhat strange version deps. It doesn't appear to
# support the exact versions of dhall and generic-lens in LTS-18.
# However, forcing it to use the versions of dhall and generic-lens in
# LTS-18 doesn't cause any problems when building, so the following
# commands build weeder while ignoring version constraints.
- name: Install weeder
run: |
# The `stack.yaml` file is copied to a separate file so that
# adding `allow-newer: true` doesn't affect any subsequant
# calls to `stack`.
cp stack.yaml stack-weeder.yaml
# `allow-newer: true` is needed so that weeder-2.2.0 can be
# installed with the dependencies present in LTS-18.
echo 'allow-newer: true' >> stack-weeder.yaml
ci/fix-home stack --no-terminal --jobs=2 build --copy-compiler-tool --stack-yaml ./stack-weeder.yaml weeder-2.4.0
ci/fix-home stack --no-terminal --jobs=2 \
build --copy-compiler-tool weeder-2.8.0

- run: "ci/fix-home stack --no-terminal --jobs=2 build --fast --ghc-options -fwrite-ide-info"
- run: |
ci/fix-home stack --no-terminal --jobs=2 \
build --fast --ghc-options -fwrite-ide-info

- run: "ci/fix-home stack exec weeder"

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

- run: "ci/fix-home stack exec weeder"

make-prerelease:
runs-on: "ubuntu-latest"
runs-on: ubuntu-latest
needs:
- "build"
- "lint"
if: "${{ github.event_name == 'push' && needs.build.outputs.do-not-prerelease != 'true' }}"
steps:
- uses: "actions/download-artifact@v3"
- uses: "actions/download-artifact@v4"
- uses: "ncipollo/release-action@v1.10.0"
with:
tag: "v${{ needs.build.outputs.version }}"
artifacts: "*-bundle/*"
prerelease: true
body: "This is an automated preview release. Get the latest stable release [here](https://github.com/purescript/purescript/releases/latest)."
- uses: "actions/checkout@v3"
- uses: "actions/setup-node@v3"
- uses: "actions/checkout@v4"
- uses: "actions/setup-node@v4"
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ bin
dist
cabal-dev
.cabal-sandbox
stack.yaml.lock
cabal.sandbox.config
dist-newstyle/
cabal.project.local*
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.d/internal_upgrade_to_ghc_9.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* 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`
* Minimum required glibc version is bumped from [`2.28` to `2.31`](https://sourceware.org/glibc/wiki/Glibc%20Timeline)
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ If you would prefer to use different terms, please use the section below instead
| :------- | :--- | :------ |
| [@5outh](https://github.com/5outh) | Benjamin Kovach | [MIT license] |
| [@actionshrimp](https://github.com/actionshrimp) | David Aitken | [MIT license] |
| [@ad-si](https://github.com/ad-si) | Adrian Sieber | [MIT license] |
| [@adnelson](https://github.com/adnelson) | Allen Nelson | [MIT license] |
| [@alexbiehl](https://github.com/alexbiehl) | Alexander Biehl | [MIT license] |
| [@andreypopp](https://github.com/andreypopp) | Andrey Popp | [MIT license] |
Expand Down
5 changes: 3 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ If you are having difficulty installing the PureScript compiler, feel free to as

## Requirements

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:
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.
In particular:

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

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.
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.

## Official prebuilt binaries

Expand Down
24 changes: 0 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ PureScript uses the following Haskell library packages. Their license files foll
optparse-applicative
parallel
parsec
pattern-arrows
pretty
primitive
process
Expand Down Expand Up @@ -3186,29 +3185,6 @@ parsec LICENSE file:
negligence or otherwise) arising in any way out of the use of this software,
even if advised of the possibility of such damage.

pattern-arrows LICENSE file:

The MIT License (MIT)

Copyright (c) 2013 Phil Freeman

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

pretty LICENSE file:

This library (libraries/pretty) is derived from code from
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package = purescript
exe_target = purs
stack_yaml = STACK_YAML="stack.yaml"
stack = $(stack_yaml) stack
stack_dir = .stack-work

.DEFAULT_GOAL := help

Expand All @@ -14,6 +15,10 @@ $(bin_dir)/hlint: ci/install-hlint.sh
clean: ## Remove build artifacts
rm -fr $(bin_dir)
rm -fr $(build_dir)
rm -fr $(stack_dir)
rm -fr dist-newstyle
rm -fr .psci_modules
rm -fr .test_modules

help: ## Print documentation
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down
15 changes: 8 additions & 7 deletions app/Command/Docs.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import Language.PureScript.Docs qualified as D
import Language.PureScript.Docs.Tags (dumpCtags, dumpEtags)
import Language.PureScript.Glob (PSCGlobs(..), toInputGlobs, warnFileTypeNotFound)
import Options.Applicative qualified as Opts
import Text.PrettyPrint.ANSI.Leijen qualified as PP
import Prettyprinter qualified as PP
import Prettyprinter.Render.Terminal (AnsiStyle)
import SharedCLI qualified
import System.Directory (getCurrentDirectory, createDirectoryIfMissing, removeFile)
import System.Exit (exitFailure)
Expand Down Expand Up @@ -113,10 +114,10 @@ defaultOutputForFormat fmt =
Ctags -> "tags"

pscDocsOptions :: Opts.Parser PSCDocsOptions
pscDocsOptions =
PSCDocsOptions <$> format
<*> output
<*> compileOutputDir
pscDocsOptions =
PSCDocsOptions <$> format
<*> output
<*> compileOutputDir
<*> many SharedCLI.inputFile
<*> SharedCLI.globInputFile
<*> many SharedCLI.excludeFiles
Expand Down Expand Up @@ -150,9 +151,9 @@ infoModList :: Opts.InfoMod a
infoModList = Opts.fullDesc <> footerInfo where
footerInfo = Opts.footerDoc $ Just examples

examples :: PP.Doc
examples :: PP.Doc AnsiStyle
examples =
PP.vcat $ map PP.text
PP.vcat
[ "Examples:"
, " write documentation for all modules to ./generated-docs:"
, " purs docs \"src/**/*.purs\" \".psc-package/*/*/*/src/**/*.purs\""
Expand Down
Loading