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

Compile error when crossbeam-utils v0.8.13 in MacOS Big Sur 12.6.1 #7

Closed
morristai opened this issue Nov 21, 2022 · 9 comments
Closed

Comments

@morristai
Copy link

  • wasmedge version 0.11.2
  • rust version: 1.65.0

Hi, just a newbie here, want to ask if anyone occurred this issue by following README.md? Thanks

➤ RUST_BACKTRACE=1 cargo build --target wasm32-wasi --release
   Compiling crossbeam-utils v0.8.13
   Compiling serde_derive v1.0.147
   Compiling cfg-if v1.0.0
   Compiling itoa v1.0.4
   Compiling proc-macro-hack v0.5.19
   Compiling frunk_core v0.4.1
   Compiling minimal-lexical v0.2.1
   Compiling num-traits v0.2.15
   Compiling libloading v0.7.4
error: failed to run custom build command for `crossbeam-utils v0.8.13`

Caused by:
  process didn't exit successfully: `/Users/morris_tai/Documents/Whynot/microservice-rust-mysql/target/release/build/crossbeam-utils-e10b4f58993e0ccd/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'index out of bounds: the len is 2 but the index is 2', /Users/morris_tai/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-utils-0.8.13/build-common.rs:8:18
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
     1: core::panicking::panic_fmt
               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
     2: core::panicking::panic_bounds_check
               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:84:5
     3: <usize as core::slice::index::SliceIndex<[T]>>::index
     4: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
     5: build_script_build::convert_custom_linux_target
     6: build_script_build::main
     7: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
warning: build failed, waiting for other jobs to finish...
@hydai
Copy link
Member

hydai commented Nov 21, 2022

Maybe related to this issue: WasmEdge/rust-mysql-simple-wasi#5

@MediosZ
Copy link

MediosZ commented Nov 22, 2022

This error is caused by a recent commit of crossbeam

We will fix this with crossbeam.

@juntao
Copy link
Member

juntao commented Nov 22, 2022

Can we fix our dependency to a specific version of crossbeam for now? It may take time for them to release a new version.

@MediosZ
Copy link

MediosZ commented Nov 22, 2022

yes, adding these lines in Cargo.toml will fix this issue temporarily on Linux

[patch.crates-io]
crossbeam-utils = { git = "https://github.com/crossbeam-rs/crossbeam.git", rev="46d0aeb" }
crossbeam-queue = { git = "https://github.com/crossbeam-rs/crossbeam.git", rev="46d0aeb" }
crossbeam-epoch = { git = "https://github.com/crossbeam-rs/crossbeam.git", rev="46d0aeb" }

However, it doesn't work on macOS because libz can not be compiled for wasi.
This can be fixed by editing async_mysql

@juntao
Copy link
Member

juntao commented Nov 22, 2022

I mean to change the deps in mysql_async_wasi to fix it at a version of crossbeam that works?

@MediosZ
Copy link

MediosZ commented Nov 22, 2022

Fixing the version of crossbeam doesn't work cause we do not depend on crossbeam-utils directly.
but adding these patches to async_mysql works indeed.

@MediosZ
Copy link

MediosZ commented Nov 22, 2022

Crossbeam has fixed the problem. It should work on linux without any modification.
But for macos, we need to modify async_mysql a bit.

@MediosZ
Copy link

MediosZ commented Nov 22, 2022

It should work for now. @morristai
If there are any other problems, please let us know.

@morristai
Copy link
Author

It works now, you guys are awesome!! 💯

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

5 participants