@@ -148,8 +148,8 @@ Your branch is up to date with 'origin/master'.
148
148
Changes not staged for commit:
149
149
(use "git add <file>..." to update what will be committed)
150
150
(use "git restore <file>..." to discard changes in working directory)
151
+ modified: src/llvm-project (new commits)
151
152
modified: src/tools/cargo (new commits)
152
- modified: src/tools/miri (new commits)
153
153
154
154
no changes added to commit (use "git add" and/or "git commit -a")
155
155
```
@@ -176,6 +176,8 @@ There is a workaround in [the issue][#77620-workaround].
176
176
[ #77620 ] : https://github.com/rust-lang/rust/issues/77620
177
177
[ #77620-workaround ] : https://github.com/rust-lang/rust/issues/77620#issuecomment-705228229
178
178
179
+ (Note that as of Sept 2022 ` miri ` is a subtree and not a submodule.)
180
+
179
181
## Rebasing and Conflicts
180
182
181
183
When you edit your code locally, you are making changes to the version of
@@ -391,41 +393,41 @@ you might want to get used to the main concepts of Git before reading this secti
391
393
392
394
The ` rust-lang/rust ` repository uses [ Git submodules] as a way to use other
393
395
Rust projects from within the ` rust ` repo. Examples include Rust's fork of
394
- ` llvm-project ` and many devtools such as ` cargo ` and ` miri ` .
396
+ ` llvm-project ` , ` cargo ` and libraries like ` stdarch ` and ` backtrace ` .
395
397
396
398
Those projects are developed and maintained in an separate Git (and GitHub)
397
399
repository, and they have their own Git history/commits, issue tracker and PRs.
398
400
Submodules allow us to create some sort of embedded sub-repository inside the
399
401
` rust ` repository and use them like they were directories in the ` rust ` repository.
400
402
401
- Take ` miri ` for example. ` miri ` is maintained in the [ ` rust-lang/miri ` ] repository,
402
- but it is used in ` rust-lang/rust ` by the compiler for const evaluation. We bring it
403
- in ` rust ` as a submodule, in the ` src/tools/miri ` folder.
403
+ Take ` llvm-project ` for example. ` llvm-project ` is maintained in the [ ` rust-lang/llvm-project ` ]
404
+ repository, but it is used in ` rust-lang/rust ` by the compiler for code generation and
405
+ optimization. We bring it in ` rust ` as a submodule, in the ` src/llvm-project ` folder.
404
406
405
407
The contents of submodules are ignored by Git: submodules are in some sense isolated
406
- from the rest of the repository. However, if you try to ` cd src/tools/miri ` and then
408
+ from the rest of the repository. However, if you try to ` cd src/llvm-project ` and then
407
409
run ` git status ` :
408
410
409
411
```
410
- HEAD detached at 3fafb835
412
+ HEAD detached at 9567f08afc943
411
413
nothing to commit, working tree clean
412
414
```
413
415
414
- As far as git is concerned, you are no longer in the ` rust ` repo, but in the ` miri ` repo.
416
+ As far as git is concerned, you are no longer in the ` rust ` repo, but in the ` llvm-project ` repo.
415
417
You will notice that we are in "detached HEAD" state, i.e. not on a branch but on a
416
418
particular commit.
417
419
418
420
This is because, like any dependency, we want to be able to control which version to use.
419
421
Submodules allow us to do just that: every submodule is "pinned" to a certain
420
422
commit, which doesn't change unless modified manually. If you use ` git checkout <commit> `
421
- in the ` miri ` directory and go back to the ` rust ` directory, you can stage this
422
- change like any other, e.g. by running ` git add src/tools/miri ` . (Note that if
423
+ in the ` llvm-project ` directory and go back to the ` rust ` directory, you can stage this
424
+ change like any other, e.g. by running ` git add src/llvm-project ` . (Note that if
423
425
you * don't* stage the change to commit, then you run the risk that running
424
426
` x.py ` will just undo your change by switching back to the previous commit when
425
427
it automatically "updates" the submodules.)
426
428
427
429
This version selection is usually done by the maintainers of the project, and
428
- looks like [ this] [ miri -update] .
430
+ looks like [ this] [ llvm -update] .
429
431
430
432
Git submodules take some time to get used to, so don't worry if it isn't perfectly
431
433
clear yet. You will rarely have to use them directly and, again, you don't need
@@ -434,5 +436,5 @@ exist and that they correspond to some sort of embedded subrepository dependency
434
436
that Git can nicely and fairly conveniently handle for us.
435
437
436
438
[ Git submodules ] : https://git-scm.com/book/en/v2/Git-Tools-Submodules
437
- [ `rust-lang/miri ` ] : https://github.com/rust-lang/miri
438
- [ miri -update] : https://github.com/rust-lang/rust/pull/77500 /files
439
+ [ `rust-lang/llvm-project ` ] : https://github.com/rust-lang/llvm-project
440
+ [ llvm -update] : https://github.com/rust-lang/rust/pull/99464 /files
0 commit comments