Skip to content

Move the SDK EMB cache out of ModuleCache.noindex#1416

Merged
Bigcheese merged 2 commits into
swiftlang:release/6.4.xfrom
Bigcheese:dev/mspencer/175038966-sdk-emb-cache-out-of-modulecache
Jun 15, 2026
Merged

Move the SDK EMB cache out of ModuleCache.noindex#1416
Bigcheese merged 2 commits into
swiftlang:release/6.4.xfrom
Bigcheese:dev/mspencer/175038966-sdk-emb-cache-out-of-modulecache

Conversation

@Bigcheese

Copy link
Copy Markdown
Contributor

Add SDK_EXPLICIT_MODULES_OUTPUT_PATH and use it for -sdk-module-cache-path instead of MODULE_CACHE_DIR.

Putting the scanning and EBM cache in the same directory was confusing when looking at logs. This defaults to
$(DERIVED_DATA_DIR)/SDKExplicitPrecompiledModules

rdar://175038966

@Bigcheese

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

table.push(BuiltinMacros.SWIFT_EXPLICIT_MODULES_OUTPUT_PATH, Static { BuiltinMacros.namespace.parseString("$(OBJROOT)/SwiftExplicitPrecompiledModules") })

// Shared output path for SDK explicit modules. Lives adjacent to ModuleCache.noindex under DerivedData so it is shared across projects (SDK PCMs are invariant across projects that share an SDK and toolchain).
table.push(BuiltinMacros.SDK_EXPLICIT_MODULES_OUTPUT_PATH, Static { BuiltinMacros.namespace.parseString("$(DERIVED_DATA_DIR)/SDKExplicitPrecompiledModules") })

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

DERIVED_DATA_DIR may be empty for Xcode projects using custom build locations, so this may need logic similar to MODULE_CACHE_DIR to do something reasonable in that situation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added the same check as MODULE_CACHE_DIR. From my understanding this will end up putting the SDK modules in $(OBJROOT)/SwiftExplicitPrecompiledModules when there's no DerivedData.

@Bigcheese Bigcheese force-pushed the dev/mspencer/175038966-sdk-emb-cache-out-of-modulecache branch from 768e93b to 02bc8f0 Compare May 26, 2026 23:37
@Bigcheese

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@Bigcheese

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@Bigcheese Bigcheese force-pushed the dev/mspencer/175038966-sdk-emb-cache-out-of-modulecache branch from 02bc8f0 to 5426bcf Compare June 3, 2026 18:00
@Bigcheese

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@rconnell9

Copy link
Copy Markdown
Contributor

@swift-ci test macOS

1 similar comment
@rconnell9

Copy link
Copy Markdown
Contributor

@swift-ci test macOS

Add SDK_EXPLICIT_MODULES_OUTPUT_PATH and use it for
-sdk-module-cache-path instead of MODULE_CACHE_DIR.

Putting the scanning and EBM cache in the same directory was confusing
when looking at logs. This defaults to
$(DERIVED_DATA_DIR)/SDKExplicitPrecompiledModules

rdar://175038966
@Bigcheese Bigcheese force-pushed the dev/mspencer/175038966-sdk-emb-cache-out-of-modulecache branch from 5426bcf to e064f90 Compare June 10, 2026 14:32
@Bigcheese

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@Bigcheese

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@Bigcheese

Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

@Bigcheese Bigcheese merged commit c2eb24b into swiftlang:release/6.4.x Jun 15, 2026
109 of 126 checks passed
vsarunas pushed a commit to ordo-one/swift-build that referenced this pull request Jun 30, 2026
Add SDK_EXPLICIT_MODULES_OUTPUT_PATH and use it for
-sdk-module-cache-path instead of MODULE_CACHE_DIR.

Putting the scanning and EBM cache in the same directory was confusing
when looking at logs. This defaults to
$(DERIVED_DATA_DIR)/SDKExplicitPrecompiledModules

rdar://175038966
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants