Skip to content

Specify the module to find the ABI entry point function in (in our own tests). #801

New issue

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

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

Already on GitHub? # to your account

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Nov 4, 2024

The order in which Xcode loads the Apple-vendored copy of Swift Testing vs. a developer-supplied XCTest bundle is unspecified. Our tests assume that the "current" copy of Swift Testing (that is, the copy they linked against) is the first one loaded, which is not always true when running tests in Xcode. The modified tests end up finding the wrong entry point functions when called within Xcode if the load order has changed.

This PR explicitly specifies that we are looking for the entry point functions in the module the tests are linked against. The change is applied across all platforms that support dynamic linking for the sake of consistency as any of them might have linked a copy of Swift Testing from the toolchain and the package itself.

Resolves rdar://139140302.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…n tests).

The order in which Xcode loads the Apple-vendored copy of Swift Testing vs. a
developer-supplied XCTest bundle is unspecified. Our tests assume that the
"current" copy of Swift Testing (that is, the copy they linked against) is the
first one loaded, which is not always true when running tests in Xcode. The
modified tests end up finding the wrong entry point functions when called within
Xcode if the load order has changed.

This PR explicitly specifies that we are looking for the entry point functions
in the module the tests are linked against.

Resolves rdar://139140302.
@grynspan grynspan added bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support workaround Workaround for an issue in another component (may need to revert later) labels Nov 4, 2024
@grynspan grynspan added this to the Swift 6.1 milestone Nov 4, 2024
@grynspan grynspan self-assigned this Nov 4, 2024
@grynspan
Copy link
Contributor Author

grynspan commented Nov 4, 2024

@swift-ci please test

@grynspan
Copy link
Contributor Author

grynspan commented Nov 4, 2024

@swift-ci test

@grynspan grynspan merged commit 93eb4ed into main Nov 4, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/139140302-explicit-module-for-entry-point-lookup-tests branch November 4, 2024 20:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug 🪲 Something isn't working darwin 🍎 macOS, iOS, watchOS, tvOS, and visionOS support workaround Workaround for an issue in another component (may need to revert later)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants