-
Notifications
You must be signed in to change notification settings - Fork 347
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
Miri subtree instructions #2561
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c7cf451
Extend instructions with download command for git-subtree script
oli-obk 3b781c5
Make instructions a bit clearer on which direction we're talking about
oli-obk cdc6a04
git subtree is a rustc-repo only operation in either direction
oli-obk 5667a90
git subtree adds branches or commits
oli-obk e19c45f
git subtree is slow
oli-obk 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -275,3 +275,59 @@ see <https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html>. | |
|
||
With this, you should now have a working development setup! See | ||
[above](#building-and-testing-miri) for how to proceed working on Miri. | ||
|
||
### Syncing the miri subtree | ||
|
||
Note: Never rebase a subtree sync (in either direction). Always redo the operation. | ||
|
||
All of these operations happen *on a checkout of the rustc repo*. At no time do you | ||
even need a checkout of the miri repo or run any commands in it. | ||
|
||
#### Moving changes from the rustc repo to the miri repo | ||
|
||
One time setup: | ||
|
||
Add your own miri fork as `miri-your-fork` to your rustc checkout: | ||
|
||
``` | ||
git remote add miri-your-fork git@github.com:your-name/miri.git | ||
``` | ||
|
||
Every time: | ||
|
||
Note: the first time you run this, `git subtree` builds a cache and this command may thusly take an hour or so. | ||
|
||
``` | ||
ulimit -Ss 1000000 | ||
wget https://raw.githubusercontent.com/gitgitgadget/git/fe2e4819b869725f870cd3ce99f1f8150fe17dc1/contrib/subtree/git-subtree.sh | ||
sh git-subtree.sh push --prefix src/tools/miri/ miri-your-fork miri-subtree-sync | ||
rm git-subtree.sh | ||
``` | ||
|
||
Now you'll have a branch called `miri-subtree-sync` in your miri fork that you can use to open a PR to miri. | ||
Do not rebase this branch. If there are conflicts with the miri repo, you need to use the merge strategy, even if this | ||
is otherwise not permitted for other PRs to the miri repo. | ||
|
||
#### Moving changes from the miri repo to the rustc repo | ||
|
||
One time setup: | ||
|
||
Add the main miri repo as `miri` to your rustc checkout: | ||
|
||
``` | ||
git remote add miri https://github.com/rust-lang/miri.git | ||
``` | ||
|
||
Every time: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this also need that cache or is this always fast(er)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is always fast, just a few seconds at most, does not get slower with time |
||
|
||
``` | ||
ulimit -Ss 1000000 | ||
wget https://raw.githubusercontent.com/gitgitgadget/git/fe2e4819b869725f870cd3ce99f1f8150fe17dc1/contrib/subtree/git-subtree.sh | ||
sh git-subtree.sh pull --prefix src/tools/miri/ miri master | ||
rm git-subtree.sh | ||
``` | ||
|
||
Now your currently checked out branch has a new merge commit that pulls in the miri changes. Use this to open a PR | ||
against the rustc repo. | ||
Do not rebase this branch. If there are conflicts with the rustc repo, you need to use the merge strategy, even if this | ||
is otherwise not permitted for other PRs to the rustc repo. |
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.
An hour?!??? :(
I have many rustc checkouts. How can I make it share the cache between my checkouts?
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 have no idea, this worked faster for clippy and other repos...
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.
If you use
git worktree
for creating the extra git checkouts I believe the subtree cache is shared. Not entirely sure though.The first common commit between rust and miri is from 2018 (when rust-lang/rust#46882 merged it into rustc as const eval engine). Git subtree has to walk all commits since then I believe.
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.
yea, that's not really useful... why doesn't it just walk the
subtree_add_commit..HEAD
range and rewrite those commits...