Skip to content

Commit 7f95854

Browse files
Merge pull request #60322 from LucianoPAlmeida/getting-started-troubleshooting
2 parents 1ac8adb + ad76797 commit 7f95854

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

docs/HowToGuides/GettingStarted.md

Lines changed: 20 additions & 10 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. If you run into issues building with Xcode, you can alternatively [integrate a Ninja build 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,7 +284,8 @@ 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

285-
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).
287+
### Integrate a Ninja build with Xcode
288+
It is 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
288291

@@ -305,16 +308,23 @@ 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 on [Swift repository 'Issues' tab][Swift Issues]. Here is a list of threads that describe common issues:
312+
* [Problems with `build-script` building compiler with `–xcode`](https://forums.swift.org/t/problems-with-build-script-building-compiler-with-xcode/53477)
313+
* [Error building the compiler (even with ninja)](https://forums.swift.org/t/error-building-the-compiler-even-with-ninja/54834)
314+
* [Build failure on Apple MacBook Pro with Apple M1 Chip](https://forums.swift.org/t/build-failure-on-apple-silicon-m1-mac-mini/45011)
315+
* [CMake cannot compile a test program](https://forums.swift.org/t/build-failure-locally/55695)
316+
* [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)
317+
* [ALL_BUILD Target failing at validation](https://forums.swift.org/t/help-building-swift-in-xcode-error/49728)
318+
* [“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)
319+
- 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:
320+
- Include information about your configuration and the errors you are seeing.
312321
- You can [create a gist](https://gist.github.com) with the entire build
313322
output and link it, while highlighting the most important part of the
314323
build log in the post.
315324
- Include the output of `utils/update-checkout --dump-hashes`.
316325
317326
[Swift Issues]: https://github.com/apple/swift/issues
327+
[Swift Forums]: https://forums.swift.org
318328
319329
## Editing code
320330
@@ -353,7 +363,7 @@ select the following schemes:
353363
- `swift-frontend`: If you will be working on the compiler.
354364
- `check-swift-all`: This can be used to run the tests. The test runner does
355365
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
366+
on the command line for more fine-grained control over which exact tests are
357367
run.
358368
<!-- TODO: Insert SourceKit/stdlib specific instructions? -->
359369
@@ -424,7 +434,7 @@ This should print your updated version string.
424434
425435
Starter bugs typically have small code examples that fit within a single file.
426436
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
437+
command line using `/path/to/swiftc MyFile.swift`, pasting the code into
428438
[Compiler Explorer][] (aka godbolt) or using an Xcode Playground.
429439
430440
[Compiler Explorer]: https://godbolt.org

0 commit comments

Comments
 (0)