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

cargo wasix build fails: could not execute rustc #32

Open
jessbowers opened this issue Aug 4, 2023 · 6 comments
Open

cargo wasix build fails: could not execute rustc #32

jessbowers opened this issue Aug 4, 2023 · 6 comments

Comments

@jessbowers
Copy link

On a fresh install of Debian 11 with the latest rustup 1.26.0 following this plan:

mkdir app && cd app
cargo init
cargo install cargo-wasix
cargo wasix build

The toolchain reports that it's linked & available, but I get a ton of errors related to libc not found. Then a final "could not execute rustc"

dev@localhost:~/app$ 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-07-21.1/wasix-libc.tar.gz'...
Extracting...
Downloading Rust toolchain from url 'https://github.com/wasix-org/rust/releases/download/v2023-07-21.1/rust-toolchain-x86_64-unknown-linux-gnu.tar.gz'...
Extracting...
Downloaded toolchain x86_64-unknown-linux-gnu to /home/dev/.local/share/cargo-wasix/toolchains/x86_64-unknown-linux-gnu_v2023-07-21.1/rust
Activating rustup toolchain wasix at /home/dev/.local/share/cargo-wasix/toolchains/x86_64-unknown-linux-gnu_v2023-07-21.1/rust...
Running rustup toolchain link wasix /home/dev/.local/share/cargo-wasix/toolchains/x86_64-unknown-linux-gnu_v2023-07-21.1/rust:
rustup toolchain wasix was linked and is now available!
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/dev/.rustup/toolchains/wasix/bin/rustc)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/dev/.rustup/toolchains/wasix/lib/librustc_driver-239bacfa42cce6c3.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/dev/.rustup/toolchains/wasix/lib/librustc_driver-239bacfa42cce6c3.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/dev/.rustup/toolchains/wasix/lib/librustc_driver-239bacfa42cce6c3.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/dev/.rustup/toolchains/wasix/lib/librustc_driver-239bacfa42cce6c3.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/dev/.rustup/toolchains/wasix/lib/librustc_driver-239bacfa42cce6c3.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /home/dev/.rustup/toolchains/wasix/lib/librustc_driver-239bacfa42cce6c3.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/dev/.rustup/toolchains/wasix/lib/libstd-9047e6e40084bd20.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/dev/.rustup/toolchains/wasix/lib/libstd-9047e6e40084bd20.so)
/home/dev/.rustup/toolchains/wasix/bin/rustc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /home/dev/.rustup/toolchains/wasix/lib/libstd-9047e6e40084bd20.so)
error: Could not execute rustc

Caused by:
    failed to execute "rustc" "+wasix" "--print" "sysroot"
        status: exit status: 1
@jessbowers
Copy link
Author

Trying to build the toolchain from scratch, I got another error:

 cargo wasix build-toolchain
...
...
libc-top-half/musl/src/conf/sysconf.c:264:38: error: incompatible pointer types passing 'unsigned long *' to parameter of type '__wasi_size_t *' (aka 'unsigned int *') [-Werror,-Wincompatible-pointer-types]
                        int r = __wasi_thread_parallelism(&n_cpus);
                                                          ^~~~~~~
/home/dev/.wasix/wasix-libc/sysroot/include/wasi/api_wasix.h:3448:20: note: passing argument to parameter 'retptr0' here
    __wasi_size_t *retptr0
                   ^
1 error generated.
make: *** [Makefile:569: build/wasm64-wasi/libc-top-half/musl/src/conf/sysconf.o] Error 1
make: *** Waiting for unfinished jobs....
error: could not build sysroot64

Caused by:
    failed to execute cd "/home/dev/.wasix/wasix-libc" && PATH="/home/dev/.wasix/llvm-15/bin:/home/dev/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" "bash" "./build64.sh"
        status: exit status: 2

@dynamite-bud
Copy link
Contributor

@theduke can you try to reproduce it?

@jessbowers
Copy link
Author

Note that using Debian 12 does not have this issue. I think it has to do with the version of GLIBC

@Dzejkop
Copy link

Dzejkop commented Aug 13, 2023

I'm seeing the same issue:

OS: Ubuntu 20.04.6 LTS on Windows 10 x86_64
Kernel: 5.15.90.1-microsoft-standard-WSL2

> cargo --version
cargo 1.73.0-nightly (d78bbf4bd 2023-08-03) (but same issue happened with 1.68)

> rustc --version
rustc 1.73.0-nightly (28eb857b9 2023-08-12)

> cargo wasix --version
cargo-wasix 0.1.21

@Dzejkop
Copy link

Dzejkop commented Aug 13, 2023

Updating to Ubuntu 22.04 resolved the issue

@Firaenix
Copy link

This is also an issue for me on Debian 11.

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

No branches or pull requests

4 participants