-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
copy doc output files by format #104286
copy doc output files by format #104286
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
src/bootstrap/doc.rs
Outdated
DocumentationFormat::HTML if extension != Some("json") => { | ||
builder.copy(&path, &dst) | ||
} | ||
DocumentationFormat::JSON | ||
if extension == Some("json") || name.to_str() == Some(".stamp") => | ||
{ | ||
builder.copy(&path, &dst) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if this conditions will be enough for the purpose. What do you think ? @jyn514
c07f8e9
to
89d4550
Compare
pr is ready for review @Mark-Simulacrum @jyn514 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: ozkanonur <work@onurozkan.dev>
c6d6b4b
to
0a275ab
Compare
Is there a reason we need to have a shared output directory for our invocations of cargo doc for JSON and not JSON? That seems much less picky in terms of picking file types out by extension... In particular, it seems like the HTML format has some JSON files so the approach of this PR won't quite work:
|
Hmm, won't it hurt caching if cargo has to rebuild the dependencies in between? We can only control the target directory cargo uses, not the I agree this seems to cause issues though ... maybe a stamp file is better after all. |
May I know how did you achieve this? |
The files in question can be installed with |
I think in practice re-building the standard library and its dependencies shouldn't take long enough to be worried about it for now -- and if we follow the suggestion around different destinations via symlink updates or similar (below) then it might not need to rebuild dependencies.
I think we do some symlink'ing and such to adjust where the out-dir passed to rustdoc actually ends up, fwiw, but it's not exactly the most ideal thing. |
Should I work on fixing the issue you mentioned then? |
@ozkanonur yes please, if you use separate |
Signed-off-by: ozkanonur <work@onurozkan.dev>
I tried to check if I can play with Line 705 in e07425d
At least now I have more experience about the rustdoc process pipelines.
With the last commit I aplied it for std doc(I think we don't need this for compiler-docs since it's always including html docs. Please correct me if I am wrong.). |
This looks great! thank you :) @bors r+ |
Rollup of 6 pull requests Successful merges: - rust-lang#104269 (Fix hang in where-clause suggestion with `predicate_can_apply`) - rust-lang#104286 (copy doc output files by format) - rust-lang#104509 (Use obligation ctxt instead of dyn TraitEngine) - rust-lang#104721 (Remove more `ref` patterns from the compiler) - rust-lang#104744 (rustdoc: give struct fields CSS `display: block`) - rust-lang#104751 (Fix an ICE parsing a malformed attribute.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This pr provides copying doc outputs by checking output format without removing output directory on each trigger.
Resolves #103785