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

cargo-docset does not support virtual manifest workspaces #25

Closed
lilyball opened this issue Apr 28, 2021 · 2 comments · Fixed by #27
Closed

cargo-docset does not support virtual manifest workspaces #25

lilyball opened this issue Apr 28, 2021 · 2 comments · Fixed by #27
Labels
T: bug Something isn't working
Milestone

Comments

@lilyball
Copy link

Describe the bug
When using a workspace that uses a virtual manifest, cargo-docset docset panics with

thread 'main' panicked at 'Cargo.toml doesn't have a package table', src/commands/generate.rs:343:18

A virtual manifest workspace is one without a "root" package. cargo doc works just fine here (cargo doc --workspace --open just opens to the first crate in the workspace members list, but it includes all the crates).

It appears that cargo-docset is attempting to look up the root package name here. For virtual manifest workspaces, it would be really great if it could support a flag to provide a docset name, and default to the name of the containing folder. Until such time as cargo doc synthesizes a proper landing page for the docset, cargo-docset could just default to the first member crate exactly as cargo doc does (or it could synthesize a common landing page).

As a workaround, I can invoke cargo-docset docset --all from one of the member crates, but the resulting docset is named after that member crate.

To Reproduce
Steps to reproduce the behavior:

  1. Make a virtual manifest workspace (a workspace whose Cargo.toml contains a [workspace] section but not a [package] section)
  2. From the root of that workspace, run cargo-docset docset.

Expected behavior
It should build a docset for the workspace.

@Robzz Robzz added the T: bug Something isn't working label Apr 28, 2021
@Robzz
Copy link
Owner

Robzz commented Apr 28, 2021

Hi, thanks for the bug report. I'll try and look into that soon.

@Robzz
Copy link
Owner

Robzz commented Apr 29, 2021

It should now work. I haven't provided a flag to rename the docset yet, so the docset's name will be the same as the directory containing the virtual manifest, but it's one of the flags I was planning to add, I'll try to slip it in before the next release, as there's a couple of things I want to do before then. I'm hoping to ship the release by the end of next week :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants