Closed mariocampacci closed 4 months ago
Hi! Thanks for reporting this issue. The problem you raised comes from the new support of Mandarin: we leverage on a rust package that is compiled using wasm-pack. Have you tried to install it globally?
Hi @allevo,
installed the wasm-pack
as suggested.
I get another error:
@orama/tokenizers:build: Error: failed to start `cargo metadata`: No such file or directory (os error 2)
@orama/tokenizers:build: Caused by: failed to start `cargo metadata`: No such file or directory (os error 2)
@orama/tokenizers:build: Caused by: No such file or directory (os error 2)
the error is the same if I installed the package running npm -g i wasm-pack
or pnpm i wasm-pack -w
.
Should rust and cargo be installed too?
Tried to install them via apk add rust
and apk add cargo
and get this error:
@orama/tokenizers:build:
@orama/tokenizers:build: > @orama/tokenizers@2.0.8 build /workspaces/orama/packages/tokenizers
@orama/tokenizers:build: > node ./scripts/build.mjs
@orama/tokenizers:build:
@orama/tokenizers:build: [INFO]: 🎯 Checking for the Wasm target...
@orama/tokenizers:build: Error: wasm32-unknown-unknown target not found in sysroot: "/usr"
@orama/tokenizers:build:
@orama/tokenizers:build: Used rustc from the following path: "/usr/bin/rustc"
@orama/tokenizers:build: It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.
@orama/tokenizers:build:
@orama/tokenizers:build: Caused by: wasm32-unknown-unknown target not found in sysroot: "/usr"
@orama/tokenizers:build:
@orama/tokenizers:build: Used rustc from the following path: "/usr/bin/rustc"
@orama/tokenizers:build: It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.
@orama/tokenizers:build:
@orama/tokenizers:build: node:internal/errors:932
@orama/tokenizers:build: const err = new Error(message);
@orama/tokenizers:build: ^
@orama/tokenizers:build:
@orama/tokenizers:build: Error: Command failed: cd /workspaces/orama/packages/tokenizers/src/tokenizer-mandarin && wasm-pack build --target web
@orama/tokenizers:build: [INFO]: 🎯 Checking for the Wasm target...
@orama/tokenizers:build: Error: wasm32-unknown-unknown target not found in sysroot: "/usr"
@orama/tokenizers:build:
@orama/tokenizers:build: Used rustc from the following path: "/usr/bin/rustc"
@orama/tokenizers:build: It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.
@orama/tokenizers:build:
@orama/tokenizers:build: Caused by: wasm32-unknown-unknown target not found in sysroot: "/usr"
@orama/tokenizers:build:
@orama/tokenizers:build: Used rustc from the following path: "/usr/bin/rustc"
@orama/tokenizers:build: It looks like Rustup is not being used. For non-Rustup setups, the wasm32-unknown-unknown target needs to be installed manually. See https://rustwasm.github.io/wasm-pack/book/prerequisites/non-rustup-setups.html on how to do this.
@orama/tokenizers:build:
@orama/tokenizers:build:
@orama/tokenizers:build: at checkExecSyncError (node:child_process:890:11)
@orama/tokenizers:build: at Object.execSync (node:child_process:962:15)
@orama/tokenizers:build: at file:///workspaces/orama/packages/tokenizers/scripts/build.mjs:25:14
@orama/tokenizers:build: at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
@orama/tokenizers:build: at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
@orama/tokenizers:build: at async loadESM (node:internal/process/esm_loader:28:7)
@orama/tokenizers:build: at async handleMainPromise (node:internal/modules/run_main:113:12) {
@orama/tokenizers:build: status: 1,
@orama/tokenizers:build: signal: null,
@orama/tokenizers:build: output: [
@orama/tokenizers:build: null,
@orama/tokenizers:build: Buffer(0) [Uint8Array] [],
@orama/tokenizers:build: Buffer(754) [Uint8Array] [
@orama/tokenizers:build: 91, 73, 78, 70, 79, 93, 58, 32, 240, 159, 142, 175,
@orama/tokenizers:build: 32, 32, 67, 104, 101, 99, 107, 105, 110, 103, 32, 102,
@orama/tokenizers:build: 111, 114, 32, 116, 104, 101, 32, 87, 97, 115, 109, 32,
@orama/tokenizers:build: 116, 97, 114, 103, 101, 116, 46, 46, 46, 10, 69, 114,
@orama/tokenizers:build: 114, 111, 114, 58, 32, 119, 97, 115, 109, 51, 50, 45,
@orama/tokenizers:build: 117, 110, 107, 110, 111, 119, 110, 45, 117, 110, 107, 110,
@orama/tokenizers:build: 111, 119, 110, 32, 116, 97, 114, 103, 101, 116, 32, 110,
@orama/tokenizers:build: 111, 116, 32, 102, 111, 117, 110, 100, 32, 105, 110, 32,
@orama/tokenizers:build: 115, 121, 115, 114,
@orama/tokenizers:build: ... 654 more items
@orama/tokenizers:build: ]
@orama/tokenizers:build: ],
@orama/tokenizers:build: pid: 10268,
@orama/tokenizers:build: stdout: Buffer(0) [Uint8Array] [],
@orama/tokenizers:build: stderr: Buffer(754) [Uint8Array] [
@orama/tokenizers:build: 91, 73, 78, 70, 79, 93, 58, 32, 240, 159, 142, 175,
@orama/tokenizers:build: 32, 32, 67, 104, 101, 99, 107, 105, 110, 103, 32, 102,
@orama/tokenizers:build: 111, 114, 32, 116, 104, 101, 32, 87, 97, 115, 109, 32,
@orama/tokenizers:build: 116, 97, 114, 103, 101, 116, 46, 46, 46, 10, 69, 114,
@orama/tokenizers:build: 114, 111, 114, 58, 32, 119, 97, 115, 109, 51, 50, 45,
@orama/tokenizers:build: 117, 110, 107, 110, 111, 119, 110, 45, 117, 110, 107, 110,
@orama/tokenizers:build: 111, 119, 110, 32, 116, 97, 114, 103, 101, 116, 32, 110,
@orama/tokenizers:build: 111, 116, 32, 102, 111, 117, 110, 100, 32, 105, 110, 32,
@orama/tokenizers:build: 115, 121, 115, 114,
@orama/tokenizers:build: ... 654 more items
@orama/tokenizers:build: ]
@orama/tokenizers:build: }
@orama/tokenizers:build:
@orama/tokenizers:build: Node.js v20.11.1
@orama/tokenizers:build: ELIFECYCLE Command failed with exit code 1.
@orama/tokenizers:build: ERROR: command finished with error: command (/workspaces/orama/packages/tokenizers) pnpm run build exited (1)
@mariocampacci I merged a PR that should resolve this problem #650
@micheleriva yes, indeed skipping the build did resolve the issue. Thank you!
Describe the bug
After running the devcontainer I'm now trying to follow the building steps inside the
CONTRIBUTING.md
but runningpnpm build
gives this error:resolved performing wasm-pack installation
apk add wasm-pack
.Running the build again gives more errors:
so I tried to disable wasm-opt editing
packages/tokenizers/src/tokenizer-mandarin/Cargo.toml
and adding:now the build works (and so the pre-commit hook tests). Am I doing something wrong? Thanks!
To Reproduce
Clone the repo for the first time, run the vscode devcontainer and follow building steps inside the
CONTRIBUTING.md
Expected behavior
Expecting to be able to run the build without errors
Environment Info
Affected areas
Environment/OS
Additional context
No response