Skip to content

Commit

Permalink
Merge pull request #1477 from AmpersandTarski/upgrade-ghc
Browse files Browse the repository at this point in the history
Upgrade ghc to version 9.6.4
  • Loading branch information
Ampersand-Sentinel committed May 4, 2024
2 parents 74ea1e1 + aaf0591 commit e83c27e
Show file tree
Hide file tree
Showing 107 changed files with 3,644 additions and 3,177 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ampersandtarski/ampersand-devcontainer:latest
FROM ampersandtarski/ampersand-devcontainer:ghc9-6-4

ENV DEBIAN_FRONTEND=dialog

Expand Down
38 changes: 21 additions & 17 deletions .devcontainer/DockerfileUpstream
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,25 @@ ENV USERNAME=${USERNAME} \
RUN \
apt-get update -y && \
apt-get install -y --no-install-recommends \
apt-transport-https \
autoconf \
automake \
build-essential \
curl \
libnuma-dev \
zlib1g-dev \
gcc \
git \
gnupg2 \
graphviz \
libbz2-dev \
libexpat1-dev \
libgmp-dev \
libgmp10 \
git \
wget \
libnuma-dev \
lsb-release \
pkg-config \
software-properties-common \
gnupg2 \
apt-transport-https \
gcc \
autoconf \
automake \
build-essential \
wget \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN groupadd --gid $USER_GID $USERNAME && \
Expand All @@ -57,10 +61,10 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
# Add ghcup and cabal to the PATH
ENV PATH="${WDIR}/.cabal/bin:${WDIR}/.ghcup/bin:${PATH}:${WDIR}/.local/bin:${PATH}"

ARG GHC=8.10.7
ARG CABAL=3.6.2.0
ARG HLS=2.2.0.0
ARG STACK=2.11.1
ARG GHC=9.6.4
ARG CABAL=3.10.2.1
ARG HLS=2.7.0.0
ARG STACK=2.15.5

# install GHC and cabal

Expand All @@ -73,9 +77,9 @@ FROM base as tools

# Install global packages.
# Versions are pinned, since we don't want to accidentally break anything (by always installing latest).
RUN cabal install -v haskell-dap-0.0.15.0 && \
cabal install -v stylish-haskell-0.13.0.0 && \
cabal install -v ormolu-0.1.3.1
RUN cabal install -v haskell-dap-0.0.16.0 && \
cabal install -v stylish-haskell-0.14.5.0 && \
cabal install -v ormolu-0.7.2.0
# RUN cabal install -v ghci-dap-0.0.19.0
# RUN cabal install -v haskell-debug-adapter-0.0.37.0
# RUN cabal install -v hlint-3.2.7
Expand Down
6 changes: 4 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ NB: This action is currently done by Han, no need for other people to do so. It
Sometimes there are updates of the Haskell toolchain we use. For instance whenever a new version of the Haskell Language Server is made available, the `DockerfileUpstream` should be updated accordingly. Then, the new image should be built and published at dockerhub. To do so, go to the ampersand root directory and run the following commands:

```
docker build -f .devcontainer/DockerfileUpstream -t ampersandtarski/ampersand-devcontainer:latest .
docker push ampersandtarski/ampersand-devcontainer:latest
docker build -f .devcontainer/DockerfileUpstream -t ampersandtarski/ampersand-devcontainer:<tag> .
docker push ampersandtarski/ampersand-devcontainer:<tag>
```

