-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Use object
crate from crates.io to fix windows build error
#143492
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
So, we apparently run the risk of eventually having the same problem with smallvec. Should we just make this a crates.io dependency as well?
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.
Can do - what's the policy here? Should only
rustc_*
crates be pulled from sysroot?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 don't think we have a policy, we just discovered this problem.^^
tracing
needs to be pulled from the sysroot since it manages a singleton. Other than that, the main thing is avoiding duplicates... but also, if there's aSmallVec
in a rustc type, then ofc it needs to use the sysroot version of the crate.We can also just wait if one of the other crates becomes a problem. But it's going to be hard to notice that if we don't even build this on CI. So maybe the more important thing is to ensure these crates get check-built on more targets. @Kobzol might have an idea how to do that?
Uh oh!
There was an error while loading. Please reload this page.
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 used to pull as much as I could from the sysroot to save on compile time, but unfortunately, we have to stop doing this for Windows it seems.
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.
These aren't very big crates we are talking about, so compile time shouldn't be a big deal.
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.
@antoyo this is not a windows-specific problem in general, it just so happens that in the windows build, the compiler doesn't load
object
beforehand, and there are multiple candidates.That's why I asked about a policy - we need to say what crates are guaranteed to exist exactly once in the sysroot, as these can be pulled in safely, and no others.
Uh oh!
There was an error while loading. Please reload this page.
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.
It's hard to say which ones are guaranteed to exist only once (other than the rustc crates of course). OTOH, this in principle affects all rustc drivers (clippy, Miri, rustdoc) and hardly ever seems to be a problem... but also, at least in Miri we hardly use
extern crate
, so maybe that's why.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.
We don't check almost anything on CI, but we could build the GCC backend on more OSes. We haven't done that so far because it's not even in blocking (auto) CI on Linux yet, but that's for tests. For just building the backend, I guess we could try to add it to more runners.
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.
Building might be harder than checking and require a full GCC... but maybe it can be done. Just seems like overkill when the main goal is to allow contributors to fix compilation failures.
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 think it would make sense to do any further changes like re-exporting smallvec as a separate PR, so would be great if I could get an approval on this.