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

Nightly regression with -Z build-std for wasm32-unknown-unknown #69090

Closed
daxpedda opened this issue Feb 12, 2020 · 3 comments
Closed

Nightly regression with -Z build-std for wasm32-unknown-unknown #69090

daxpedda opened this issue Feb 12, 2020 · 3 comments
Labels
C-bug Category: This is a bug.

Comments

@daxpedda
Copy link
Contributor

cargo build --target wasm32-unknown-unknown -Z build-std
Gives this error:
error: duplicate lang item in crate `core`: `bool`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `char`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `str`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `slice`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `slice_u8`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `const_ptr`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `mut_ptr`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `i8`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `i16`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `i32`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `i64`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `i128`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `isize`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `u8`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `u16`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `u32`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `u64`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `u128`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `usize`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `f32`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `f64`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `sized`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `unsize`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `structural_peq`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `structural_teq`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `copy`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `clone`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `sync`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `freeze`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `drop`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `coerce_unsized`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `dispatch_from_dyn`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `add`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `sub`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `mul`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `div`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `rem`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `neg`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `not`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `bitxor`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `bitand`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `bitor`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `shl`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `shr`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `add_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `sub_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `mul_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `div_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `rem_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `bitxor_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `bitand_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `bitor_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `shl_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `shr_assign`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `index`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `index_mut`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `unsafe_cell`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `va_list`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `deref`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `deref_mut`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `receiver`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `fn`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `fn_mut`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `fn_once`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `future_trait`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `generator_state`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `generator`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `unpin`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `pin`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `eq`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `partial_ord`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `panic`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `panic_bounds_check`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `panic_info`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `panic_location`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `drop_in_place`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `alloc_layout`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `phantom_data`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `manually_drop`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `maybe_uninit`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: duplicate lang item in crate `core`: `align_offset`.
  |
  = note: first defined in crate `core` (which `std` depends on).

error: aborting due to 81 previous errors

error: could not compile `test-wasm`.

I have narrowed it down to this:
nightly-2019-12-21: works
nightly-2019-12-22: doesn't work anymore
nightly-2020-02-12 (current): still doesn't work

It does work with #![no_std] though.
Other target I tried that worked: x86_64-pc-windows-msvc.
Should I report this here: https://github.com/rust-lang/wg-cargo-std-aware?

@daxpedda daxpedda added the C-bug Category: This is a bug. label Feb 12, 2020
@ehuss
Copy link
Contributor

ehuss commented Feb 12, 2020

It is most helpful if build-std bugs are reported at https://github.com/rust-lang/wg-cargo-std-aware or https://github.com/rust-lang/cargo/issues/.

The issue here is that it currently does not know which panic strategy each platform requires, and assumes "unwind". wasm32 needs the "abort" strategy, which requires the panic_abort crate. You can run with -Zbuild-std=panic_abort,std.

This issue is tracked in rust-lang/wg-cargo-std-aware#29

@jonas-schievink
Copy link
Contributor

Closing in favor of rust-lang/wg-cargo-std-aware#29 then

@daxpedda
Copy link
Contributor Author

I just confirmed it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants