Skip to content

Conversation

@stmontgomery
Copy link
Contributor

This modifies the logic which sets the value of the DYLD_FRAMEWORK_PATH environment variable when launching test runners on Darwin when Xcode is installed: currently it includes the path to the platform's developer "Frameworks" directory, and this change adds the sibling "PrivateFrameworks" directory as well.

Motivation:

XCTest includes some private support frameworks, and these frameworks must be aligned with the public framework for testing to work correctly. This ensures that if the path to the (public) frameworks directory is specified, the aligned private frameworks directory is also included.

Modifications:

  • Add $PLATFORM/Developer/Library/PrivateFrameworks to the DYLD_FRAMEWORK_PATH env var.

Resolves rdar://141564191

…D_FRAMEWORK_PATH when launching test runners

Resolves rdar://141564191
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery requested a review from grynspan January 6, 2025 22:29
@stmontgomery
Copy link
Contributor Author

@swift-ci please test Windows

Copy link
Contributor

@plemarquand plemarquand left a comment

Choose a reason for hiding this comment

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

LGTM

@grynspan
Copy link
Contributor

grynspan commented Jan 7, 2025

:shipit:

@stmontgomery stmontgomery merged commit 86b0ff1 into swiftlang:main Jan 8, 2025
5 checks passed
stmontgomery added a commit that referenced this pull request Jan 9, 2025
…in DYLD_FRAMEWORK_PATH when launching test runners (#8204)

- **Explanation**: This modifies the logic which sets the value of the
`DYLD_FRAMEWORK_PATH` environment variable when launching test runners
on Darwin when Xcode is installed: currently it includes the path to the
platform's developer "Frameworks" directory, and this change adds the
sibling "PrivateFrameworks" directory as well.
- **Scope**: Affects tests run on Darwin only, when Xcode is installed.
  - **Issues**: n/a
- **Original PRs**:
#8199
- **Risk**: Low. Including this runtime framework search path should
have no effect when running tests for any supported version of Xcode.
  - **Testing**: I validated this works as expected using a local build.
  - **Reviewers**: @briancroom, @grynspan, @plemarquand, @jakepetroules 

Resolves rdar://142522110
plemarquand added a commit to plemarquand/vscode-swift that referenced this pull request Feb 19, 2025
This is essentially the same change made in:
swiftlang/swift-package-manager#8199

VS Code would be able to leverage it for regular runs with `swift test`
but because when debugging we launch the xctest executable directly to
run tests, we must include the same framework search paths as SPM.
award999 pushed a commit to swiftlang/vscode-swift that referenced this pull request Feb 20, 2025
This is essentially the same change made in:
swiftlang/swift-package-manager#8199

VS Code would be able to leverage it for regular runs with `swift test`
but because when debugging we launch the xctest executable directly to
run tests, we must include the same framework search paths as SPM.
award999 pushed a commit to swiftlang/vscode-swift that referenced this pull request Feb 20, 2025
This is essentially the same change made in:
swiftlang/swift-package-manager#8199

VS Code would be able to leverage it for regular runs with `swift test`
but because when debugging we launch the xctest executable directly to
run tests, we must include the same framework search paths as SPM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug swift test Changes impacting `swift test` tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants