-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Testing macros in the OSS toolchain snapshots for macOS don't seem to work with SDK bundles #8362
Comments
So the library is being built, but our CMake script installs it to a different location than it does on Linux. I'm not sure why that is or if it might be the root cause. @stmontgomery @rintaro does either of you have any insight? |
Oh, Marc also told me there's a |
Also I don't see a |
I don't think it is, as the upcoming 6.1 toolchain for linux only has |
Looks like this is, or at least was, a bug in Swift Package Manager: in 6.1, it was checking whether the target triple represented macOS, and only then included the necessary macro plugin search paths to locate However, this code all changed somewhat recently in #8295 and it might have affected this, or perhaps even fixed the issue. I'm not certain, but it would be worth trying using a Regardless, I'm going to transfer this to SwiftPM since it's something controlled at that layer. It may be a dupe, though. |
Thanks for likely finding the culprit, but my read of the code is that it is still broken in trunk for cross-compilation to non-mac platforms, because it checks the target triple instead of the host triple before applying the macOS plugin paths:
I think this was broken in #7920 last fall by @xedin, ironically when he was trying to fix cross-compilation to wasm. The issue appears to be that |
Just to add some data, I have a bare-bones repository https://github.com/marcprux/swift-testing-cross-compile-demo with CI that uses the same Android SDK on both macOS and Ubuntu. You can see the test build output for both hosts at: https://github.com/marcprux/swift-testing-cross-compile-demo/actions/runs/13816030659. Ubuntu passes, but macOS fails:
The locally-installed testing libraries on macOS are:
And on Ubuntu are:
Let me know if there is any jiggery-pokery I can do with file paths or toolchain config to experiment with getting it working. |
Description
I recently added the Testing library to my Android SDK bundles for Swift 6.1 and 6.2, finagolfin/swift-android-sdk@eb1567b1c, and it works well to cross-compile Testing tests using the latest linux snapshot toolchain and my CI-generated 6.1 SDK bundle, which I checked by cross-compiling @tayloraswift's swift-png and its tests. 😄
However, @marcprux tells me the same didn't work with the OSS mac toolchain snapshot when he tried it with another Testing repo, as he got errors saying:
suggesting there is some issue with how these Testing macros are installed on macOS.
Reproduction
Follow the instructions to use my Android SDK bundle on macOS, except using the 6.1 bundle linked above, not 6.0.3 as I have not backported the Android patches in this repo to that tag. An alternative would be to try the linux SDK bundle generated by swift-sdk-generator, if it supports this Testing library.
Expected behavior
Testing tests cross-compile fine using the mac toolchain's prebuilt macros, as they do on linux.
Environment
MacOS
Additional information
I have not reproduced this myself. Marc said he'd file this himself, but I'm doing it now so we don't forget and so somebody behind this repo can take a look in the meantime.
The text was updated successfully, but these errors were encountered: