Commit 240f501
authored
Only include the platform PrivateFrameworks directory as a runtime, not build-time, search path (#9518)
This constrains a behavior I landed in #8199 so that it only includes
the `PrivateFrameworks` directory from Xcode's platform directory (when
present) as a **runtime** framework search path (via
`DYLD_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:
- Introduce separate properties for build-time vs. runtime framework and
library search paths, so the two categories can be differentiated by
callers.
- Omit the private frameworks search path from the new build-time
frameworks property.
- Adopt the relevant new properties at both build and runtime usage
sites.
### Result:
After this change, I validated that:
- a local package build no longer contains the private frameworks search
path entry at build time, using `swift build --build-tests --verbose`,
and
- a local package test operation still includes the search path, using
`env DYLD_PRINT_ENV=1 swift test`.1 parent f7ff31e commit 240f501
File tree
2 files changed
+28
-13
lines changed- Sources
- Commands/Utilities
- PackageModel/SwiftSDKs
2 files changed
+28
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
631 | | - | |
632 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
633 | 634 | | |
634 | | - | |
635 | | - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
636 | 646 | | |
637 | 647 | | |
638 | 648 | | |
| |||
641 | 651 | | |
642 | 652 | | |
643 | 653 | | |
644 | | - | |
| 654 | + | |
645 | 655 | | |
646 | 656 | | |
647 | | - | |
| 657 | + | |
648 | 658 | | |
649 | 659 | | |
650 | 660 | | |
| |||
682 | 692 | | |
683 | 693 | | |
684 | 694 | | |
685 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
686 | 701 | | |
687 | 702 | | |
688 | 703 | | |
| |||
0 commit comments