Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jco is not found on build #458

Closed
krmbn0576 opened this issue May 16, 2024 · 8 comments
Closed

jco is not found on build #458

krmbn0576 opened this issue May 16, 2024 · 8 comments

Comments

@krmbn0576
Copy link
Contributor

$ rake npm:ruby-head-wasm-wasi

...
npx jco transpile --no-wasi-shim --instantiation --valid-lifting-optimization /home/user/ruby.wasm/packages/npm-packages/ruby-head-wasm-wasi/tmp/ruby.component.wasm -o /home/user/ruby.wasm/packages/npm-packages/ruby-head-wasm-wasi/dist/component
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/jco - Not found
npm ERR! 404
npm ERR! 404  'jco@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: /home/user/.npm/_logs/2024-05-16T01_40_50_213Z-debug-0.log
rake aborted!
Command failed with status (1): [npx jco transpile --no-wasi-shim --instantiation --valid-lifting-optimization /home/user/ruby.wasm/packages/npm-packages/ruby-head-wasm-wasi/tmp/ruby.component.wasm -o /home/user/ruby.wasm/packages/npm-packages/ruby-head-wasm-wasi/dist/component]
@kateinoigakukun
Copy link
Member

Did you run bin/setup?

@kateinoigakukun
Copy link
Member

Ah, sorry, I guess you did not do git submodule update

@krmbn0576
Copy link
Contributor Author

i did run twice, so third trial now is below.

$ ./bin/setup

root="$(cd "$(dirname "$0")/.." && pwd)"
+++ dirname ./bin/setup
++ cd ./bin/..
++ pwd
+ root=/home/user/ruby.wasm

env BUNDLE_GEMFILE="$root/Gemfile" bundle install
+ env BUNDLE_GEMFILE=/home/user/ruby.wasm/Gemfile bundle install
Bundle complete! 7 Gemfile dependencies, 38 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
env BUNDLE_GEMFILE="$root/packages/npm-packages/ruby-wasm-wasi/Gemfile" bundle install
+ env BUNDLE_GEMFILE=/home/user/ruby.wasm/packages/npm-packages/ruby-wasm-wasi/Gemfile bundle install
Bundle complete! 4 Gemfile dependencies, 5 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

# Build vendored jco if Rust toolchain is available and submodule is checked out
if command -v rustc && [ -f vendor/jco/package.json ]; then
  npm -C vendor/jco install
  npm -C vendor/jco run build
else
  echo "Rust toolchain not found or jco submodule not checked out, skipping jco build"
fi
+ command -v rustc
/home/user/.cargo/bin/rustc
+ '[' -f vendor/jco/package.json ']'
+ echo 'Rust toolchain not found or jco submodule not checked out, skipping jco build'
Rust toolchain not found or jco submodule not checked out, skipping jco build
npm ci
+ npm ci

added 344 packages, and audited 352 packages in 3s

90 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

@krmbn0576
Copy link
Contributor Author

$ git submodule update
fatal: destination path '/home/user/ruby.wasm/vendor/jco' already exists and is not an empty directory.
fatal: clone of 'https://github.com/bytecodealliance/jco.git' into submodule path '/home/user/ruby.wasm/vendor/jco' failed
Failed to clone 'vendor/jco'. Retry scheduled
fatal: destination path '/home/user/ruby.wasm/vendor/jco' already exists and is not an empty directory.
fatal: clone of 'https://github.com/bytecodealliance/jco.git' into submodule path '/home/user/ruby.wasm/vendor/jco' failed
Failed to clone 'vendor/jco' a second time, aborting

@kateinoigakukun
Copy link
Member

kateinoigakukun commented May 16, 2024

Could you try removing vendor/jco and git submodule update, then bin/setup again?

@krmbn0576
Copy link
Contributor Author

$ rm -rf vendor
$ git submodule update

Cloning into '/home/user/ruby.wasm/vendor/jco'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), 396 bytes | 396.00 KiB/s, done.
From https://github.com/bytecodealliance/jco
 * branch            fbf3e7559a8f25b9d660b802b4ba25470be784b0 -> FETCH_HEAD
Submodule path 'vendor/jco': checked out 'fbf3e7559a8f25b9d660b802b4ba25470be784b0'

suceeded update submodule, thx! but...

$ ./bin/setup

...
> @bytecodealliance/[email protected] build
> cargo xtask build debug
...

error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-wasi` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-wasi`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Error: command exited with non-zero code `cargo build --workspace --target wasm32-wasi`: 101

so i did rustup target add wasm32-wasi , finally succeeded!
Hmm it seems to depend on the rustup target, so could you please add it to the CONTRIBUTING.md?
Thanks!

@kateinoigakukun
Copy link
Member

Actually, vendor/jco is a temporal solution to make it work before the Kaigi but I should note it in the guide

@kateinoigakukun
Copy link
Member

I've upstreamed all necessary fixes in jco, so jco is no longer vendored as a submodule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants