[ModuleInterface] Pass -Rmodule-interface-rebuild to sub-invocation (#24737)

Previously, we wouldn't pass this flag to sub-invocations, which means
that if we had to fall back and recompile a transitive import, we
wouldn't get a remark.

rdar://50729662
This commit is contained in:
Harlan Haskins
2019-05-13 12:56:18 -07:00
committed by GitHub
parent cfc2dda69a
commit 5cb98bfe80
4 changed files with 41 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/Build)
// RUN: %empty-directory(%t/ModuleCache)
// 1. Create a module called InnerModule, and put its interface into the build dir.
// RUN: echo 'public func inInnerModule() {}' | %target-swift-frontend - -typecheck -emit-module-interface-path %t/Build/InnerModule.swiftinterface -enable-library-evolution -swift-version 5 -module-name InnerModule
// 2. Build the .swiftinterface to a .swiftmodule, which will have a dependency on the interface
// RUN: %target-swift-frontend -compile-module-from-interface -o %t/Build/InnerModule.swiftmodule %t/Build/InnerModule.swiftinterface
// 3. Touch the interface so the module becomes out of date.
// RUN: touch %t/Build/InnerModule.swiftinterface
// 4. Create a module called OuterModule that imports InnerModule, and put its interface into the build dir.
// RUN: echo 'import InnerModule' | %target-swift-frontend - -emit-module -o %t/Build/OuterModule.swiftmodule -module-name OuterModule -I %t/Build
// 5. Build this file, and expect that InnerModule is out of date
// RUN: %target-swift-frontend -typecheck %s -I %t/Build -Rmodule-interface-rebuild -module-cache-path %t/ModuleCache 2>&1 | %FileCheck %s
import OuterModule
// CHECK: rebuilding module 'InnerModule' from interface '{{.*}}/Build/InnerModule.swiftinterface'
// CHECK: compiled module is out of date: '{{.*}}/Build/InnerModule.swiftmodule'
// CHECK: dependency is out of date: '{{.*}}/Build/InnerModule.swiftinterface'