-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
RUSTDOC_LOG does not invalidate output cache #8374
Comments
It turns out rustdoc can fix this on its end using @rustbot claim |
This still doesn't help because Cargo doesn't track dep-info from rustdoc - and in fact, it can't:
Is it intentional that cargo doesn't do this? If I added support for |
I guess another alternative is to change rustdoc to use RUSTC_LOG instead, which should inherit the depinfo from when rustc is run. But that seems not ideal. |
Actually it's even more than that - cargo only uses the dep-info from rustc for rustc itself, not for rustdoc 😕
|
Previously, changing the value of `RUSTC_LOG` would not rebuild, and, because cargo caches output, show exactly the same logging as before. This was confusing. Emit `RUSTC_LOG` with other `depinfo` dependencies so cargo knows to rebuild when it's changed. Note that this only adds RUSTC_LOG to depinfo. Unfortunately, adding RUSTDOC_LOG only when running as rustdoc doesn't help because rustdoc doesn't emit depinfo at all. Unconditionally emitting RUSTDOC_LOG in the depinfo doesn't help because cargo ignores it for everything except rustc itself. I am not yet sure how to fix this; see rust-lang/cargo#8374 for more info.
@ehuss why did you assign me? |
Oh, sorry. I was debugging why the rustbot claim above #8374 (comment) didn't work. |
Ah ok - I no longer want to tackle this, the pr fixing it was closed: rust-lang/rust#82763. |
hmm, I just had another idea for how to fix this: right now it looks like cargo unconditionally caches all rustc output — could we change it to only cache lints instead? I think lints were the original motivation for adding caching. to avoid confusion we could say something like "note: 50 lines of non-lint output were not cached"? |
Problem
When I set
RUSTDOC_LOG=info
after previously runningcargo doc
, any time I runcargo doc
in the future will not have any output from rustdoc. The same problem is also present forRUSTC_LOG
.Steps
cargo doc
on any cargo projectRUSTDOC_LOG=info cargo doc
The second run will have the same output as the first. For comparison, the expected output is something like this:
RUSTDOC_LOG example
Possible Solution(s)
Invalidate cargo's output cache whenever RUSTDOC_LOG is changed.
Notes
Output of
cargo version
:cargo 1.44.0 (05d080faa 2020-05-06)
(but the problem was present on nightly last I checked a few days ago).The text was updated successfully, but these errors were encountered: