wasix-org/cargo-wasix

wasix build not working on macos aarch64 after install

Closed this issue · 2 comments

Hi,

I just installed cargo-wasix with cargo install cargo-wasix but after writing a simple fibonacci application I cant seem to get it building or running with wasix.

❯ cargo wasix run
error: couldn't read +wasix: No such file or directory (os error 2)

error: aborting due to previous error

error: Could not execute rustc

Caused by:
    failed to execute "rustc" "+wasix" "--print" "sysroot"
        status: exit status: 1

This is happening on macOS Ventura 13.5.1 on an M1 Max

I just ran into this as well.

It seems like the cargo wasix self clean command doesn't remove everything, so rustup gets left in an inconsistent state.

Here is what I was seeing:

$ cargo wasix build
error: toolchain 'wasix' is not installed
error: Could not execute rustc

Caused by:
    failed to execute "rustc" "+wasix" "--print" "sysroot"
        status: exit status: 1

$ rustc +wasix --print sysroot
error: toolchain 'wasix' is not installed

But if we check rustup, we'll see the wasix toolchain is still "installed".

$ rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/work/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin
nightly-2023-05-25-aarch64-apple-darwin
nightly-2023-08-07-aarch64-apple-darwin
nightly-aarch64-apple-darwin (default)
1.56-aarch64-apple-darwin
1.63-aarch64-apple-darwin
1.64-aarch64-apple-darwin
1.65-aarch64-apple-darwin
1.66-aarch64-apple-darwin
1.67-aarch64-apple-darwin
1.69-aarch64-apple-darwin
1.70-aarch64-apple-darwin
1.71-aarch64-apple-darwin
wasix

installed targets for active toolchain
--------------------------------------

aarch64-apple-darwin
riscv64gc-unknown-linux-gnu
wasm32-unknown-unknown
wasm32-wasi

active toolchain
----------------

nightly-aarch64-apple-darwin (default)
rustc 1.75.0-nightly (75b064d26 2023-11-01)

You need to tell rustup to remove the toolchain before cargo wasix will download it again.

$ rustup toolchain remove wasix
info: uninstalling toolchain 'wasix'
info: toolchain 'wasix' uninstalled

$ cargo wasix build
Finding latest release... (https://api.github.com/repos/wasix-org/rust/releases/latest)...
Downloading sysroot from url 'https://github.com/wasix-org/rust/releases/download/v2023-11-01.1/wasix-libc.tar.gz'...
...

This was fixed in the latest release: v2023-11-01.1