Skip to content

Commit 5b5244f

Browse files
Merge pull request swiftlang#75231 from AnthonyLatsis/coryphaena-hippurus
[NFC] GettingStarted: Several straightforward improvements
2 parents 8e6feff + 688f0f4 commit 5b5244f

File tree

1 file changed

+37
-33
lines changed

1 file changed

+37
-33
lines changed

docs/HowToGuides/GettingStarted.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ toolchain as a one-off, there are a couple of differences:
9595
cd swift
9696
utils/update-checkout --clone
9797
```
98-
> **Note**
98+
> **Important**\
9999
> If you've already forked the project on GitHub at this stage, **do not
100100
> clone your fork** to start off. We describe [how to setup your fork](#setting-up-your-fork)
101101
> in a subsection below.
@@ -121,7 +121,7 @@ toolchain as a one-off, there are a couple of differences:
121121
Detailed branching information, including names for release branches, can
122122
be found in [Branches.md](/docs/Branches.md).
123123
124-
> **Note**
124+
> [!NOTE]
125125
> The commands used in the rest of this guide assumes that the absolute path
126126
> to your working directory is something like `/path/to/swift-project/swift`.
127127
> Double-check that running `pwd` prints a path ending with `swift`.
@@ -190,7 +190,7 @@ toolchain as a one-off, there are a couple of differences:
190190
sudo chmod +x /usr/local/bin/sccache
191191
```
192192

193-
> **Note**
193+
> [!NOTE]
194194
> LLDB currently requires at least `swig-1.3.40` but will successfully build
195195
> with version 2 shipped with Ubuntu.
196196

@@ -206,7 +206,7 @@ toolchain as a one-off, there are a couple of differences:
206206
* If you installed and want to use Sccache: Run `sccache --version`; check
207207
that this succeeds.
208208

209-
> **Note**
209+
> [!NOTE]
210210
> If you are running on Apple Silicon hardware (M1, M2, etc), ensure you have
211211
> the native arm64 build of these dependencies installed and configured in your PATH.
212212
>
@@ -247,8 +247,9 @@ to understand what the different tools do:
247247
is a high-level automation script that handles configuration (via CMake),
248248
building (via Ninja), caching (via Sccache), running tests and more.
249249
250-
> **Pro Tip**: Most tools support `--help` flags describing the options they
251-
> support. Additionally, both Clang and the Swift compiler have hidden flags
250+
> [!TIP]
251+
> Most tools support `--help` flags describing the options they support.
252+
> Additionally, both Clang and the Swift compiler have hidden flags
252253
> (`clang --help-hidden`/`swiftc --help-hidden`) and frontend flags
253254
> (`clang -cc1 --help`/`swiftc -frontend --help`) and the Swift compiler
254255
> even has hidden frontend flags (`swiftc -frontend --help-hidden`). Sneaky!
@@ -308,23 +309,19 @@ You will need to slightly tweak the paths for other build configurations.
308309
In many situations, there are several errors, so scrolling further back
309310
and looking at the first error may be more helpful than simply looking
310311
at the last error.
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.
312+
- Check if others have encountered the same issue on the
313+
[Swift forums][build-script-issues-forums] or in
314+
[our issues][build-script-issues-github].
315+
- 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:
316+
- Include the command, information about your environment, and the errors
317+
you are seeing.
321318
- You can [create a gist](https://gist.github.com) with the entire build
322319
output and link it, while highlighting the most important part of the
323320
build log in the post.
324321
- Include the output of `utils/update-checkout --dump-hashes`.
325322

326-
[Swift Issues]: https://github.com/swiftlang/swift/issues
327-
[Swift Forums]: https://forums.swift.org
323+
[build-script-issues-forums]: https://forums.swift.org/search?q=tags%3Abuild-script%2Bhelp-needed
324+
[build-script-issues-github]: https://github.com/swiftlang/swift/issues?q=is%3Aissue+label%3Abuild-script+label%3Abug
328325

329326
## Editing code
330327

@@ -364,9 +361,9 @@ whenever the heading is modified.
364361
This workflow enables you to edit, build, run, and debug in Xcode. The
365362
following steps assume that you have already [built the toolchain with Ninja](#the-actual-build).
366363

367-
> **Note**
364+
> [!NOTE]
368365
> A seamless LLDB debugging experience requires that your `build-script`
369-
invocation for Ninja is tuned to produce build rules for the
366+
invocation for Ninja is tuned to generate build rules for the
370367
[debug variant](#debugging-issues) of the component you intend to debug.
371368

372369
* <p id="generate-xcode">
@@ -379,21 +376,26 @@ following steps assume that you have already [built the toolchain with Ninja](#t
379376
This can take a few minutes due to metaprogrammed sources that depend on LLVM
380377
tools that are built from source.
381378
</p>
382-
* Create an empty Xcode workspace.
383-
* Add `build/Xcode-*/swift-macosx-*/Swift.xcodeproj` to the workspace. If Xcode
384-
prompts to autocreate schemes, select *Manually Manage Schemes* and don't
385-
create any schemes just yet.
386-
387-
This project includes the sources for almost everything in the repository,
388-
including the compiler, standard library and runtime. If you intend to work on
389-
a compiler subcomponent that is written in Swift and has a `Package.swift`
390-
file (e.g. `lib/ASTGen`), first choose *Product > Scheme > Manage Schemes...*
391-
and select the *Autocreate schemes* checkbox, then add the package directory
392-
to the workspace by choosing *File > Add Files to "\<workspace name>"*. Xcode
393-
will automatically create schemes for package manifest.
379+
* Create an empty Xcode workspace and open it.
380+
* Add `build/Xcode-*/swift-macosx-*/Swift.xcodeproj` to the workspace by
381+
selecting the Project navigator and choosing
382+
*File > Add Files to "\<workspace name>"*.
383+
384+
> **Important**\
385+
> If upon addition Xcode prompts to autocreate schemes, select *Manually
386+
Manage Schemes*.
387+
388+
This Xcode project includes the sources for almost everything in the
389+
repository, including the compiler, standard library and runtime.
390+
If you intend to work on a compiler subcomponent that is written in Swift and
391+
has a `Package.swift` file, e.g. `lib/ASTGen`, first choose
392+
*Product > Scheme > Manage Schemes* and select the *Autocreate schemes*
393+
checkbox, then add the package directory to the workspace the same way you
394+
added the Xcode project.
395+
Xcode will automatically create schemes for the package manifest.
394396
* Create an Xcode project using the _External Build System_ template, and add
395397
it to the workspace.
396-
* Create a target in the new project, using the _External Build System_
398+
* Create a target in the new Xcode project, using the _External Build System_
397399
template.
398400
* In the _Info_ pane of the target settings, set
399401
* _Build Tool_ to the absolute path of the `ninja` executable (the output of
@@ -703,3 +705,5 @@ If you see mistakes in the documentation (including typos, not just major
703705
errors) or identify gaps that you could potentially improve the contributing
704706
experience, please start a discussion on the forums, submit a pull request
705707
or file a bug report on [Swift repository 'Issues' tab][Swift Issues]. Thanks!
708+
709+
[Swift Issues]: https://github.com/swiftlang/swift/issues

0 commit comments

Comments
 (0)