Skip to content

Commit 6bdcc3c

Browse files
Move subtree part of Readme into its own doc file
1 parent e69f125 commit 6bdcc3c

File tree

2 files changed

+52
-45
lines changed

2 files changed

+52
-45
lines changed

Readme.md

-45
Original file line numberDiff line numberDiff line change
@@ -269,51 +269,6 @@ COLLECT_NO_DEMANGLE=1
269269
* Build the stage2 compiler (`rustup toolchain link debug-current build/x86_64-unknown-linux-gnu/stage2`).
270270
* Clean and rebuild the codegen with `debug-current` in the file `rust-toolchain`.
271271
272-
### How to install a forked git-subtree
273-
274-
Using git-subtree with `rustc` requires a patched git to make it work.
275-
The PR that is needed is [here](https://github.com/gitgitgadget/git/pull/493).
276-
Use the following instructions to install it:
277-
278-
```bash
279-
git clone [email protected]:tqc/git.git
280-
cd git
281-
git checkout tqc/subtree
282-
make
283-
make install
284-
cd contrib/subtree
285-
make
286-
cp git-subtree ~/bin
287-
```
288-
289-
Then, do a sync with this command:
290-
291-
```bash
292-
PATH="$HOME/bin:$PATH" ~/bin/git-subtree push -P compiler/rustc_codegen_gcc/ ../rustc_codegen_gcc/ sync_branch_name
293-
cd ../rustc_codegen_gcc
294-
git checkout master
295-
git pull
296-
git checkout sync_branch_name
297-
git merge master
298-
```
299-
300-
To send the changes to the rust repo:
301-
302-
```bash
303-
cd ../rust
304-
git pull origin master
305-
git checkout -b subtree-update_cg_gcc_YYYY-MM-DD
306-
PATH="$HOME/bin:$PATH" ~/bin/git-subtree pull --prefix=compiler/rustc_codegen_gcc/ https://github.com/rust-lang/rustc_codegen_gcc.git master
307-
git push
308-
309-
# Immediately merge the merge commit into cg_gcc to prevent merge conflicts when syncing from rust-lang/rust later.
310-
PATH="$HOME/bin:$PATH" ~/bin/git-subtree push -P compiler/rustc_codegen_gcc/ ../rustc_codegen_gcc/ sync_branch_name
311-
```
312-
313-
TODO: write a script that does the above.
314-
315-
https://rust-lang.zulipchat.com/#narrow/stream/301329-t-devtools/topic/subtree.20madness/near/258877725
316-
317272
### How to use [mem-trace](https://github.com/antoyo/mem-trace)
318273
319274
`rustc` needs to be built without `jemalloc` so that `mem-trace` can overload `malloc` since `jemalloc` is linked statically, so a `LD_PRELOAD`-ed library won't a chance to intercept the calls to `malloc`.

doc/subtree.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# git subtree sync
2+
3+
`rustc_codegen_gcc` is a subtree of the rust compiler. As such, it needs to be
4+
sync from time to time to ensure changes that happened on their side are also
5+
included on our side.
6+
7+
### How to install a forked git-subtree
8+
9+
Using git-subtree with `rustc` requires a patched git to make it work.
10+
The PR that is needed is [here](https://github.com/gitgitgadget/git/pull/493).
11+
Use the following instructions to install it:
12+
13+
```bash
14+
git clone [email protected]:tqc/git.git
15+
cd git
16+
git checkout tqc/subtree
17+
make
18+
make install
19+
cd contrib/subtree
20+
make
21+
cp git-subtree ~/bin
22+
```
23+
24+
### Syncing with rust compiler
25+
26+
Do a sync with this command:
27+
28+
```bash
29+
PATH="$HOME/bin:$PATH" ~/bin/git-subtree push -P compiler/rustc_codegen_gcc/ ../rustc_codegen_gcc/ sync_branch_name
30+
cd ../rustc_codegen_gcc
31+
git checkout master
32+
git pull
33+
git checkout sync_branch_name
34+
git merge master
35+
```
36+
37+
To send the changes to the rust repo:
38+
39+
```bash
40+
cd ../rust
41+
git pull origin master
42+
git checkout -b subtree-update_cg_gcc_YYYY-MM-DD
43+
PATH="$HOME/bin:$PATH" ~/bin/git-subtree pull --prefix=compiler/rustc_codegen_gcc/ https://github.com/rust-lang/rustc_codegen_gcc.git master
44+
git push
45+
46+
# Immediately merge the merge commit into cg_gcc to prevent merge conflicts when syncing from rust-lang/rust later.
47+
PATH="$HOME/bin:$PATH" ~/bin/git-subtree push -P compiler/rustc_codegen_gcc/ ../rustc_codegen_gcc/ sync_branch_name
48+
```
49+
50+
TODO: write a script that does the above.
51+
52+
https://rust-lang.zulipchat.com/#narrow/stream/301329-t-devtools/topic/subtree.20madness/near/258877725

0 commit comments

Comments
 (0)