GetFirefly / firefly

An alternative BEAM implementation, designed for WebAssembly
Apache License 2.0
3.61k stars 104 forks source link

Building example fails with unresolved dlmalloc import #394

Closed blambillotte closed 4 years ago

blambillotte commented 4 years ago

Attempting to wasm-pack build the interpreter-in-browser example errors with the current rust nightly. It appears core::alloc::Alloc no longer exists?

Error:

error[E0432]: unresolved import `core::alloc::Alloc`
  --> /Users/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/dlmalloc-0.1.3/src/lib.rs:21:19
   |
21 | use core::alloc::{Alloc, Layout, AllocErr};
   |                   ^^^^^ no `Alloc` in `alloc`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `dlmalloc`.

Falling back to an older rust nightly seemed to resolve this rustup install nightly-2020-01-02 -> rustup default nightly-2020-01-02

Very new to Rust so apologies if I'm missing something fundamental.

KronicDeth commented 4 years ago

It's possible I'm still back in December:

rustc --version
rustc 1.41.0-nightly (19bd93467 2019-12-18)

I'll update to latest and update anything that needs to be fixed.

KronicDeth commented 4 years ago

I can reproduce after updating

rustc --version
rustc 1.43.0-nightly (6d69caba1 2020-02-27)
KronicDeth commented 4 years ago

Alloc was renamed to AllocRef in https://github.com/rust-lang/rust/commit/7ca25db8162128808714f536fa993aefcf6a2239#diff-1b08d266cc36e37196b43a2251a5392b and https://github.com/rust-lang/rust/commit/8bbaeb7ff9a830e85106a00c84a1aa262f77a7f3#diff-1b08d266cc36e37196b43a2251a5392b

KronicDeth commented 4 years ago

This is going to take a bit. @hansihe bumpalo needs to updated for compatibility too.

hansihe commented 4 years ago

For the eir parts, this is actually mostly done already locally. I'll try to get things cleaned up and pushed tomorrow

KronicDeth commented 4 years ago

Since the macOS build doesn't pin the rust version, all macOS builds are broke like (https://github.com/lumen/lumen/pull/395/checks?check_run_id=478804604).

bitwalker commented 4 years ago

Closing, as this should no longer be an issue