Skip to content

Commit 659432d

Browse files
committed
CI: install nodejs for WASM smoke test, fix PATH
The WASM smoke test needs `node` for post-link.mjs and the WASI runtime, but it's not available in the devx shell. Install nodejs via nix-env alongside jq/unzip/zstd in the wasi-sdk setup step, and add ~/.nix-profile/bin to the smoke test PATH.
1 parent e476b11 commit 659432d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/nix-ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,10 +785,13 @@ jobs:
785785
export PATH="$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"
786786
# Verify required tools or install them (use nix-env, not nix profile,
787787
# because experimental features may not be enabled in the VM)
788-
for tool in jq unzip zstd; do
788+
# nodejs is needed for the WASM smoke test (post-link.mjs + WASI runtime)
789+
for tool in jq unzip zstd node; do
789790
if ! command -v "$tool" &>/dev/null; then
790-
echo "Installing $tool via nix-env..."
791-
/nix/var/nix/profiles/default/bin/nix-env -iA "nixpkgs.$tool"
791+
pkg="$tool"
792+
[ "$tool" = "node" ] && pkg="nodejs"
793+
echo "Installing $pkg via nix-env..."
794+
/nix/var/nix/profiles/default/bin/nix-env -iA "nixpkgs.$pkg"
792795
fi
793796
done
794797
curl -fsSL https://gitlab.haskell.org/ghc/ghc-wasm-meta/-/raw/master/bootstrap.sh | \
@@ -826,7 +829,7 @@ jobs:
826829
shell: devx {0}
827830
run: |
828831
set -eo pipefail
829-
export PATH=$PATH:$HOME/.ghc-wasm/wasi-sdk/bin
832+
export PATH="$HOME/.nix-profile/bin:$PATH:$HOME/.ghc-wasm/wasi-sdk/bin"
830833
echo 'main = putStrLn "Hello from WASM backend"' > /tmp/hello.hs
831834
_build/dist/bin/wasm32-unknown-wasi-ghc /tmp/hello.hs -o /tmp/hello.wasm
832835

0 commit comments

Comments
 (0)