-
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
Improve support for non-master
main branches
#8364
Merged
Merged
Changes from all commits
Commits
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 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 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 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 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 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 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 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 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 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 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 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
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.
Why was this removed?
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.
This ended up being a bit of an odd coincidence, but what was happening is that this test relies on the index being updated by the Cargo used to drive the tests. The
cargo
run here is assumed to read that index and work with it correctly. If we ever change anything about how the index is checked out, then this breaks because the newcargo
can't read the old index.That's basically what happened here where the new Cargo is requiring
refs/remotes/origin/HEAD
to resolve the most recent commit of the index, but previous Cargo would only fill inrefs/remotes/origin/master
. This meant that with-Zno-index-update
the newcargo
binary would fail to update the index and would think there were no crates.I can't actually recall the original purpose for this argument myself, but it didn't seem to slow down too too much when adding this back in.
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.
Oh, that's a bit worrisome. I think there are a fair number of users of
Zno-index-update
, and it looks like it just breaks with a pre-existing index. Would it be possible to handle that?This was added from the original build-std tests where there were over 30 of them. In #7350 the build-std suite was improved where only 3 "full" tests were moved to
build-std/main.rs
.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 should have said, is there an easy way to handle it? If not, I guess since it is an unstable feature, might not be worth putting in the effort if it isn't easy.
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.
Oh I think this is only localized to this test suite. If you were, for example, to do:
this breaks today. The tests rely on the index already being up-to-date, and this just happens to work because the Cargo we're testing and the outer cargo (which ran
cargo +nightly test
) agree on the index format, so the tests know they'll be able to use the index the outer Cargo populated.We could perhaps handle this by fetching the
HEAD
reference intorefs/remotes/origin/master
and then reading that, but I'd just want to confirm that we're on the same page about the fallout we're dealing with.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.
The fallout I'm thinking of, is if someone has the registry populated from a current version of Cargo, and then they update to a nightly with this PR, and the first command they run is
cargo build -Zno-index-update
, it will fail witherror: no matching package named …
, which is a bit confusing.I'm not sure what the likelyhood is that someone runs with
-Zno-index-update
as the very first command after updating. As I mentioned, only bother if it is easy to handle. It seems like it is unlikely that it would be the first command someone would run. I believe Crater does an initial fetch, so crater should be safe I would think.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 true that it's a confusing error, yeah. Do you think it's worth trying to return a better error?
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.
Eh. I'm inclined to say "no" because it is an unstable feature, and I think it is unlikely that someone will run that as the first command.
r=me if you think this is ready to go.