From 50eb6a62d04488adb8357f9e32025cc83b8f1337 Mon Sep 17 00:00:00 2001 From: Alexander Esgen Date: Sun, 20 Oct 2024 13:57:35 +0200 Subject: [PATCH] Use TH-enabled build, remove custom miso --- .github/workflows/build.yml | 9 +++++++-- README.md | 8 ++++---- cabal.project | 20 ++++++++------------ flake.lock | 12 ++++++------ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09b8e19..561315e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,10 +40,15 @@ jobs: ~/.ghc-wasm/add_to_github_path.sh popd + - name: cabal + run: | + ghcup config add-release-channel https://raw.githubusercontent.com/amesgen/ghcup-metadata/refs/heads/wasm-th/ghcup-prereleases-0.0.8.yaml + ghcup install cabal --set 3.15.0.0.2024.10.3 + - name: wasm32-wasi-ghc run: | - ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-cross-0.0.8.yaml - ghcup install ghc --set wasm32-wasi-9.10.1 -- $CONFIGURE_ARGS + ghcup config add-release-channel https://raw.githubusercontent.com/amesgen/ghcup-metadata/refs/heads/wasm-th/ghcup-cross-0.0.8.yaml + ghcup install ghc --set wasm32-wasi-9.10.1.20241021 -- $CONFIGURE_ARGS - uses: dw-labs-org/dart-sass-gha@v1 diff --git a/README.md b/README.md index ab6383e..b131bab 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,8 @@ The GHC wasm backend supports the feature, allowing Haskell wasm apps to interop with JavaScript seamlessly in the browser. This repo contains a few examples to demonstrate this ability, all of which based on the -[`miso`](https://haskell-miso.org) frontend framework, using an -unofficial [port](https://github.com/amesgen/miso/tree/remove-th) as -well as an experimental +[`miso`](https://haskell-miso.org) frontend framework as well as +an experimental [`jsaddle-wasm`](https://github.com/amesgen/jsaddle-wasm) library under the hood. @@ -44,7 +43,8 @@ You can set up the toolchain by either: [`ghc-wasm-meta`](https://gitlab.haskell.org/ghc/ghc-wasm-meta#getting-started-without-nix) directly to set up ghc head or ghc 9.10 - Using [`ghcup`](https://www.haskell.org/ghcup/guide/#cross-support) - to set up ghc 9.10 + to set up ghc 9.10 (9.10.1.20241018 or later, with TemplateHaskell support) + and cabal >=3.15. Also install [Sass](https://sass-lang.com/install/). diff --git a/cabal.project b/cabal.project index bdc137f..605b884 100644 --- a/cabal.project +++ b/cabal.project @@ -1,24 +1,20 @@ packages: . hs2048 -index-state: 2024-09-29T15:37:55Z +index-state: 2024-10-20T13:44:33Z if arch(wasm32) + -- necessary for TemplateHaskell to work + shared: True + + -- https://github.com/haskellari/time-compat/issues/37 + -- Older versions of time don't build on WASM. + allow-newer: time-compat:time + -- https://github.com/haskellari/splitmix/pull/73 source-repository-package type: git location: https://github.com/amesgen/splitmix tag: 5f5b766d97dc735ac228215d240a3bb90bc2ff75 - -- remove TemplateHaskell - source-repository-package - type: git - location: https://github.com/amesgen/miso - tag: 27dd5fc80be9d0a3b80a9ecc81ee3401bc610e01 - - source-repository-package - type: git - location: https://github.com/amesgen/jsaddle-wasm - tag: be129c788f8ca1ea2e9cc1515397c1a46d02bb41 - package aeson flags: -ordered-keymap diff --git a/flake.lock b/flake.lock index c49ba51..43ad264 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ }, "locked": { "host": "gitlab.haskell.org", - "lastModified": 1727083389, - "narHash": "sha256-O3HXt6hHkZNyib19rbfaQqyiEwZfdC1VQhNCWMY9y9s=", + "lastModified": 1729584380, + "narHash": "sha256-8PJwx8odVuaKBaaKaExpi1Dls7WiiCTxDQQOfFaAgfI=", "owner": "ghc", "repo": "ghc-wasm-meta", - "rev": "7bc201976c4164fbd4403777ccee8dd0c2210bcb", + "rev": "f7a7588dbcd7d099e52a15d1104927317095a060", "type": "gitlab" }, "original": { @@ -41,11 +41,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726755586, - "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", + "lastModified": 1729256560, + "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e", + "rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0", "type": "github" }, "original": {