Swift Macros: external macro implementation type could not be found
02:06 30 Oct 2023

I'm using MetaCodable macro in my project, installed via SwiftPM, when I try to build the project using Microsoft Azure's Pipeline using my local machine as a run agent (MBP M1 Max - Sonoma - XCode 15), I get this error message:

error: external macro implementation type 'CodableMacroPlugin.CodedAt' could not be found for macro 'CodedAt'

Some folks here suggest to add -external-plugin-path to other Swift flags in build settings, but that doesn't solve the issue.

And in this thread some also suggests to add -load-plugin-library, or -plugin-path, or -load-plugin-executable to other Swift flags, I tried every option of these using the value: $(BUILT_PRODUCTS_DIR)#MetaCodable but I got the same error with every CI build.

I also get this warning in the Azure's Pipeline build log:

"output": ":0: warning: compiler plugin not loaded: '/Users/my_user_name/Library/Developer/Xcode/DerivedData/MyProject/Build/Products/Release/CodableMacroPlugin; failed to initialize /Users/my_user_name/vsts-agent-osx-x64-2.183.1/_work/9/MyProject/Data/Models/SomeModel.swift

Any thoughts about this are appreciated.

ios azure-pipelines xcode15 swift-macro swift5.9