Skip to content

Commit 9a1de83

Browse files
[Gardening] Add troubleshooting links to getting started
1 parent 1f6f969 commit 9a1de83

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

docs/HowToGuides/GettingStarted.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Phew, that's a lot to digest! Now let's proceed to the actual build itself!
222222
- If you use an editor other than Xcode and/or you want somewhat faster builds,
223223
go with Ninja.
224224
- If you are comfortable with using Xcode and would prefer to use it,
225-
go with Xcode.
225+
go with Xcode. But, since Xcode build is not as stable as Ninja's, you can also try to use [a ninja build integrated into Xcode](#integrate-a-ninja-build-with-xcode).
226226
There is also a third option, which is somewhat more involved:
227227
[using both Ninja and Xcode](#using-both-ninja-and-xcode).
228228
3. Build the toolchain with optimizations, debuginfo, and assertions and run
@@ -238,9 +238,11 @@ Phew, that's a lot to digest! Now let's proceed to the actual build itself!
238238
```sh
239239
utils/build-script --skip-build-benchmarks \
240240
--skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \
241-
--sccache --release-debuginfo --swift-disable-dead-stripping --test \
241+
--sccache --release-debuginfo --swift-disable-dead-stripping \
242242
--xcode
243243
```
244+
**Note:** Building `--xcode` together with `--test` is a common source of issues. So to run
245+
tests is recommended to use `ninja` because is normally more stable.
244246
Linux (uses Ninja):
245247
```sh
246248
utils/build-script --release-debuginfo --test --skip-early-swift-driver
@@ -267,7 +269,7 @@ In the following sections, for simplicity, we will assume that you are using a
267269
unless explicitly mentioned otherwise. You will need to slightly tweak the paths
268270
for other build configurations.
269271
270-
#### Using both Ninja and Xcode
272+
### Using both Ninja and Xcode
271273
272274
Some contributors find it more convenient to use both Ninja and Xcode.
273275
Typically this configuration consists of:
@@ -282,6 +284,7 @@ The additional flexibility comes with two issues: (1) consuming much more disk
282284
space and (2) you need to maintain the two builds in sync, which needs extra
283285
care when moving across branches.
284286
287+
### Integrate a Ninja build with Xcode
285288
It is even possible to integrate the Ninja build into Xcode. For details on how to set this up see [Using Ninja with Xcode in DevelopmentTips.md](/docs/DevelopmentTips.md#using-ninja-with-xcode).
286289
287290
### Troubleshooting build issues
@@ -305,16 +308,25 @@ It is even possible to integrate the Ninja build into Xcode. For details on how
305308
In many situations, there are several errors, so scrolling further back
306309
and looking at the first error may be more helpful than simply looking
307310
at the last error.
308-
- Check if others have encountered the same issue on the Swift forums or on
309-
[Swift repository 'Issues' tab][Swift Issues].
310-
- Create a new Swift forums thread in the Development category. Include
311-
information about your configuration and the errors you are seeing.
311+
- Check if others have encountered the same issue on the [Swift Forums](https://forums.swift.org/c/development/compiler) or an issue on
312+
[Swift repository 'Issues' tab][Swift Issues].
313+
- Here is a list of threads that describe common issues:
314+
* [Problems with `build-script` building compiler with `–xcode`](https://forums.swift.org/t/problems-with-build-script-building-compiler-with-xcode/53477)
315+
* [Error building the compiler (even with ninja)](https://forums.swift.org/t/error-building-the-compiler-even-with-ninja/54834)
316+
* [Build failure on Apple MacBook Pro with Apple M1 Chip](https://forums.swift.org/t/build-failure-on-apple-silicon-m1-mac-mini/45011)
317+
* [CMake cannot compile a test program](https://forums.swift.org/t/build-failure-locally/55695)
318+
* [Building Swift compiler from source fails when not using Ninja](https://forums.swift.org/t/building-swift-compiler-from-source-fails-when-not-using-ninja/54656)
319+
* [ALL_BUILD Target failing at validation](https://forums.swift.org/t/help-building-swift-in-xcode-error/49728)
320+
* [“gtest/gtest.h” not found while compiling the compiler](https://forums.swift.org/t/gtest-gtest-h-not-found-in-typeref-cpp-while-compiling-the-compiler/44399)
321+
- If you still could not find a solution to your issue, feel free to create a new [Swift Forums] thread in the [Development/Compiler](https://forums.swift.org/c/development/compiler) category:
322+
- Include information about your configuration and the errors you are seeing.
312323
- You can [create a gist](https://gist.github.com) with the entire build
313324
output and link it, while highlighting the most important part of the
314325
build log in the post.
315326
- Include the output of `utils/update-checkout --dump-hashes`.
316327

317328
[Swift Issues]: https://github.com/apple/swift/issues
329+
[Swift Forums]: https://forums.swift.org
318330

319331
## Editing code
320332

@@ -353,7 +365,7 @@ select the following schemes:
353365
- `swift-frontend`: If you will be working on the compiler.
354366
- `check-swift-all`: This can be used to run the tests. The test runner does
355367
not integrate with Xcode though, so it may be easier to run tests directly
356-
on the commandline for more fine-grained control over which exact tests are
368+
on the command line for more fine-grained control over which exact tests are
357369
run.
358370
<!-- TODO: Insert SourceKit/stdlib specific instructions? -->
359371

@@ -424,7 +436,7 @@ This should print your updated version string.
424436

425437
Starter bugs typically have small code examples that fit within a single file.
426438
You can reproduce such an issue in various ways, such as compiling it from the
427-
commandline using `/path/to/swiftc MyFile.swift`, pasting the code into
439+
command line using `/path/to/swiftc MyFile.swift`, pasting the code into
428440
[Compiler Explorer][] (aka godbolt) or using an Xcode Playground.
429441

430442
[Compiler Explorer]: https://godbolt.org

0 commit comments

Comments
 (0)