From f7b371c059837897f56a7f5e13d799ef7d0df674 Mon Sep 17 00:00:00 2001 From: Alexander Esgen Date: Fri, 10 Jan 2025 20:53:26 +0100 Subject: [PATCH] Ormolu Live: update ghc-wasm-meta --- flake.lock | 12 ++++++------ ormolu-live/build.sh | 6 +++--- ormolu-live/cabal.project | 6 +----- ormolu-live/default.nix | 9 +++++++++ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/flake.lock b/flake.lock index 201c95fc3..38cefbd95 100644 --- a/flake.lock +++ b/flake.lock @@ -176,11 +176,11 @@ }, "locked": { "host": "gitlab.haskell.org", - "lastModified": 1734354225, - "narHash": "sha256-c7uY4XcZNO0krdOXtaoE/ZW7w38BjC3o9pQjrwfQrO8=", + "lastModified": 1736814899, + "narHash": "sha256-5ecjTrtyFRjFSSt39aUUfvBAiLmmR0f3IuhhMcI4kXE=", "owner": "ghc", "repo": "ghc-wasm-meta", - "rev": "f0faac335c6f5e967d1bdbfca5768232483fd2a8", + "rev": "a9102d59d00bc87550dda902c8084a74f9742c00", "type": "gitlab" }, "original": { @@ -545,11 +545,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734119587, - "narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=", + "lastModified": 1736701207, + "narHash": "sha256-jG/+MvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5", + "rev": "ed4a395ea001367c1f13d34b1e01aa10290f67d6", "type": "github" }, "original": { diff --git a/ormolu-live/build.sh b/ormolu-live/build.sh index 90f3119ce..fd0cf74dc 100755 --- a/ormolu-live/build.sh +++ b/ormolu-live/build.sh @@ -28,19 +28,19 @@ else "$ORMOLU_WASM" -o "$WDIR/ormolu-init.wasm" ORMOLU_WASM_FINAL="$WDIR/ormolu-opt.wasm" wasm-opt "$WDIR/ormolu-init.wasm" -o "$ORMOLU_WASM_FINAL" -Oz - wasm-strip "$ORMOLU_WASM_FINAL" + wasm-tools strip "$ORMOLU_WASM_FINAL" -o "$ORMOLU_WASM_FINAL" fi rm -rf dist mkdir -p dist cp "$ORMOLU_WASM_FINAL" dist/ormolu-live.wasm -wasmedge --dir /:. "$(wasm32-wasi-cabal list-bin exe:pregen)" \ +wasmtime --dir .::/ "$(wasm32-wasi-cabal list-bin exe:pregen)" \ www/jsaddle.js dist/index.html esbuild_args=(--platform=browser --format=esm) [[ $dev_mode == false ]] && esbuild_args+=(--minify) -esbuild www/{index,worker}.js --outdir=dist --bundle "${esbuild_args[@]}" +esbuild www/{index,worker}.js --external:node:timers --outdir=dist --bundle "${esbuild_args[@]}" esbuild www/jsaddle.js --outdir=dist "${esbuild_args[@]}" cp node_modules/bulma/css/bulma.min.css dist/ diff --git a/ormolu-live/cabal.project b/ormolu-live/cabal.project index 144a2e9a1..a8f474bb9 100644 --- a/ormolu-live/cabal.project +++ b/ormolu-live/cabal.project @@ -3,10 +3,6 @@ packages: . .. index-state: 2025-01-17T00:00:00Z if arch(wasm32) - -- Older versions of time don't build on WASM. - constraints: time installed - allow-newer: time - package ghc-lib-parser -- The WASM backend does not support the threaded RTS. flags: -threaded-rts @@ -15,4 +11,4 @@ if arch(wasm32) source-repository-package type: git location: https://github.com/amesgen/splitmix - tag: 5f5b766d97dc735ac228215d240a3bb90bc2ff75 + tag: cea9e31bdd849eb0c17611bb99e33d590e126164 diff --git a/ormolu-live/default.nix b/ormolu-live/default.nix index cba18eb43..20784760a 100644 --- a/ormolu-live/default.nix +++ b/ormolu-live/default.nix @@ -2,6 +2,7 @@ let pkgs = inputs.ghc-wasm-meta.inputs.nixpkgs.legacyPackages.${system}; + inherit (pkgs) lib; in { shell = pkgs.mkShell { @@ -11,5 +12,13 @@ in pkgs.npm-check-updates pkgs.miniserve ]; + + # Otherwise there are `happy` errors in GHA CI. + shellHook = '' + export LANG="en_US.UTF-8" + '' + lib.optionalString + (pkgs.glibcLocales != null && pkgs.stdenv.hostPlatform.libc == "glibc") '' + export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive" + ''; }; }