Export Localization Build failing with Macros

Recently we introduced a macro to our workspace. Builds fine inside Xcode, as well as builds fine using xcodebuild. Seemed like everything was working perfectly until we went to export localizations.

If we attempt to do it from Xcode itself it will fail as it attempts to build macOS (which is a totally different issue)

We have this process automated though so it is being built via command line:

This is the exact prompt we're running

xcodebuild -exportLocalizations -localizationPath ../output -workspace <workspace>.xcworkspace -exportLanguage en -sdk iphoneos

This will do the normal Xcode package/build graph resolution and generation and begin building.

Eventually when it hits a use case of the macro it will fail. In each case when it fails it will have something like this:

<unknown>:0: warning: compiler plugin not loaded: '<output-path>/<our-macro-package>; failed to initialize
<path-to-usage>.swift:29:35: error: external macro implementation type '<our-macro-package>.<our-macro>' could not be found for macro '<our-macro>()'

If I go to that output path I can see the macro package executable there. If I look in the build command for the file I can something that looks like this:

... 
-load-plugin-executable <output-path>/<our-macro-package>\#<our-macro-package>
...

If attempt to build, without the -exportLocalizations flag, it works and builds just fine. I'm not sure what's happening here.

Has anyone seen this? Macros+export localizations?

Hello,

Could you file a Feedback report that includes the information here, as well as any commands run, command output, and if easily reproducible, a sample project?

I'm encountering the exact same issue. Any progress on its resolution, or workarounds?

Hello, I am facing the same problem. Wonder if there was any update for it so far?

Hello, For the export command, please try using something like -destination 'platform=iOS,name=Any iOS Device’ instead of -sdk iphoneos. That way the macro plugin itself is not restricted to the iOS SDK since it needs to build for a macOS host.

Hi, thanks for your reply and suggestion.

In my current project I have frameworks that are not compiled for macOS, causing the above suggestion to fail. And I can't currently update those frameworks to also generate a version for macOS, as they are 3-rd party ones, that I use on my project.

I wonder if there is something I could do to avoid this problem?

Thanks

Export Localization Build failing with Macros
 
 
Q