docs.rs icon indicating copy to clipboard operation
docs.rs copied to clipboard

A crate that exists on crates.io does not exist on docs.rs

Open kornelski opened this issue 1 year ago • 5 comments

This crate is on crates.io:

https://crates.io/crates/emheap

but docs.rs reports "The requested crate does not exist: no such crate".

https://docs.rs/emheap

This is surprising. The crate isn't yanked. It's in the index. Usually even if crates fail to build docs.rs shows some basic page for it.

kornelski avatar Apr 07 '24 23:04 kornelski

It may be because the crate has cargo.toml (lowercase).

kornelski avatar Apr 07 '24 23:04 kornelski

We do have the failure to build after publish in the queue:

   id   |  name  | version | attempt |         build_time         | priority | registry | last_attempt
--------+--------+---------+---------+----------------------------+----------+----------+--------------
 516293 | emheap | 0.1.0   |       5 | 2022-04-20 04:08:29.528233 |        0 |          |
 516306 | emheap | 0.1.1   |       5 | 2022-04-20 04:45:52.937317 |        0 |          |

I'll requeue it to be built against and see if there's anything interesting in the logs.

Nemo157 avatar Apr 08 '24 07:04 Nemo157

Yep, the failure is because it's missing the Cargo.toml:

Failed to build package emheap-0.1.0 from queue
Caused by:
    missing Cargo.toml

I don't think we should do anything about this, the crate is invalid, downloading locally cargo also refuses to do anything with it

> cargo metadata
error: could not find `Cargo.toml` in `/tmp/scratch.rust.2024-04-08T09-58.Yi6HRM/emheap-0.1.1` or any parent directory, but found cargo.toml please try to rename it to Cargo.toml

Nemo157 avatar Apr 08 '24 08:04 Nemo157

It not appearing in the database at all because of the failure is another variant of https://github.com/rust-lang/docs.rs/issues/797, which will be fixed by https://github.com/rust-lang/docs.rs/pull/2467, so it should appear as a build failure once that's done.

Nemo157 avatar Apr 08 '24 08:04 Nemo157

~~Hmmm, actually #2467 won't fix it since that still relies on reading the Cargo.toml to pull the minimum data required to add the crate into the database.~~

Nemo157 avatar Apr 08 '24 08:04 Nemo157

Hey @kornelski. I fixed the issue on the provided example with this change. This issue might be a candidate to close.

byfnoel avatar Apr 29 '24 14:04 byfnoel

@byfnoel thanks, but I'll leave it open, because docs.rs needs to decide what to do with this kind of problems in crates in general, not only yours.

kornelski avatar Apr 29 '24 14:04 kornelski

Ok @kornelski. That's fine!

byfnoel avatar Apr 29 '24 15:04 byfnoel

@byfnoel thanks, but I'll leave it open, because docs.rs needs to decide what to do with this kind of problems in crates in general, not only yours.

coming back to this issue.

Our current plan with #2467 is that we would finally surface these kind of errors the same way as "normal" build errors. So the crate would appear, the version would too, and only showed as failed with the error above ( "could not find Cargo.toml...")

Also after #2467 we'll be able to run our consistency check, so we would also add past releases / crates where this happened.

syphar avatar Jun 15 '24 08:06 syphar