You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/upstreaming.md
+52-2Lines changed: 52 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,58 @@ If our upstreaming commits break ci.swift.org, we should revert the commit or fi
36
36
## Milestones
37
37
38
38
1. Upstream compiler patches
39
-
If we upstream all of our compiler patches, we can stop building our own compiler and use the official Swift compiler instead.
40
-
After that, we can focus on building standard library and save much time.
39
+
40
+
If we upstream all of our compiler patches, we can stop building our own compiler and use the official Swift compiler instead.
41
+
After that, we can focus on building standard library and save much time.
41
42
42
43
2. Upstream standard library patches
43
44
3. Set up WebAssembly check in ci.swift.org and make it mandatory to pass the check to merge a PR like [the Windows check](https://ci-external.swift.org/job/swift-PR-windows/)
45
+
46
+
## Checkout-build-edit-test cycle
47
+
48
+
Building the Swift toolchain is a time-consuming process. We recommend to use powerful machine or cloud service to build the toolchain. (FYI: [Yuta](https://github.com/kateinoigakukun) usually uses [CPX51 by Hetzner](https://pcr.cloud-mercato.com/providers/hetzner/flavors/cpx51))
49
+
50
+
Please basically follow the [README](../README.md) process to set up the build environment.
51
+
52
+
### Checkout
53
+
54
+
If it's first time to build or patch files are changed, you need to checkout the source code:
55
+
56
+
```
57
+
./tools/git-swift-workspace --scheme main
58
+
```
59
+
60
+
### Build
61
+
62
+
If you want to build the whole toolchain, run the following command:
63
+
64
+
```
65
+
./tools/build/build-toolchain.sh
66
+
```
67
+
68
+
If you already built the compiler and want to build only the standard library for WebAssembly, run the following command:
If you want to add a new patch, edit the Swift source code and commit it on the current branch, which is created by `git-swift-workspace` and includes our existing patches.
77
+
78
+
If you want to edit an existing patch (e.g. to resolve conflicts with upstream changes, or to improve the patch), please edit the commit history by `git rebase -i`.
79
+
80
+
After editing the source code, you need to rebuild the toolchain, and if you are sure that the patch is OK, you can update our `.patch` files by the follwoing command:
81
+
82
+
```
83
+
./tools/git-swift-update-patch --scheme main
84
+
```
85
+
86
+
87
+
### Test
88
+
89
+
The above build command does not run tests. If you want to run tests, run the following command:
0 commit comments