Skip to content

[docs] Add module build related definitions to Lexicon. #32153

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
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
30 changes: 30 additions & 0 deletions docs/Lexicon.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,25 @@ written "dupe". Pronounced the same way as the first syllable of
A value whose type is a protocol composition (including a single protocol
and *zero* protocols; the latter is the `Any` type).

## explicit module build

A module build where all dependency modules (including Clang modules) are
passed to the compiler explicitly by an external build system, including
any modules in caches. See also: [implicit module build](#implicit-module-build)
and [fast dependency scanner](#fast-dependency-scanner).

## fast dependency scanner

A Swift compiler mode that scans a Swift module for import declarations and
resolves which modules will be loaded. It is based on the
[clang-scan-deps](https://llvm.org/devmtg/2019-04/slides/TechTalk-Lorenz-clang-scan-deps_Fast_dependency_scanning_for_explicit_modules.pdf)
library within Clang, for (Objective-)C modules, but is extended to also
understand textual Swift modules (.swiftinterface files).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may worth mentioning swift-driver provides APIs to digest the output of the scanner. This is to allow build systems to share more module building logics.


The fast dependency scanner outputs a graph of compilation steps which can be
used by a build system to schedule
[explicit module builds](#explicit-module-builds).

## fragile

Describes a type or function where making changes will break binary
Expand Down Expand Up @@ -193,6 +212,17 @@ compared directly.

["if and only if"](https://en.wikipedia.org/wiki/If_and_only_if). This term comes from mathematics.

## implicit module build

A module build where the compiler is free to transparently build dependent
modules (including Clang modules), and access modules in different caches as
necessary. For example, if a textual Swift module (.swiftinterface file) for
a dependency does not have a corresponding binary Swift module (.swiftmodulea
file), the compiler may transparently build a binary Swift module from the
textual one as a cache for future compiler jobs, without involving any external
build system that invoked the compiler. See also:
[explicit module build](#explicit-module-build).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also mention the shortcomings of implicit module builds: because build systems have no way to control when and where these modules are built, sharing modules among different nodes for distributed build systems can be difficult.


## interface type

The type of a value or declaration outside its generic context. These types
Expand Down