Skip to content

Commit f4d94da

Browse files
amesgenmrkkrp
authored andcommitted
Ormolu Live: update ghc-wasm-meta
1 parent 1f8e7e5 commit f4d94da

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

flake.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ormolu-live/build.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ else
2828
"$ORMOLU_WASM" -o "$WDIR/ormolu-init.wasm"
2929
ORMOLU_WASM_FINAL="$WDIR/ormolu-opt.wasm"
3030
wasm-opt "$WDIR/ormolu-init.wasm" -o "$ORMOLU_WASM_FINAL" -Oz
31-
wasm-strip "$ORMOLU_WASM_FINAL"
31+
wasm-tools strip "$ORMOLU_WASM_FINAL" -o "$ORMOLU_WASM_FINAL"
3232
fi
3333

3434
rm -rf dist
3535
mkdir -p dist
3636
cp "$ORMOLU_WASM_FINAL" dist/ormolu-live.wasm
3737

38-
wasmedge --dir /:. "$(wasm32-wasi-cabal list-bin exe:pregen)" \
38+
wasmtime --dir .::/ "$(wasm32-wasi-cabal list-bin exe:pregen)" \
3939
www/jsaddle.js dist/index.html
4040

4141
esbuild_args=(--platform=browser --format=esm)
4242
[[ $dev_mode == false ]] && esbuild_args+=(--minify)
43-
esbuild www/{index,worker}.js --outdir=dist --bundle "${esbuild_args[@]}"
43+
esbuild www/{index,worker}.js --external:node:timers --outdir=dist --bundle "${esbuild_args[@]}"
4444
esbuild www/jsaddle.js --outdir=dist "${esbuild_args[@]}"
4545

4646
cp node_modules/bulma/css/bulma.min.css dist/

ormolu-live/cabal.project

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ packages: . ..
33
index-state: 2025-01-16T23:07:37Z
44

55
if arch(wasm32)
6-
-- Older versions of time don't build on WASM.
7-
constraints: time installed
8-
allow-newer: time
9-
106
package ghc-lib-parser
117
-- The WASM backend does not support the threaded RTS.
128
flags: -threaded-rts
@@ -15,4 +11,4 @@ if arch(wasm32)
1511
source-repository-package
1612
type: git
1713
location: https://github.com/amesgen/splitmix
18-
tag: 5f5b766d97dc735ac228215d240a3bb90bc2ff75
14+
tag: cea9e31bdd849eb0c17611bb99e33d590e126164

ormolu-live/default.nix

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
let
44
pkgs = inputs.ghc-wasm-meta.inputs.nixpkgs.legacyPackages.${system};
5+
inherit (pkgs) lib;
56
in
67
{
78
shell = pkgs.mkShell {
@@ -11,5 +12,13 @@ in
1112
pkgs.npm-check-updates
1213
pkgs.miniserve
1314
];
15+
16+
# Otherwise there are `happy` errors in GHA CI.
17+
shellHook = ''
18+
export LANG="en_US.UTF-8"
19+
'' + lib.optionalString
20+
(pkgs.glibcLocales != null && pkgs.stdenv.hostPlatform.libc == "glibc") ''
21+
export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive"
22+
'';
1423
};
1524
}

0 commit comments

Comments
 (0)