librustc_driver: Make --print file-names do a minor accounting of --emit#68799
Closed
emilio wants to merge 1 commit intorust-lang:masterfrom
Closed
librustc_driver: Make --print file-names do a minor accounting of --emit#68799emilio wants to merge 1 commit intorust-lang:masterfrom
emilio wants to merge 1 commit intorust-lang:masterfrom
Conversation
…mit. Otherwise we print bogus output which prevents using `cargo check` with sccache, see https://bugzilla.mozilla.org/show_bug.cgi?id=1612855#c2 for a reduced test-case. Ideally --print file-names will emit all the files emitted by the session, but that seems a bit hard to do in a general way, so this is a best effort thing which fixes the cargo check use-case.
Contributor
|
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
Contributor
Author
|
This is somewhat related to #54852 (sccache was working around that already). |
emilio
added a commit
to emilio/sccache
that referenced
this pull request
Feb 3, 2020
This fixes cargo check in mozilla-central. The issue is that rustc --print file-names emits a somewhat poor approximation of what's actually going to be emitted. So for a staticlib crate, it will also print the staticlib file, which is not great. See https://bugzilla.mozilla.org/show_bug.cgi?id=1612855#c2 for a more straight-forward explanation of the failure case. Sccache would try to find the library and fail, erroring as a consequence. Pile up on the existing workaround for rmeta files not showing up (rust-lang/rust#54852) by removing files that are not metadata when we only request metadata. rust-lang/rust#68799 contains a rust-side fix that would also fix this.
froydnj
pushed a commit
to mozilla/sccache
that referenced
this pull request
Feb 3, 2020
This fixes cargo check in mozilla-central. The issue is that rustc --print file-names emits a somewhat poor approximation of what's actually going to be emitted. So for a staticlib crate, it will also print the staticlib file, which is not great. See https://bugzilla.mozilla.org/show_bug.cgi?id=1612855#c2 for a more straight-forward explanation of the failure case. Sccache would try to find the library and fail, erroring as a consequence. Pile up on the existing workaround for rmeta files not showing up (rust-lang/rust#54852) by removing files that are not metadata when we only request metadata. rust-lang/rust#68799 contains a rust-side fix that would also fix this.
Member
|
Thanks for the PR! It seems a bit odd though to add a helper function for just this one piece of functionality when presumably similar checks are happening elsewhere in the codebase. Is there somewhere else this new function could be used, or if not, is the new function necessary? |
Collaborator
|
☔ The latest upstream changes (presumably #69088) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
|
👋 @emilio |
Contributor
Author
|
I'm going to close this because I'm not convince of its correctness. The behavior of --print file-names is quite bizarre. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Otherwise we print bogus output which prevents using
cargo checkwith sccache,see https://bugzilla.mozilla.org/show_bug.cgi?id=1612855#c2 for a reduced
test-case.
Ideally --print file-names will emit only the files emitted by the session, but
that seems a bit hard to do in a general way, so this is a best effort thing
which fixes the cargo check use-case.