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

thread 'main' panicked at 'called Option::unwrap() on a None value' #57

Open
rdanter opened this issue Sep 26, 2022 · 1 comment
Open

Comments

@rdanter
Copy link

rdanter commented Sep 26, 2022

I am trying to create a recipe for a fairly simple package and ran into a problem. I have reproduced the issue with the following trivial Cargo.toml for a simple "Hello World" example:

[package]
name = "hello"
description = "Hello, World example"
license = "BSD"
version = "0.1.0"
repository = "https://helloworld.com/hello_cargo"
edition = "2018"

[dependencies]

Note that the real package I am working on has a github repository set, so the fake repository used here is not the issue.

The error is the following:

No package.homepage set in your Cargo.toml, trying package.repository
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /usr/local/rust/cargo/registry/src/github.com-1ecc6299db9ec823/cargo-bitbake-0.3.16/src/git.rs:69:66
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Ignore the homepage part, that is easily fixed but the failure in git.rs remains.

With backtrace:

No package.homepage set in your Cargo.toml, trying package.repository
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /usr/local/rust/cargo/registry/src/github.com-1ecc6299db9ec823/cargo-bitbake-0.3.16/src/git.rs:69:66
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panicking.rs:48:5
   3: cargo_bitbake::git::git_to_yocto_git_url
   4: cargo_bitbake::git::ProjectRepo::new
   5: cargo_bitbake::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I am using Rust version 1.64.0 (a55dd71d5 2022-09-19) on Linux Mint 21 (based on Ubuntu 22.04) on an x86-64 host.

Is this a bug or am I missing something in the Cargo.toml file?

@ilha
Copy link

ilha commented Apr 10, 2023

I'm also observing the same issue. Tried all sorts of formats to the repository URL, same issue:

> rustc --version
rustc 1.67.1 (d5a82bbd2 2023-02-07)

 > RUST_BACKTRACE=full cargo bitbake
No package.homepage set in your Cargo.toml, trying package.repository
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /users/ilha/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-bitbake-0.3.16/src/git.rs:69:46
stack backtrace:
   0:     0x56348ddf5c5a - std::backtrace_rs::backtrace::libunwind::trace::h79937bc171ada62c
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x56348ddf5c5a - std::backtrace_rs::backtrace::trace_unsynchronized::h2292bca8571cb919
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x56348ddf5c5a - std::sys_common::backtrace::_print_fmt::h9c461f248e4ae90d
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x56348ddf5c5a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he9fe6bf1a39182e1
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x56348de1ce5e - core::fmt::write::h032658c119c720d7
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/fmt/mod.rs:1208:17
   5:     0x56348ddf1605 - std::io::Write::write_fmt::h299fc90dfae41c0d
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/io/mod.rs:1682:15
   6:     0x56348ddf5a25 - std::sys_common::backtrace::_print::heb70d25df9937e3f
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x56348ddf5a25 - std::sys_common::backtrace::print::had745c0a76b8b521
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x56348ddf789f - std::panicking::default_hook::{{closure}}::h1ea782cdfa2fd097
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:267:22
   9:     0x56348ddf75db - std::panicking::default_hook::h1cc3af63455a163c
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:286:9
  10:     0x56348ddf7fac - std::panicking::rust_panic_with_hook::h5cafdc4b3bfd5528
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:688:13
  11:     0x56348ddf7d02 - std::panicking::begin_panic_handler::{{closure}}::hf31c60f40775892c
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:577:13
  12:     0x56348ddf610c - std::sys_common::backtrace::__rust_end_short_backtrace::h28a5c7be595826cd
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x56348ddf7a52 - rust_begin_unwind
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:575:5
  14:     0x56348d8ce2c3 - core::panicking::panic_fmt::h8fa27a0b37dd98b7
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:64:14
  15:     0x56348d8ce39d - core::panicking::panic::h545818946343732b
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/panicking.rs:111:5
  16:     0x56348d8d7c21 - cargo_bitbake::git::git_to_yocto_git_url::h2cd3d2bc29c2976d
  17:     0x56348d8d825a - cargo_bitbake::git::ProjectRepo::new::h7982fc6a26655014
  18:     0x56348d8e54cc - cargo_bitbake::main::hd293364987f71aaa
  19:     0x56348d8d33b3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h61d8164f5f488eff
  20:     0x56348d8d33c9 - std::rt::lang_start::{{closure}}::hb9d5f075dab050db
  21:     0x56348ddebcdc - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hfa1c3687c9a20bb8
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/core/src/ops/function.rs:606:13
  22:     0x56348ddebcdc - std::panicking::try::do_call::h0497133ebe1341e5
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:483:40
  23:     0x56348ddebcdc - std::panicking::try::h6c3de05c7ca5d07f
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:447:19
  24:     0x56348ddebcdc - std::panic::catch_unwind::h969058ecb5334b30
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panic.rs:137:14
  25:     0x56348ddebcdc - std::rt::lang_start_internal::{{closure}}::h0de6d98cafb42a58
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/rt.rs:148:48
  26:     0x56348ddebcdc - std::panicking::try::do_call::h77301dcf43953993
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:483:40
  27:     0x56348ddebcdc - std::panicking::try::h45b05523a2fe135a
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panicking.rs:447:19
  28:     0x56348ddebcdc - std::panic::catch_unwind::hd95cea544b2b9bd2
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/panic.rs:137:14
  29:     0x56348ddebcdc - std::rt::lang_start_internal::hd16e6ff7bf05a444
                               at /rustc/d5a82bbd26e1ad8b7401f6a718a9c57c96905483/library/std/src/rt.rs:148:20
  30:     0x56348d8e6e05 - main
  31:     0x7f7dd8117840 - __libc_start_main
                               at /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291
  32:     0x56348d8ce939 - _start
  33:                0x0 - <unknown>

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

2 participants