Skip to content

Ensure Xcode SDK paths are set when running test targets. #7093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Nov 14, 2023

Currently, some of our code paths that run test targets don't correctly set the DYLD_FRAMEWORK_PATH and DYLD_LIBRARY_PATH arguments on macOS. This hasn't been a problem in practice because the XCTest helper tool is able to sort it out for us, but my plan with swift-testing is to run an executable directly (like we do for corelibs-xctest.) That means we'll have a code path that could potentially rely on XCTest or other Apple SDK bits, but which is not calling through the XCTest helper tool.

This change hoists our setting of those arguments to a position where they are always set (on macOS only!) before we run a test target, regardless of build style.

This change was previously landed as #7040 but was reverted (#7054) while we investigated a toolchain regression. We do not believe #7040 is the root cause of that issue, so this PR reapplies it.

Currently, some of our code paths that run test targets don't correctly
set the `DYLD_FRAMEWORK_PATH` and `DYLD_LIBRARY_PATH` arguments on
macOS. This hasn't been a problem in practice because the XCTest helper
tool is able to sort it out for us, but my plan with swift-testing is to
run an executable directly (like we do for corelibs-xctest.) That means
we'll have a code path that could potentially rely on XCTest or other
Apple SDK bits, but which is not calling through the XCTest helper tool.

This change hoists our setting of those arguments to a position where
they are always set (on macOS only!) before we run a test target,
regardless of build style.

This change was previously landed as #7040 but was reverted while we investigated a toolchain regression. We do not believe #7040 is the root cause of that issue, so this PR reapplies it.
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test Windows

@grynspan grynspan merged commit 103d275 into main Nov 14, 2023
@grynspan grynspan deleted the jgrynspan/reapply-7040 branch November 14, 2023 19:49
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