diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b11716605..a5a07a8722 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,22 +55,22 @@ jobs: ghc: "8.10.7" cache_path: ~/.cabal/store - os: ubuntu-20.04 - ghc: "9.6.4" + ghc: "9.6.3" cache_path: ~/.cabal/store asset_name: simplex-chat-ubuntu-20_04-x86-64 desktop_asset_name: simplex-desktop-ubuntu-20_04-x86_64.deb - os: ubuntu-22.04 - ghc: "9.6.4" + ghc: "9.6.3" cache_path: ~/.cabal/store asset_name: simplex-chat-ubuntu-22_04-x86-64 desktop_asset_name: simplex-desktop-ubuntu-22_04-x86_64.deb - os: macos-latest - ghc: "9.6.4" + ghc: "9.6.3" cache_path: ~/.cabal/store asset_name: simplex-chat-macos-x86-64 desktop_asset_name: simplex-desktop-macos-x86_64.dmg - os: windows-latest - ghc: "9.6.4" + ghc: "9.6.3" cache_path: C:/cabal asset_name: simplex-chat-windows-x86-64 desktop_asset_name: simplex-desktop-windows-x86_64.msi diff --git a/Dockerfile b/Dockerfile index 29f3381726..6c60195f97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ FROM ubuntu:${TAG} AS build RUN apt-get update && apt-get install -y curl git build-essential libgmp3-dev zlib1g-dev llvm-12 llvm-12-dev libnuma-dev libssl-dev # Specify bootstrap Haskell versions -ENV BOOTSTRAP_HASKELL_GHC_VERSION=9.6.4 +ENV BOOTSTRAP_HASKELL_GHC_VERSION=9.6.3 ENV BOOTSTRAP_HASKELL_CABAL_VERSION=3.10.1.0 # Install ghcup diff --git a/docs/CLI.md b/docs/CLI.md index cc74d29db9..d4f799c7af 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.4 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 d6c11daf7f..bc013cd7eb 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -30,13 +30,13 @@ 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.4). +- `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) - 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. Deprecated. -- `master` - branch for beta version releases (GHC 9.6.4). +- `master` - branch for beta version releases (GHC 9.6.3). - `master-ghc8107` - branch for beta version releases (GHC 8.10.7). Deprecated. @@ -50,7 +50,7 @@ You will have to add `/opt/homebrew/opt/openssl@1.1/bin` to your PATH in order t **In simplexmq repo** -- `master` - uses GHC 9.6.4 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. Deprecated. @@ -77,28 +77,28 @@ You will have to add `/opt/homebrew/opt/openssl@1.1/bin` to your PATH in order t 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.4 +## 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.4 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.4 when needed +-- use this in GHC 9.6.3 when needed {-# LANGUAGE OverloadedRecordDot #-} --- GHC 9.6.4 syntax +-- GHC 9.6.3 syntax let x = record.field --- GHC 8.10.7 syntax absent in GHC 9.6.4 +-- 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.4 when needed +-- use this in GHC 9.6.3 when needed {-# OPTIONS_GHC -fno-warn-ambiguous-fields #-} let r' = (record :: Record) {field = value} @@ -107,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.4 when needed +-- use this in GHC 9.6.3 when needed import Control.Monad ``` diff --git a/flake.lock b/flake.lock index 7bd372b5c6..a11e01683e 100644 --- a/flake.lock +++ b/flake.lock @@ -175,11 +175,11 @@ "ghc99": { "flake": false, "locked": { - "lastModified": 1701580282, - "narHash": "sha256-drA01r3JrXnkKyzI+owMZGxX0JameMzjK0W5jJE/+V4=", + "lastModified": 1697054644, + "narHash": "sha256-kKarOuXUaAH3QWv7ASx+gGFMHaHKe0pK5Zu37ky2AL4=", "ref": "refs/heads/master", - "rev": "f5eb0f2982e9cf27515e892c4bdf634bcfb28459", - "revCount": 62197, + "rev": "f383a242c76f90bcca8a4d7ee001dcb49c172a9a", + "revCount": 62040, "submodules": true, "type": "git", "url": "https://gitlab.haskell.org/ghc/ghc" @@ -225,8 +225,6 @@ "hls-2.2": "hls-2.2", "hls-2.3": "hls-2.3", "hls-2.4": "hls-2.4", - "hls-2.5": "hls-2.5", - "hls-2.6": "hls-2.6", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", @@ -240,17 +238,16 @@ "nixpkgs-2205": "nixpkgs-2205", "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-2305": "nixpkgs-2305", - "nixpkgs-2311": "nixpkgs-2311", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", "stackage": "stackage" }, "locked": { - "lastModified": 1705833500, - "narHash": "sha256-rUIr6JNbCedt1g4gVYVvE9t0oFU6FUspCA0DS5cA8Bg=", + "lastModified": 1701163700, + "narHash": "sha256-sOrewUS3LnzV09nGr7+3R6Q6zsgU4smJc61QsHq+4DE=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "d0c35e75cbbc6858770af42ac32b0b85495fbd71", + "rev": "2808bfe3e62e9eb4ee8974cd623a00e1611f302b", "type": "github" }, "original": { @@ -331,50 +328,16 @@ "hls-2.4": { "flake": false, "locked": { - "lastModified": 1699862708, - "narHash": "sha256-YHXSkdz53zd0fYGIYOgLt6HrA0eaRJi9mXVqDgmvrjk=", + "lastModified": 1696939266, + "narHash": "sha256-VOMf5+kyOeOmfXTHlv4LNFJuDGa7G3pDnOxtzYR40IU=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "54507ef7e85fa8e9d0eb9a669832a3287ffccd57", + "rev": "362fdd1293efb4b82410b676ab1273479f6d17ee", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.4.0.1", - "repo": "haskell-language-server", - "type": "github" - } - }, - "hls-2.5": { - "flake": false, - "locked": { - "lastModified": 1701080174, - "narHash": "sha256-fyiR9TaHGJIIR0UmcCb73Xv9TJq3ht2ioxQ2mT7kVdc=", - "owner": "haskell", - "repo": "haskell-language-server", - "rev": "27f8c3d3892e38edaef5bea3870161815c4d014c", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "2.5.0.0", - "repo": "haskell-language-server", - "type": "github" - } - }, - "hls-2.6": { - "flake": false, - "locked": { - "lastModified": 1705325287, - "narHash": "sha256-+P87oLdlPyMw8Mgoul7HMWdEvWP/fNlo8jyNtwME8E8=", - "owner": "haskell", - "repo": "haskell-language-server", - "rev": "6e0b342fa0327e628610f2711f8c3e4eaaa08b1e", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "2.6.0.0", + "ref": "2.4.0.0", "repo": "haskell-language-server", "type": "github" } @@ -589,11 +552,11 @@ }, "nixpkgs-2305": { "locked": { - "lastModified": 1701362232, - "narHash": "sha256-GVdzxL0lhEadqs3hfRLuj+L1OJFGiL/L7gCcelgBlsw=", + "lastModified": 1695416179, + "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d2332963662edffacfddfad59ff4f709dde80ffe", + "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", "type": "github" }, "original": { @@ -603,22 +566,6 @@ "type": "github" } }, - "nixpkgs-2311": { - "locked": { - "lastModified": 1701386440, - "narHash": "sha256-xI0uQ9E7JbmEy/v8kR9ZQan6389rHug+zOtZeZFiDJk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "293822e55ec1872f715a66d0eda9e592dc14419f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-23.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-lib": { "locked": { "dir": "lib", @@ -655,17 +602,17 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1694822471, - "narHash": "sha256-6fSDCj++lZVMZlyqOe9SIOL8tYSBz1bI8acwovRwoX8=", + "lastModified": 1695318763, + "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", + "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", - "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" } }, @@ -717,11 +664,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1705709369, - "narHash": "sha256-HWgwM8v0g6ZBkRVCStsPaMUDf26WDOGV0q+AxyGlcBQ=", + "lastModified": 1699834215, + "narHash": "sha256-g/JKy0BCvJaxPuYDl3QVc4OY8cFEomgG+hW/eEV470M=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "f7e9bff9f7582d06c4237d183dafaccc33cfa5d4", + "rev": "47aacd04abcce6bad57f43cbbbd133538380248e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 420f4c70df..91cf43d0fe 100644 --- a/flake.nix +++ b/flake.nix @@ -29,8 +29,8 @@ }; in # `appendOverlays` with a singleton is identical to `extend`. let pkgs = haskellNix.legacyPackages.${system}.appendOverlays [android26]; in - let drv' = { extra-modules, pkgs', compiler-nix-name, ... }: pkgs'.haskell-nix.project { - inherit compiler-nix-name; + let drv' = { extra-modules, pkgs', ... }: pkgs'.haskell-nix.project { + compiler-nix-name = "ghc963"; index-state = "2023-12-12T00:00:00Z"; # We need this, to specify we want the cabal project. # If the stack.yaml was dropped, this would not be necessary. @@ -51,7 +51,7 @@ })] ++ extra-modules; }; in # by defualt we don't need to pass extra-modules. - let drv = pkgs': drv' { extra-modules = []; inherit pkgs'; compiler-nix-name = "ghc964"; }; in + let drv = pkgs': drv' { extra-modules = []; inherit pkgs'; }; in # This will package up all *.a in $out into a pkg.zip that can # be downloaded from hydra. let withHydraLibPkg = pkg: pkg.overrideAttrs (old: { @@ -141,7 +141,6 @@ "${pkgs.pkgsCross.musl64.hostPlatform.system}-static:exe:simplex-chat" = (drv pkgs.pkgsCross.musl64).simplex-chat.components.exes.simplex-chat; # STATIC i686-linux "${pkgs.pkgsCross.musl32.hostPlatform.system}-static:exe:simplex-chat" = (drv' { - compiler-nix-name = "ghc810"; pkgs' = pkgs.pkgsCross.musl32; extra-modules = [{ # 32 bit patches @@ -155,7 +154,6 @@ }).simplex-chat.components.exes.simplex-chat; # WINDOWS x86_64-mingwW64 "${pkgs.pkgsCross.mingwW64.hostPlatform.system}:exe:simplex-chat" = (drv' { - compiler-nix-name = "ghc964"; pkgs' = pkgs.pkgsCross.mingwW64; extra-modules = [{ packages.direct-sqlcipher.flags.openssl = true; @@ -188,7 +186,6 @@ ''; }; "${pkgs.pkgsCross.mingwW64.hostPlatform.system}:lib:simplex-chat" = (drv' rec { - compiler-nix-name = "ghc964"; pkgs' = pkgs.pkgsCross.mingwW64; extra-modules = [{ packages.direct-sqlcipher.flags.openssl = true; @@ -265,7 +262,7 @@ # STATIC aarch64-linux "${pkgs.pkgsCross.aarch64-multiplatform-musl.hostPlatform.system}-static:exe:simplex-chat" = (drv pkgs.pkgsCross.aarch64-multiplatform-musl).simplex-chat.components.exes.simplex-chat; - "armv7a-android:lib:support" = (drv' { extra-modules = []; pkgs' = android32Pkgs; compiler-nix-name = "ghc8107"; } ).android-support.components.library.override (p: { + "armv7a-android:lib:support" = (drv android32Pkgs).android-support.components.library.override (p: { smallAddressSpace = true; # we won't want -dyamic (see aarch64-android:lib:simplex-chat) enableShared = false; @@ -328,7 +325,6 @@ ''; }); "armv7a-android:lib:simplex-chat" = (drv' { - compiler-nix-name = "ghc8107"; pkgs' = android32Pkgs; extra-modules = [{ packages.text.flags.simdutf = false; @@ -344,7 +340,7 @@ ]; # 32 bit patches packages.basement.patches = [ - # ./scripts/nix/basement-pr-573.patch + ./scripts/nix/basement-pr-573.patch ]; packages.memory.patches = [ ./scripts/nix/memory-pr-99.patch @@ -367,7 +363,6 @@ "-threaded" # "-debug" "-optl-lffi" - "-optl-lHSrts_thr" ] # This is fairly idiotic. LLD will strip out foreign exported # symbols (a GHC bug? Codegen bug?). So we need to pass `-u ` @@ -392,8 +387,6 @@ "chat_valid_name" "chat_json_length" "chat_write_file" - # We also need to keep the rts init method around. - "hs_init_with_rtsopts" ]; postInstall = '' set -x @@ -440,7 +433,6 @@ ''; }); "aarch64-android:lib:simplex-chat" = (drv' { - compiler-nix-name = "ghc964"; pkgs' = androidPkgs; extra-modules = [{ packages.text.flags.simdutf = false; @@ -549,7 +541,6 @@ "aarch64-darwin" = { # aarch64-darwin iOS build (to be patched with mac2ios) "aarch64-darwin-ios:lib:simplex-chat" = (drv' { - compiler-nix-name = "ghc964"; pkgs' = pkgs; extra-modules = [{ packages.simplex-chat.flags.swift = true; @@ -566,7 +557,6 @@ ); # aarch64-darwin build with tagged JSON format (for Mac & Flutter) "aarch64-darwin:lib:simplex-chat" = (drv' { - compiler-nix-name = "ghc964"; pkgs' = pkgs; extra-modules = [{ packages.direct-sqlcipher.flags.commoncrypto = true; @@ -582,7 +572,6 @@ "x86_64-darwin" = { # x86_64-darwin iOS simulator build (to be patched with mac2ios) "x86_64-darwin-ios:lib:simplex-chat" = (drv' { - compiler-nix-name = "ghc964"; pkgs' = pkgs; extra-modules = [{ packages.simplex-chat.flags.swift = true; @@ -598,7 +587,6 @@ ); # x86_64-darwin build with tagged JSON format (for Mac & Flutter iOS simulator) "x86_64-darwin:lib:simplex-chat" = (drv' { - compiler-nix-name = "ghc964"; pkgs' = pkgs; extra-modules = [{ packages.direct-sqlcipher.flags.commoncrypto = true; diff --git a/scripts/desktop/build-lib-linux.sh b/scripts/desktop/build-lib-linux.sh index 528e7b9f91..c27b672e40 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.4 +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 12067a9b53..2b0fd5376f 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.4 +GHC_VERSION=9.6.3 if [ "$ARCH" == "arm64" ]; then ARCH=aarch64