From 7b1ce72f862f0967df1924c583288ccc8b7cb81c Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 14 Jan 2023 05:20:20 +0100 Subject: [PATCH] Actually fix wasm-pack build command (#1862) I initially attempted to run `wasm-pack build -p ruff` which gave the error message: Error: crate directory is missing a `Cargo.toml` file; is `-p` the wrong directory? I interpreted that as wasm-pack looking for the "ruff" directory because I specified -p ruff, however actually the wasm-pack build usage is: wasm-pack build [FLAGS] [OPTIONS] And I was missing the `` argument. So this actually wasn't at all a bug in wasm-pack but just a confusing error message. And the symlink hack I introduced in the previous commit didn't actually work ... I only accidentally omitted the `-p` when testing (which ended up as `ruff` being the argument) ... CLIs are fun. --- .github/workflows/playground.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/playground.yaml b/.github/workflows/playground.yaml index 54f26b6ce9..835912a67d 100644 --- a/.github/workflows/playground.yaml +++ b/.github/workflows/playground.yaml @@ -31,8 +31,7 @@ jobs: - uses: jetli/wasm-pack-action@v0.4.0 - uses: jetli/wasm-bindgen-action@v0.2.0 - name: "Run wasm-pack" - run: ln -s . ruff # HACK because `wasm-pack build` doesn't support our crate structure (see https://github.com/rustwasm/wasm-pack/issues/1211) - run: wasm-pack build --target web --out-dir playground/src/pkg -p ruff + run: wasm-pack build --target web --out-dir playground/src/pkg . -- -p ruff - name: "Install Node dependencies" run: npm ci working-directory: playground