Skip to content

Link to docs referenced from Driver.md #19420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions docs/Driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ The target audience for this document is people who want to integrate the Swift
compiler into their build system, rather than using Xcode or the package
manager (`swift build`). If you're looking to work on the driver itself...well,
this is probably still useful to you, but you should also check out
DriverInternals.rst and maybe DependencyAnalysis.rst as well. If you're just
using Xcode or SwiftPM and want to find out what mysterious command-line
options you could be passing, `swiftc --help` is a better choice.
[DriverInternals.rst](DriverInternals.rst) and maybe
[DependencyAnalysis.rst](DependencyAnalysis.rst) as well. If you're just using
Xcode or SwiftPM and want to find out what mysterious command-line options you
could be passing, `swiftc --help` is a better choice.

If you're invoking `swift -frontend` directly, and you aren't working on the
compiler itself...well, this document should convince you to not do that.
Expand All @@ -25,8 +26,8 @@ Some terms:

- For the purposes of this document, a _module_ is a single distributable unit
of API. (We use this term for a lot of other things too, though; check out
Lexicon.rst for the full list.) "Foundation" is a single module, as is the
Swift standard library ("Swift"). An app is a module too.
[Lexicon.rst](Lexicon.rst) for the full list.) "Foundation" is a single
module, as is the Swift standard library ("Swift"). An app is a module too.

- A _compilation unit_ is a set of source files that are compiled together. In
Swift, everything intended to be in the same module must be part of the same
Expand Down Expand Up @@ -205,13 +206,13 @@ in becoming more like non-whole-module builds.
## Incremental Builds ##

Incremental builds in Swift work by primarily by cross-file dependency
analysis, described in DependencyAnalysis.rst. Compiling a single file might be
necessary because that file has changed, but it could also be because that file
depends on something else that might have changed. From a build system
perspective, the files in a particular module can't be extracted from each
other; a top-level invocation of the compiler will result in a valid
compilation of the entire module, but manually recompiling certain files is not
guaranteed to do anything sensible.
analysis, described in [DependencyAnalysis.rst](DependencyAnalysis.rst).
Compiling a single file might be necessary because that file has changed, but
it could also be because that file depends on something else that might have
changed. From a build system perspective, the files in a particular module
can't be extracted from each other; a top-level invocation of the compiler will
result in a valid compilation of the entire module, but manually recompiling
certain files is not guaranteed to do anything sensible.

Performing an incremental build is easy; just pass `-incremental` and be sure to
put "swift-dependencies" entries in your output file map.
Expand Down