Commit Graph

5 Commits

Author SHA1 Message Date
David Ungar
d5ef9a094f Enhance module-fingerprint.swift to check the exclusion 2021-02-27 09:24:34 -08:00
Robert Widmann
58d91e28bc Print Module Fingerprints in swift-ide-test 2021-02-02 09:59:39 -08:00
Robert Widmann
27b152c93f [Gardening] Drop Trailing Commas 2020-10-19 14:06:12 -07:00
Robert Widmann
4099ddfdeb Ensure Changes to External Dependencies Cascade
We cannot know a-priori how a change to an external dependency will
affect the resulting structure of every file in the module that depends
upon it. Therefore, we must be conservative and ensure that these
dependent files always rebuild. Commit a test to this effect.
2020-10-09 10:43:23 -07:00
Robert Widmann
a77f059c82 Turn on Cross-Module Incremental Dependencies!
Cross-Module incremental dependencies are a new experimental mode of the Swift driver and frontend. Through a tight partnership between the two, we enable the driver to have far greater visibility into the dependency structure of a Swift module.

Rather than invent a new model, we have chosen to extend the existing incremental compilation model that works for a single module to multiple modules. To do this, we need the frontend to emit Swift dependencies in a form the driver can consume. We could emit these metadata in the form of an extra supplementary output that summarizes the contents of a generated module. However, this approach comes with a number of downsides:

- It requires additional integration with the build system
- It assumes swiftmodule files will be consumed directly from the build directory; they are not
- It incorrectly assumes a swiftmodule has but one interface. Taken in aggregate, a swiftmodule directory has one interface *per triple*

Given this, the approach we take here is to encode these dependencies directly into the swiftmodule file itself. When frontends load these souped-up incremental swiftmodule files, they record in their own swiftdeps files that they depend on an incremental swiftmodule. Upon the next build, the driver is then able to read that module file, extract the swiftdeps information from it, and use it to influence the way it schedules jobs.

The sum total is that we neatly extend the intra-module case of incremental builds to the inter-module case by treating swiftmodule inputs not as opaque entities, but as "big ol' flat Swift files" that just export an interface like any other Swift file within the module. As a further optimization, and because clients literally cannot observe this aspect of the incremental build, we only serialize the provides (the "defs" side of a "use-def" edge) when emitting swiftdeps metadata into swiftmodule files.

rdar://69595010
2020-10-05 18:59:57 -07:00