fix(compiler): forward verbose flag to rustc for local crates#17006
fix(compiler): forward verbose flag to rustc for local crates#17006raushan728 wants to merge 2 commits into
Conversation
Track verbosity state in the unit Fingerprint and append the --verbose flag to the rustc invocation for local packages. This ensures that running cargo build --verbose invalidates the cache, allowing users to see full, untruncated diagnostics instead of replaying cached outputs.
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
CI is failing on ~50 tests because the snapshots need to be updated with the new Since |
From #16531 (comment)
There was a choice here and you went one route. Please when doing these types of things document your reasoning. Note that the statement wasn't a commitment to do this but a re-iteration of the request to confirm understanding which brings us to #16531 (comment)
I think this is saying that we decided to punt on tracking this is in the hash or fingerprint. Looking at the notes doesn't provide any more insight. @ehuss do you remember which way we landed on this? |
|
I went with fingerprint instead of unit hash because running with Regarding tracking it at all: if we don't dirty the cache, Cargo just replays the previously cached truncated message. So just forwarding the flag wouldn't actually show the full output. To drop the fingerprint tracking entirely if @ehuss confirms we should punt on it. |
|
I don't recall if we landed one way or the other on caching. Right now I don't have a good answer to that myself. The downsides seem clear to me:
These differences are not applicable to the linker error mentioned in the issue, since that wouldn't be cached. If we truly only care about that one message (or any messages with errors), then I would go with not-tracked (since an error isn't cached). That would be the least disruptive, and address the concern in the issue (not seeing the full linker output). The downside is that it wouldn't help with any rustc messages in the future that are not errors but change based on We could always change this in the future, too. |
|
Since errors (like the linker error) aren't cached anyway, going with the "Not tracked" solves the primary issue without thrashing the cache for successful builds. I'll drop the fingerprint tracking, keep just the |
Fixes #16531
This PR passes the
--verboseflag down torustcfor local packages and tracks this verbosity state in the unitFingerprinthash. Now, toggling the verbose flag properly invalidates the cache for the local crate, fetching the full, untruncated error directly from the compiler without rebuilding all dependencies.