Coder Social home page Coder Social logo

Unable to generate docset about cargo-docset HOT 7 CLOSED

robzz avatar robzz commented on July 21, 2024 1
Unable to generate docset

from cargo-docset.

Comments (7)

saskenuba avatar saskenuba commented on July 21, 2024 2

This happened to me as well with the exact same error. The workaround I found was to rename Cargo.lock, generate the docset and then rename it back.

Cargo doc generation works normally with Cargo.lock

from cargo-docset.

Robzz avatar Robzz commented on July 21, 2024 1

That's definitely interesting, thank you for the workaround. My guess is that the version of cargo cargo-docset links with probably can't understand the lock file generated by a more recent version of cargo that you use for development.

I could simply update the version of cargo we link against, but that would force me to release a new version for every new Rust release, which is less than ideal. Alternatively, I could remove the direct dependency on cargo and invoke it through std::process::Command, which may make things a bit more complicated and force me to rewrite part of the code, but would have the benefit of drastically cutting on the compile time for cargo-docset. I'll need to think on this when I'm a bit more awake, but at least we now know of a workaround in the meantime.

from cargo-docset.

Robzz avatar Robzz commented on July 21, 2024 1

Alright, if this crate needs to constantly try and keep up with cargo releases in lockstep to avoid these issues, then I think the sane thing to do here for the sake of maintainability is probably to drop the cargo dependency and just invoke it as a subprocess. It's not like this crate really needs to depend on cargo anyway, and cargo probably accounts for like 90% of the total compile time. I'll get on that ASAP.

from cargo-docset.

Robzz avatar Robzz commented on July 21, 2024

Thank you for the report. I never encountered that one so far despite using cargo-docset in workspaces, and the fact that cargo doc runs fine is certainly confusing, I'm gonna need some more information. Do you have the repository that causes the error online ? Being able to reproduce the problem would be a great start.

from cargo-docset.

Karrq avatar Karrq commented on July 21, 2024

I'm sorry but at this point in time the repository is private. I tried to make a minimal example with some path dependencies and some git dependencies and even colliding dependencies (one package depends on [email protected] and the other [email protected] but failed to do so...

from cargo-docset.

Robzz avatar Robzz commented on July 21, 2024

Yeah I've already tried these too, without problems. A minimal example would be very helpful indeed, at this point there's not much that I can do without it. Please let me know if you manage to create one.

from cargo-docset.

joelparkerhenderson avatar joelparkerhenderson commented on July 21, 2024

Same error message: "Cargo doc error: failed to parse lock file at: …/Cargo.lock"

You asked for a public repo: https://github.com/joelparkerhenderson/demo_rust_rocket

The repo is a typical demo of a typical Rust Rocket app, so I hope you can use it as a good example case. Rust Rocket does use Rust nightly, so perhaps that's relevant. And when I installed cargo-docset, it installed via Rust nightly.

The same error message is happening with my private Rocket repos as well.

When I try the workaround of rename (as above) then cargo docset succeeds.

from cargo-docset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.