-
Notifications
You must be signed in to change notification settings - Fork 30
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
Generated XCFrameworks missing Swift Macros #117
Comments
I made some progress. It's nowhere close to a proper solution, but I made it work with some manual hacking, so I guess it's worth sharing. Here are the steps I take to use the XCFramework generated from the Composable Architecture package, along with contained Swift Macros:
Now, I'm able to use Composable Architecture XCFramework and use Swift Macros like The only issue I found so far, is that when I use the macros in my code, Xcode previews are no longer working - fail to build due to the following error:
The broken previews need investigation, it may be a matter of telling Xcode where to find the macro binaries when building for previews. I'm not sure if the above process could be fully automated with Scipio. It may require some manual work when integrating generated XCFramework with an Xcode project (like adding a build phase and updating swift compiler flags manually). I think that at least some parts of the process could be automated, like extracting the included macro binaries when generating XCFramework. |
Hi. Thank you for opening this issue. As you said, I've noticed the problem that Scipio couldn't build the package it requires a macro. Adding
Scipio uses PIF; the format to represent the Xcode project generated by SwiftPM.
I'm going to support the Swift Macro. I'll use TCA to test the feature. |
I did some research and put my findings into a repository. It contains a simple bash script that uses Scipio to build TCA and output XCFrameworks with Swift Macros binaries. There's also an example swift package where I try to integrate the generated frameworks and macros. It mostly works, but there are some issues. I may be missing some steps when building the frameworks, or when integrating with the example swift package. |
I'm trying to use Scipio to make XCFramework for Composable Architecture. At first, it seemed to be working fine, as I was able to use the generated XCFramework in Xcode project. However, I can't use Swift Macros that Composable Architecture exposes. When trying to do so, I get the following error:
I'm unsure how to debug the issue, but I found that Tuist does some extra work when creating Xcode targets from swift packages. It adds an additional build phase for each swift package that contains macros. The build scheme looks like this:
I think the above build phase is crucial for the Swift Macros to work, when integrated in a different way than through SPM.
It would be great to use Scipio for generating XCFrameworks, and being able to use Swift Macros. I'm happy to help with further investigation and research possible solutions, but I'm not even sure where to start at the moment.
The text was updated successfully, but these errors were encountered: