Only include the platform PrivateFrameworks directory as a runtime, not build-time, search path #9518
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This constrains a behavior I landed in #8199 so that it only includes the
PrivateFrameworksdirectory from Xcode's platform directory (when present) as a runtime framework search path (viaDYLD_FRAMEWORK_PATH) and no longer includes it as a build-time framework search path (via-F <path>).Motivation:
This is a follow-up to a change I made in #8199. Those changes had an undesirable side effect of including private frameworks in all builds, and means that when those frameworks are present at build time, they're included in client builds and can be
import'ed or linked. Exposing those frameworks to clients at build-time was not intended, and can cause unexpected results or failures if (for example) those private frameworks themselves contain unresolvable module imports.However, platform private frameworks directories should continue to be included in runtime framework search paths, so they can be located and loaded when referenced by public frameworks/libraries.
Modifications:
Result:
After this change, I validated that:
swift build --build-tests --verbose, andenv DYLD_PRINT_ENV=1 swift test.