sjavora / swift-syntax-xcframeworks

81 stars 20 forks source link

Cannot build tests for the iOS simulator #7

Closed elvirorocca-jt closed 1 month ago

elvirorocca-jt commented 1 month ago

Hi, I created a test project following the instructions in the README, but I cannot run tests in the iOS simulator, it fails with several errors that have this kind of message for many modules:

While building for iOS Simulator, no library for this platform was found in '/Users/MY_USER/Library/Developer/Xcode/DerivedData/TestMacro-csquftvfoocdvoepolblzlbwwmof/SourcePackages/artifacts/swift-syntax-xcframeworks/_SwiftSyntaxTestSupport/_SwiftSyntaxTestSupport.xcframework'.

I need to be able to execute tests in the simulator because my macro code is part of a larger package that contains iOS-specific code. I think I can work around this by extracting the macro code into a different package, and only run the tests for that package in macOS, but I was wondering if the issue is that the binaries are not also generated for the iOS simulator, and if it's possible to generate them.

Thanks

sjavora commented 1 month ago

Hi, could you please elaborate on your setup? I created the default macro package, added the latest XCFramework, changed the target to iPhone 16 simulator and tests build just fine.

They won't actually run, since all code there is gated behind #if canImport, but I don't see the error that you posted.

elvirorocca-jt commented 1 month ago

Hi, thanks for the answer, I was able to fix the issue, it looks like it was a misconfiguration on my side. I'll close it.