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

Missing “Generated” status for cargo rustdoc --output-format json #13303

Closed
weihanglo opened this issue Jan 15, 2024 · 3 comments · Fixed by #13325
Closed

Missing “Generated” status for cargo rustdoc --output-format json #13303

weihanglo opened this issue Jan 15, 2024 · 3 comments · Fixed by #13325
Assignees
Labels
C-bug Category: bug Command-rustdoc E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@weihanglo
Copy link
Member

weihanglo commented Jan 15, 2024

Problem

For HTML format, cargo rustdoc would output a “Generated” status showing the file path

 Documenting foo v0.1.0 (/home/rust/foo)
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
   Generated /home/rust/foo/target/doc/foo/index.html

However, for --output-format json you cannot find the “Generated” status.

Steps

  1. cargo new foo
  2. cd foo
  3. cargo +nightly rustdoc -Zunstable-options --output-format json

Possible Solution(s)

Expect there is a corresponding "Generated" status for JSON format.

For --open different formats are handled, but for "Generated" they aren't.

let path = if matches!(options.output_format, OutputFormat::Json) {
compilation.root_output[&kind]
.with_file_name("doc")
.join(format!("{}.json", &name))
} else {
compilation.root_output[&kind]
.with_file_name("doc")
.join(&name)
.join("index.html")
};

let path = compilation.root_output[&kind]
.with_file_name("doc")
.join(&name)
.join("index.html");

Notes

No response

Version

cargo 1.77.0-nightly (84976cd69 2024-01-12)
release: 1.77.0-nightly
commit-hash: 84976cd699f4aea56cb3a90ce3eedeed9e20d5a5
commit-date: 2024-01-1
@weihanglo weihanglo added C-bug Category: bug E-easy Experience: Easy Command-rustdoc S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review labels Jan 15, 2024
@kanru
Copy link
Contributor

kanru commented Jan 15, 2024

May I take this?

@weihanglo
Copy link
Member Author

@kanru yeah sure. You can use @rustbot claim to assign this issue to yourself.

Feel free to reach us out on Zulip or office hour.

@kanru
Copy link
Contributor

kanru commented Jan 16, 2024

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-rustdoc E-easy Experience: Easy S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants