Skip to content

Commit 0a6b2d5

Browse files
committed
Disable explicit module builds for the index arena
Explicit module arguments are removed for the arguments returned for indexing. Also disable them for preparation in general so we're not mixing between the two. Resolves rdar://147354913.
1 parent 519a4fc commit 0a6b2d5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Sources/SWBCore/Settings/Settings.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3815,6 +3815,11 @@ private class SettingsBuilder {
38153815
table.push(BuiltinMacros.EFFECTIVE_PLATFORM_NAME, literal: MacCatalystInfo.publicSDKBuiltProductsDirSuffix)
38163816
}
38173817

3818+
table.push(BuiltinMacros.SWIFT_ENABLE_EXPLICIT_MODULES, literal: .disabled)
3819+
table.push(BuiltinMacros._EXPERIMENTAL_SWIFT_EXPLICIT_MODULES, literal: .disabled)
3820+
table.push(BuiltinMacros.CLANG_ENABLE_EXPLICIT_MODULES, literal: false)
3821+
table.push(BuiltinMacros._EXPERIMENTAL_CLANG_EXPLICIT_MODULES, literal: false)
3822+
38183823
push(table, .exported)
38193824
}
38203825

Tests/SWBTaskConstructionTests/IndexBuildTaskConstructionTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,10 @@ fileprivate struct IndexBuildTaskConstructionTests: CoreBasedTests {
546546
try results.checkTask(.matchTargetName("AppTarget"), .matchRuleItem("SwiftDriver Compilation Requirements")) { task in
547547
task.checkRuleInfo(["SwiftDriver Compilation Requirements", "AppTarget", "normal", "x86_64", "com.apple.xcode.tools.swift.compiler"])
548548

549+
// Explicit modules are disabled for semantic functionality currently, make sure it is also disabled
550+
// for preparation in general.
551+
task.checkCommandLineDoesNotContain("-explicit-module-build")
552+
549553
let skipFlag = swiftFeatures.has(.experimentalSkipAllFunctionBodies) ? "-experimental-skip-all-function-bodies" : "-experimental-skip-non-inlinable-function-bodies"
550554
task.checkCommandLineContains(["-module-name", "AppTarget", "-Onone", "-Xfrontend", skipFlag, "-emit-dependencies", "-emit-module", "-emit-module-path", "-emit-objc-header", "-emit-objc-header-path"])
551555
if swiftFeatures.has(.experimentalAllowModuleWithCompilerErrors) {
@@ -793,8 +797,11 @@ fileprivate struct IndexBuildTaskConstructionTests: CoreBasedTests {
793797

794798
results.checkNoTask(.matchCommandLineArgument("clang-stat-cache"))
795799

796-
try results.checkTask(.matchTargetName("AppTarget"), .matchRuleItem("CompileC")) { task in
800+
// Explicit modules are disabled for semantic functionality currently, make sure it is also disabled
801+
// for preparation in general.
802+
results.checkNoTask(.matchRuleItem("ScanDependencies"))
797803

804+
try results.checkTask(.matchTargetName("AppTarget"), .matchRuleItem("CompileC")) { task in
798805
if clangFeatures.has(.allowPcmWithCompilerErrors) {
799806
task.checkCommandLineContains(["-Xclang", "-fallow-pcm-with-compiler-errors"])
800807
} else {

0 commit comments

Comments
 (0)