From d233d07ddc13ee278479c9df4d62337a6fe3d6d8 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Wed, 8 Nov 2023 12:50:56 +0000 Subject: [PATCH] ci: ghc 9.6.3 (#3328) --- .github/workflows/build.yml | 2 +- Dockerfile | 4 +-- docs/CLI.md | 2 +- docs/CONTRIBUTING.md | 55 +++++++++++++----------------- scripts/desktop/build-lib-linux.sh | 2 +- scripts/desktop/build-lib-mac.sh | 2 +- 6 files changed, 29 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8785360693..b4301dcb3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,7 @@ jobs: - name: Setup Haskell uses: haskell-actions/setup@v2 with: - ghc-version: "9.6.2" + ghc-version: "9.6.3" cabal-version: "3.10.1.0" - name: Cache dependencies diff --git a/Dockerfile b/Dockerfile index 0c0788c81d..834f2374a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,11 @@ RUN a=$(arch); curl https://downloads.haskell.org/~ghcup/$a-linux-ghcup -o /usr/ chmod +x /usr/bin/ghcup # Install ghc -RUN ghcup install ghc 9.6.2 +RUN ghcup install ghc 9.6.3 # Install cabal RUN ghcup install cabal 3.10.1.0 # Set both as default -RUN ghcup set ghc 9.6.2 && \ +RUN ghcup set ghc 9.6.3 && \ ghcup set cabal 3.10.1.0 COPY . /project diff --git a/docs/CLI.md b/docs/CLI.md index 7966627c4a..f781f85749 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -102,7 +102,7 @@ DOCKER_BUILDKIT=1 docker build --output ~/.local/bin . #### In any OS -1. Install [Haskell GHCup](https://www.haskell.org/ghcup/), GHC 9.6.2 and cabal 3.10.1.0: +1. Install [Haskell GHCup](https://www.haskell.org/ghcup/), GHC 9.6.3 and cabal 3.10.1.0: ```shell curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 0aa09c5166..aaf452af00 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -30,29 +30,29 @@ You will have to add `/opt/homebrew/opt/openssl@1.1/bin` to your PATH in order t **In simplex-chat repo** -- `stable` - stable release of the apps, can be used for updates to the previous stable release (GHC 9.6.2). +- `stable` - stable release of the apps, can be used for updates to the previous stable release (GHC 9.6.3). -- `stable-android` - used to build stable Android core library with Nix (GHC 8.10.7). +- `stable-android` - used to build stable Android core library with Nix (GHC 8.10.7) - only for Android armv7a. -- `stable-ios` - used to build stable iOS core library with Nix (GHC 8.10.7) – this branch should be the same as `stable-android` except Nix configuration files. +- `stable-ios` - used to build stable iOS core library with Nix (GHC 8.10.7) – this branch should be the same as `stable-android` except Nix configuration files. Deprecated. -- `master` - branch for beta version releases (GHC 9.6.2). +- `master` - branch for beta version releases (GHC 9.6.3). -- `master-ghc8107` - branch for beta version releases (GHC 8.10.7). +- `master-ghc8107` - branch for beta version releases (GHC 8.10.7). Deprecated. -- `master-android` - used to build beta Android core library with Nix (GHC 8.10.7), same as `master-ghc8107` +- `master-android` - used to build beta Android core library with Nix (GHC 8.10.7) - only for Android armv7a. -- `master-ios` - used to build beta iOS core library with Nix (GHC 8.10.7). +- `master-ios` - used to build beta iOS core library with Nix (GHC 8.10.7). Deprecated. -- `windows-ghc8107` - branch for windows core library build (GHC 8.10.7). +- `windows-ghc8107` - branch for windows core library build (GHC 8.10.7). Deprecated? `master-ios` and `windows-ghc8107` branches should be the same as `master-ghc8107` except Nix configuration files. **In simplexmq repo** -- `master` - uses GHC 9.6.2 its commit should be used in `master` branch of simplex-chat repo. +- `master` - uses GHC 9.6.3 its commit should be used in `master` branch of simplex-chat repo. -- `master-ghc8107` - its commit should be used in `master-android` (and `master-ios`) branch of simplex-chat repo. +- `master-ghc8107` - its commit should be used in `master-android` (and `master-ios`) branch of simplex-chat repo. Deprecated. ## Development & release process @@ -61,53 +61,44 @@ You will have to add `/opt/homebrew/opt/openssl@1.1/bin` to your PATH in order t 2. If simplexmq repo was changed, to build mobile core libraries you need to merge its `master` branch into `master-ghc8107` branch. 3. To build core libraries for Android, iOS and windows: -- merge `master` branch to `master-ghc8107` branch. -- update `simplexmq` commit in `master-ghc8107` branch to the commit in `master-ghc8107` branch (probably, when resolving merge conflicts). +- merge `master` branch to `master-android` branch. - update code to be compatible with GHC 8.10.7 (see below). - push to GitHub. -4. To build Android core library, merge `master-ghc8107` branch to `master-android` branch, and push to GitHub. +4. All libraries should be built from `master` branch, Android armv7a - from `master-android` branch. -5. To build iOS core library, merge `master-ghc8107` branch to `master-ios` branch, and push to GitHub. +5. To build Desktop and CLI apps, make tag in `master` branch, APK files should be attached to the release. -6. To build windows core library, merge `master-ghc8107` branch to `windows-ghc8107` branch, and push to GitHub. - -7. To build Desktop and CLI apps, make tag in `master` branch, APK files should be attached to the release. - -8. After the public release to App Store and Play Store, merge: +6. After the public release to App Store and Play Store, merge: - `master` to `stable` -- `master` to `master-ghc8107` (and compile/update code) -- `master-ghc8107` to `master-android` -- `master-ghc8107` to `master-ios` -- `master-ghc8107` to `windows-ghc8107` +- `master` to `master-android` (and compile/update code) - `master-android` to `stable-android` -- `master-ios` to `stable-ios` -9. Independently, `master` branch of simplexmq repo should be merged to `stable` branch on stable releases. +7. Independently, `master` branch of simplexmq repo should be merged to `stable` branch on stable releases. -## Differences between GHC 8.10.7 and GHC 9.6.2 +## Differences between GHC 8.10.7 and GHC 9.6.3 1. The main difference is related to `DuplicateRecordFields` extension. -It is no longer possible in GHC 9.6.2 to specify type when using selectors, instead OverloadedRecordDot extension and syntax are used that need to be removed in GHC 8.10.7: +It is no longer possible in GHC 9.6.3 to specify type when using selectors, instead OverloadedRecordDot extension and syntax are used that need to be removed in GHC 8.10.7: ```haskell {-# LANGUAGE DuplicateRecordFields #-} --- use this in GHC 9.6.2 when needed +-- use this in GHC 9.6.3 when needed {-# LANGUAGE OverloadedRecordDot #-} --- GHC 9.6.2 syntax +-- GHC 9.6.3 syntax let x = record.field --- GHC 8.10.7 syntax removed in GHC 9.6.2 +-- GHC 8.10.7 syntax removed in GHC 9.6.3 let x = field (record :: Record) ``` It is still possible to specify type when using record update syntax, use this pragma to suppress compiler warning: ```haskell --- use this in GHC 9.6.2 when needed +-- use this in GHC 9.6.3 when needed {-# OPTIONS_GHC -fno-warn-ambiguous-fields #-} let r' = (record :: Record) {field = value} @@ -116,7 +107,7 @@ let r' = (record :: Record) {field = value} 2. Most monad functions now have to be imported from `Control.Monad`, and not from specific monad modules (e.g. `Control.Monad.Except`). ```haskell --- use this in GHC 9.6.2 when needed +-- use this in GHC 9.6.3 when needed import Control.Monad ``` diff --git a/scripts/desktop/build-lib-linux.sh b/scripts/desktop/build-lib-linux.sh index e0ee7e6698..fa1f892a03 100755 --- a/scripts/desktop/build-lib-linux.sh +++ b/scripts/desktop/build-lib-linux.sh @@ -8,7 +8,7 @@ function readlink() { OS=linux ARCH=${1:-`uname -a | rev | cut -d' ' -f2 | rev`} -GHC_VERSION=9.6.2 +GHC_VERSION=9.6.3 if [ "$ARCH" == "aarch64" ]; then COMPOSE_ARCH=arm64 diff --git a/scripts/desktop/build-lib-mac.sh b/scripts/desktop/build-lib-mac.sh index c33f59253f..1a4deced4a 100755 --- a/scripts/desktop/build-lib-mac.sh +++ b/scripts/desktop/build-lib-mac.sh @@ -5,7 +5,7 @@ set -e OS=mac ARCH="${1:-`uname -a | rev | cut -d' ' -f1 | rev`}" COMPOSE_ARCH=$ARCH -GHC_VERSION=9.6.2 +GHC_VERSION=9.6.3 if [ "$ARCH" == "arm64" ]; then ARCH=aarch64