Skip to content

Panic building a crate without a cargo.toml #970

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

Closed
jyn514 opened this issue Aug 15, 2020 · 6 comments
Closed

Panic building a crate without a cargo.toml #970

jyn514 opened this issue Aug 15, 2020 · 6 comments
Labels
A-builds Area: Building the documentation for a crate C-bug Category: This is a bug P-low Low priority issues

Comments

@jyn514
Copy link
Member

jyn514 commented Aug 15, 2020

How could crates not have a cargo.toml and still be published to crates.io ???

Aug 09 02:50:11 docsrs cratesfyi[27117]: 2020/08/09 02:50:11 [INFO] rustwide::crates::cratesio: extracting crate reactiontime 0.1.0 into /home/cratesfyi/workspace/builds/reactiontime-0.1.0/source
Aug 09 02:50:11 docsrs cratesfyi[27117]: 2020/08/09 02:50:11 [INFO] rustwide::prepare: validating manifest of crates.io crate reactiontime 0.1.0 on toolchain nightly
Aug 09 02:50:11 docsrs cratesfyi[27117]: 2020/08/09 02:50:11 [ERROR] cratesfyi::build_queue: Failed to build package reactiontime-0.1.0 from queue: missing Cargo.toml
Aug 09 02:50:11 docsrs cratesfyi[27117]: Backtrace:    0: failure::backtrace::internal::InternalBacktrace::new
Aug 09 02:50:11 docsrs cratesfyi[27117]:    1: <failure::backtrace::Backtrace as core::default::Default>::default
Aug 09 02:50:11 docsrs cratesfyi[27117]:    2: rustwide::prepare::Prepare::prepare
Aug 09 02:50:11 docsrs cratesfyi[27117]:    3: rustwide::build::BuildBuilder::run
Aug 09 02:50:11 docsrs cratesfyi[27117]:    4: cratesfyi::docbuilder::rustwide_builder::RustwideBuilder::build_package
Aug 09 02:50:11 docsrs cratesfyi[27117]:    5: cratesfyi::build_queue::BuildQueue::process_next_crate
Aug 09 02:50:11 docsrs cratesfyi[27117]:    6: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
Aug 09 02:50:11 docsrs cratesfyi[27117]:    7: cratesfyi::utils::queue_builder::queue_builder
Aug 09 02:50:11 docsrs cratesfyi[27117]:    8: std::sys_common::backtrace::__rust_begin_short_backtrace
Aug 09 02:50:11 docsrs cratesfyi[27117]:    9: core::ops::function::FnOnce::call_once{{vtable.shim}}
Aug 09 02:50:11 docsrs cratesfyi[27117]:   10: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
Aug 09 02:50:11 docsrs cratesfyi[27117]:              at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
Aug 09 02:50:11 docsrs cratesfyi[27117]:       <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
Aug 09 02:50:11 docsrs cratesfyi[27117]:              at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
Aug 09 02:50:11 docsrs cratesfyi[27117]:       std::sys::unix::thread::Thread::new::thread_start
Aug 09 02:50:11 docsrs cratesfyi[27117]:              at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/libstd/sys/unix/thread.rs:87
Aug 09 02:50:11 docsrs cratesfyi[27117]:   11: start_thread
Aug 09 02:50:11 docsrs cratesfyi[27117]:   12: __clone
@jyn514 jyn514 added C-bug Category: This is a bug A-builds Area: Building the documentation for a crate labels Aug 15, 2020
@Nemo157
Copy link
Member

Nemo157 commented Aug 15, 2020

It has cargo.toml instead, only way I can think of this happening is it was published by something other than cargo, and crates.io doesn't actually validate the content of the crate archive (or that validation is lacking compared to what cargo does).

@Nemo157
Copy link
Member

Nemo157 commented Aug 15, 2020

Ohhhhh, case-insensitive filesystem maybe? Probably needs a cargo bug ticket.

@pietroalbini
Copy link
Member

I think we can change rustwide to rename cargo.toml to Cargo.toml if the latter is missing.

@Nemo157
Copy link
Member

Nemo157 commented Aug 15, 2020

Cargo doesn't support it either, trying to build with a dependency on reactiontime on a case-sensitive filesystem gives

error: failed to read `/home/nemo157/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/reactiontime-0.1.0/Cargo.toml`

@jyn514
Copy link
Member Author

jyn514 commented Aug 15, 2020

I think the fix here should be to give a build failure if Cargo.toml is missing. In a sense this is really the same as #797, but we also panic on the error.

@jyn514 jyn514 added the P-low Low priority issues label Aug 15, 2020
@jyn514
Copy link
Member Author

jyn514 commented Sep 19, 2020

Err .. it turns out this isn't actually a panic, just error logging. So there's no panics going on here. The only issue is that the build failure isn't recorded (#797).

@jyn514 jyn514 closed this as completed Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate C-bug Category: This is a bug P-low Low priority issues
Projects
None yet
Development

No branches or pull requests

3 participants