meta-rust / cargo-bitbake

cargo extension that can generate BitBake recipes utilizing the classes from meta-rust
Apache License 2.0
85 stars 59 forks source link

cargo bitbake crashes #24

Closed fneddy closed 3 years ago

fneddy commented 3 years ago

i dont know why but it crashes even on a clean hello_world.

steps to reproduce

> cargo new --bin hello_world
> cd hello_world
> cargo bitbake
Package name contains an underscore
thread 'main' panicked at 'attempted to zero-initialize type `sized_chunks::sized_chunk::Chunk<(core::package_id::PackageId, im_rc::OrdMap<core::package_id::PackageId, std::vec::Vec<core::dependency::Dependency>>)>`, which is invalid', /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:636:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

> env RUST_BACKTRACE=1 cargo bitbake
Package name contains an underscore
thread 'main' panicked at 'attempted to zero-initialize type `sized_chunks::sized_chunk::Chunk<(core::package_id::PackageId, im_rc::OrdMap<core::package_id::PackageId, std::vec::Vec<core::dependency::Dependency>>)>`, which is invalid', /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:636:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/core/src/panicking.rs:50:5
   3: cargo::core::resolver::encode::EncodableResolve::into_resolve
   4: cargo::ops::lockfile::load_pkg_lockfile
   5: cargo::ops::resolve::resolve_with_registry
   6: cargo::ops::resolve::resolve_ws
   7: cargo_bitbake::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

> env RUST_BACKTRACE=full cargo bitbake
Package name contains an underscore
thread 'main' panicked at 'attempted to zero-initialize type `sized_chunks::sized_chunk::Chunk<(core::package_id::PackageId, im_rc::OrdMap<core::package_id::PackageId, std::vec::Vec<core::dependency::Dependency>>)>`, which is invalid', /home/eddy/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:636:9
stack backtrace:
0:     0x557864e0aa10 - std::backtrace_rs::backtrace::libunwind::trace::hb4de9797f80b7b8c
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
1:     0x557864e0aa10 - std::backtrace_rs::backtrace::trace_unsynchronized::h59566d0bd20efff7
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2:     0x557864e0aa10 - std::sys_common::backtrace::_print_fmt::hcfa5ce6be50275d4
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/sys_common/backtrace.rs:67:5
3:     0x557864e0aa10 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd8c307a38b9bab04
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/sys_common/backtrace.rs:46:22
4:     0x557864e2ef6c - core::fmt::write::h3868db8542c90941
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/core/src/fmt/mod.rs:1092:17
5:     0x557864e05022 - std::io::Write::write_fmt::hab90295d5a0f197d
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/io/mod.rs:1568:15
6:     0x557864e0d385 - std::sys_common::backtrace::_print::h19224910b8700cf1
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/sys_common/backtrace.rs:49:5
7:     0x557864e0d385 - std::sys_common::backtrace::print::h25dedfa68c5fb84a
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/sys_common/backtrace.rs:36:9
8:     0x557864e0d385 - std::panicking::default_hook::{{closure}}::h12c5765653a72a42
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:208:50
9:     0x557864e0ce33 - std::panicking::default_hook::he65cee71c4209f0c
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:225:9
10:     0x557864e0db21 - std::panicking::rust_panic_with_hook::h01a674d863fe0d8a
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:591:17
11:     0x557864e0d637 - std::panicking::begin_panic_handler::{{closure}}::h9b9fecf185178864
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:495:13
12:     0x557864e0aeac - std::sys_common::backtrace::__rust_end_short_backtrace::h57be46a42dc7f24b
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/sys_common/backtrace.rs:141:18
13:     0x557864e0d5c9 - rust_begin_unwind
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:493:5
14:     0x557864e2d711 - core::panicking::panic_fmt::h20225113c4a2f8fd
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/core/src/panicking.rs:92:14
15:     0x557864e2d65d - core::panicking::panic::h35b77276aa4b0c12
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/core/src/panicking.rs:50:5
16:     0x557864a87314 - cargo::core::resolver::encode::EncodableResolve::into_resolve::h2f748dd6fbb45b10
17:     0x557864add504 - cargo::ops::lockfile::load_pkg_lockfile::h890294a2b2ae1271
18:     0x55786499c2b2 - cargo::ops::resolve::resolve_with_registry::hc17182a46b1ce1f3
19:     0x55786499bffc - cargo::ops::resolve::resolve_ws::h756b4fb615ab36cc
20:     0x5578649845b5 - cargo_bitbake::main::h5a9984559c9d0925
21:     0x55786497a1e6 - std::sys_common::backtrace::__rust_begin_short_backtrace::h9efb7d1592b8fc7e
22:     0x55786498bacc - std::rt::lang_start::{{closure}}::h8bcc286ab3d85600
23:     0x557864e0e02a - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2c4fd7d4128112a8
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/core/src/ops/function.rs:259:13
24:     0x557864e0e02a - std::panicking::try::do_call::h41fb7dbbbe7bece6
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:379:40
25:     0x557864e0e02a - std::panicking::try::hd38008ccba72bce1
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panicking.rs:343:19
26:     0x557864e0e02a - std::panic::catch_unwind::h057e765cd60f2d13
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/panic.rs:431:14
27:     0x557864e0e02a - std::rt::lang_start_internal::hdb9d0b9d2cdcda8b
                            at /rustc/3e826bb11228508fbe749e594038d6727208aa94/library/std/src/rt.rs:51:25
28:     0x5578649869c5 - main
29:     0x7f0aa33d21e2 - __libc_start_main
30:     0x557864972f4e - _start
31:                0x0 - <unknown>
aj-bagwell commented 3 years ago

This looks to be because sized-chunks version 0.3.1 panic since rustc version 1.48.0 Updating to a newer version of cargo like in PR #21 should fix it.

fneddy commented 3 years ago

I tried PR #21 and can confirm that it works.

katyo commented 3 years ago

I have same issue (rustc 1.50.0). The solution from PR #21 help to get it works. (I set cargo dependency to ^0.50 because 0.49 failed to build using Rust 1.50)

kraj commented 3 years ago

should we upgrade to 1.50 for cargo as well ? perhaps #21 can be updated ?