where `<tag>` must be replaced with an appropriate new tagname reflecting the version of ghc.
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "DevContainer for Ampersand",
"name": "Ampersand 5 devcontainer",
// "remoteUser": "root",
"runArgs": [],
"build": {
Expand All @@ -24,7 +24,8 @@
"mhutchie.git-graph",
"editorconfig.editorconfig",
// Because of bug (see https://github.com/Microsoft/vscode/issues/45997):
"bdsoftware.format-on-auto-save"
"bdsoftware.format-on-auto-save",
"rcook.ghci-helper"
],
"settings": {
"editor.formatonsave": true,
Expand Down
60 changes: 28 additions & 32 deletions .github/workflows/ci2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
# - name: Use cache when available 📦
# uses: freckle/stack-cache-action@main
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
Expand All @@ -58,42 +56,40 @@ jobs:
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
# - name: Use cache when available 📦
# uses: freckle/stack-cache-action@main
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
# See issue https://github.com/freckle/stack-action/issues/80 for why we need to install stack and php as well
- run: curl -sSL https://get.haskellstack.org/ | sh
- run: brew install php
- name: Build and test 🏗 🧪
uses: freckle/stack-action@v5
with:
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"

build-and-test-windows:
name: Build and test on Windows 🏗 🧪
runs-on: windows-latest
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
# - name: Use cache (manually) 📦 # See https://github.com/freckle/stack-cache-action/issues/5
# uses: actions/[email protected]
# # TODO: Cache might be done better, see for inspiration: https://github.com/godu/advent-of-code-2020/blob/46796832f59d185457a8edf8de043a54a451d688/.github/workflows/ci.yml
# with:
# path: |
# ~/.ghc
# ~/.stack
# ~/.stack-work
# key: ${{ runner.os }}-stack
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
- name: Setup PHP 🧰
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
extensions: mysqli
- name: Build and test 🏗 🧪
uses: freckle/stack-action@v5
with:
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
# build-and-test-windows:
# name: Build and test on Windows 🏗 🧪
# runs-on: windows-latest
# steps:
# - name: Checkout project contents 📡
# uses: actions/checkout@v3
# - uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
# id: expatLibraryZip # Remember to give an ID if you need the output filename
# name: Download the expat library
# with:
# url: "https://github.com/libexpat/libexpat/releases/download/R_2_6_2/expat-win32bin-2.6.2.zip"
# target: public/
# - name: Set up Mariadb 🧰
# uses: shogo82148/actions-setup-mysql@v1
# with:
# mysql-version: "mariadb-10.6"
# - name: Setup PHP 🧰
# uses: shivammathur/setup-php@v2
# with:
# php-version: "8.0"
# extensions: mysqli
# - name: Build and test 🏗 🧪
# uses: freckle/stack-action@v5
# with:
# stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
4 changes: 1 addition & 3 deletions .github/workflows/codeQuality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ jobs:
steps:
- name: Checkout project contents 📡
uses: actions/[email protected]
- name: Use cache when available 📦
uses: freckle/stack-cache-action@main
- name: Build the project 🌿🌿🌿
uses: freckle/stack-action@v4
uses: freckle/stack-action@v5
with:
test: false

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ormolu-formatting-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ jobs:
# The checkout step is needed since the enforcer relies on local git commands
- uses: actions/checkout@v3

- uses: mrkkrp/ormolu-action@v2 # BEWARE: Do not upgrade unless we use ghc 9 or higher. v4 does not work for ghc less then 9.
- uses: mrkkrp/ormolu-action@v15
with:
version: "0.7.2.0"
134 changes: 69 additions & 65 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
add-release-artefacts:
name: Add artefacts to release
needs: [build-and-test-ubuntu, build-and-test-macOS, build-and-test-windows]
needs: [build-without-test-ubuntu, build-without-test-macOS]
runs-on: ubuntu-latest
steps:
- name: Download artifacts (Linux)
Expand Down Expand Up @@ -98,17 +98,17 @@ jobs:
files: release/macOS/
dest: release/macOS-binaries-v${{ steps.get-version.outputs.version }}.zip

- name: Download artifacts (Windows)
uses: actions/download-artifact@v2
with:
name: Windows-binaries
path: release/Windows
# - name: Download artifacts (Windows)
# uses: actions/download-artifact@v2
# with:
# name: Windows-binaries
# path: release/Windows

- name: zip the binaries (Windows)
uses: papeloto/action-zip@v1
with:
files: release/Windows/
dest: release/Windows-binaries-v${{ steps.get-version.outputs.version }}.zip
# - name: zip the binaries (Windows)
# uses: papeloto/action-zip@v1
# with:
# files: release/Windows/
# dest: release/Windows-binaries-v${{ steps.get-version.outputs.version }}.zip

- name: Upload Linux artifact
uses: actions/upload-release-asset@v1
Expand All @@ -130,90 +130,94 @@ jobs:
asset_path: release/macOS-binaries-v${{ steps.get-version.outputs.version }}.zip
asset_content_type: application/zip

- name: Upload Windows artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ampersand-${{ steps.get-version.outputs.version }}-Windows-binaries.zip
asset_path: release/Windows-binaries-v${{ steps.get-version.outputs.version }}.zip
asset_content_type: application/zip

build-and-test-ubuntu:
name: Build and test on ubuntu-latest 🏗 🧪
# - name: Upload Windows artifact
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_name: ampersand-${{ steps.get-version.outputs.version }}-Windows-binaries.zip
# asset_path: release/Windows-binaries-v${{ steps.get-version.outputs.version }}.zip
# asset_content_type: application/zip

build-without-test-ubuntu:
name: Build without test on ubuntu-latest 🏗 🧪
runs-on: ubuntu-latest
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
# - name: Use cache when available 📦
# uses: freckle/stack-cache-action@main
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
- name: Build and test 🏗 🧪
- name: build without test 🏗 🧪
uses: freckle/stack-action@v5 # stack-action does all these steps: dependencies, build, test.
with:
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
upgrade-stack: false
test: false
- name: Upload artifacts (Linux)
uses: actions/upload-artifact@v2
with:
name: Linux-binaries
path: /home/runner/.local/bin/*

build-and-test-macOS:
name: Build and test on macOS 🏗 🧪
build-without-test-macOS:
name: Build without test on macOS 🏗 🧪
runs-on: macos-latest
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
# - name: Use cache when available 📦
# uses: freckle/stack-cache-action@main
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
- name: Build and test 🏗 🧪
# See issue https://github.com/freckle/stack-action/issues/80 for why we need to install stack and php as well
- run: curl -sSL https://get.haskellstack.org/ | sh
- run: brew install php
- name: Build without test 🏗 🧪
uses: freckle/stack-action@v5
with:
stack-build-arguments: "--copy-bins --flag ampersand:buildAll --verbose"
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
upgrade-stack: false
test: false
- name: Upload artifacts (macOS)
uses: actions/upload-artifact@v2
with:
name: macOS-binaries
path: /Users/runner/.local/bin/*

build-and-test-windows:
name: Build and test on Windows 🏗 🧪
runs-on: windows-latest
steps:
- name: Checkout project contents 📡
uses: actions/checkout@v3
# - name: Use cache (manually) 📦 # See https://github.com/freckle/stack-cache-action/issues/5
# uses: actions/[email protected]
# # TODO: Cache might be done better, see for inspiration: https://github.com/godu/advent-of-code-2020/blob/46796832f59d185457a8edf8de043a54a451d688/.github/workflows/ci.yml
# with:
# path: |
# ~/.ghc
# ~/.stack
# ~/.stack-work
# key: ${{ runner.os }}-stack
- name: Set up Mariadb 🧰
uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: "mariadb-10.6"
- name: Setup PHP 🧰
uses: shivammathur/setup-php@v2
with:
php-version: "8.0"
extensions: mysqli
- name: Build and test 🏗 🧪
uses: freckle/stack-action@v5
with:
stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
- name: Upload artifacts (Windows)
uses: actions/upload-artifact@v2
with:
name: Windows-binaries
path: C:\Users\runneradmin\AppData\Roaming\local\bin\*
# build-without-test-windows:
# name: build without test on Windows 🏗 🧪
# runs-on: windows-latest
# steps:
# - name: Checkout project contents 📡
# uses: actions/checkout@v3
# # - name: Use cache (manually) 📦 # See https://github.com/freckle/stack-cache-action/issues/5
# # uses: actions/[email protected]
# # # TODO: Cache might be done better, see for inspiration: https://github.com/godu/advent-of-code-2020/blob/46796832f59d185457a8edf8de043a54a451d688/.github/workflows/ci.yml
# # with:
# # path: |
# # ~/.ghc
# # ~/.stack
# # ~/.stack-work
# # key: ${{ runner.os }}-stack
# - name: Set up Mariadb 🧰
# uses: shogo82148/actions-setup-mysql@v1
# with:
# mysql-version: "mariadb-10.6"
# - name: Setup PHP 🧰
# uses: shivammathur/setup-php@v2
# with:
# php-version: "8.0"
# extensions: mysqli
# - name: build without test 🏗 🧪
# uses: freckle/stack-action@v5
# with:
# stack-build-arguments: "--copy-bins --flag ampersand:buildAll"
# test: false
# - name: Upload artifacts (Windows)
# uses: actions/upload-artifact@v2
# with:
# name: Windows-binaries
# path: C:\Users\runneradmin\AppData\Roaming\local\bin\*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The purpose of this docker file is to produce a latest Ampersand-compiler in the form of a docker image.
FROM haskell:8.10.7 AS buildstage
FROM haskell:9.6.4 AS buildstage

RUN mkdir /opt/ampersand
WORKDIR /opt/ampersand
Expand Down
Loading

0 comments on commit e83c27e

Please sign in to comment.