Commit Graph

11 Commits

Author SHA1 Message Date
Robert Widmann
80db895ba2 [NFC] Adapt Tests to the New Default
Now that incremental imports are the default, flip the polarity in some tests.
2021-03-01 17:26:00 -08:00
Robert Widmann
baaa035b05 XFAIL Flaky Incremental Tests Harder 2020-11-17 21:06:53 -08:00
Robert Widmann
025543bfb6 Ban Incremental CrossModule Tests in Optimized Stdlib Configurations
rdar://70772320
2020-11-11 11:33:09 -08:00
Robert Widmann
b22d2c943f Hack Around Incremental Test Mod Times Bugs In Binutils
Modification times are not accurately maintained by tools like cp. Touch
these build products explicitly to kick the incremental machinery into
gear.
2020-11-03 17:04:44 -08:00
Robert Widmann
6b67564ebe Mark Some Incremental Cross-Module Tests As Unsupported on Simulators
Simulator hosts don't make good candidates for these tests, and they
appear to be acting up anyways.

rdar://70772320
2020-10-30 13:12:02 -07:00
Robert Widmann
bcd0cb6a0a Use Relative Path to Test Inputs
Unfortunately, OutputFileMap does not normalize input names when it is constructing keys. Instead, keys to the map are formed by appending the entry's value directly onto the working directory with the test host's path separator convention.

On Windows, the tests here were using UNIX-style path separators when passing inputs to the Driver, so the key was

"C:\Path\To\File\A.swift"

But the input path to the driver was

"C:\Path\To\File/A.swift"

To work around this - and to ultimately make the test slightly more portable - just use relative paths to the input files since we've already changed directories to the working directory before we run these driver commands.
2020-10-19 14:09:36 -07:00
Robert Widmann
6fc78d5fbf Switch To target-swiftc_driver
Try to pass an explicit target to these tests so more exotic hosts do
the right thing.

rdar://70175753
2020-10-19 12:27:55 -07:00
Brent Royal-Gordon
6f15007656 XFAIL Incremental/CrossModule tests
These are failing in multiple bots; it looks like they need more time to bake.
2020-10-11 17:05:54 -07:00
Robert Widmann
cecb7c8313 Schedule MergeModules Incrementally
Plumb the logic necessary to schedule merge-modules incrementally. This means that if any inputs jobs to merge-modules run, merge-modules is run. But, if they are all skipped, merge-modules will be skipped as well.

This requires some light special-casing of the legacy driver's incremental job handling because it assumes in a few places it can always extract a swiftdeps file. This invariant will be further broken when the precompile step for bridging headers is skipped as well.

rdar://65893400
2020-10-07 16:57:14 -07:00
Robert Widmann
00d8e3c2cd XFAIL Cross-Module Build Tests On Windows
It doesn't seem to like the output file maps I've written here.
2020-10-06 13:03:45 -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