swiftxcodekitura

SwiftVerifyEmittedModuleInterface normal arm64 Issue building release with CryptorRSA | Xcode 14.3


I am trying to build a release xcframework for distribution that uses SwiftJWT via Swift Package Manager: SwiftJWT SPM dependency

I am able to build fine confirmed for Xcode 14.2.0, 14.0.1, 13.4.1, 13.2.1, and 13.1.0. But when I try building with Xcode 14.3, I get the following error:

** ARCHIVE FAILED **


The following build commands failed:
    SwiftVerifyEmittedModuleInterface normal arm64 Verifying\ emitted\ module\ interface\ CryptorRSA.private.swiftinterface /Users/tj/Library/Developer/Xcode/DerivedData/VNWebSDK-fwdasyvrfoacjledmziziwepgjrj/Build/Intermediates.noindex/ArchiveIntermediates/VNWebSDK/IntermediateBuildFilesPath/CryptorRSA.build/Release-iphoneos/CryptorRSA.build/Objects-normal/arm64/CryptorRSA.private.swiftinterface (in target 'CryptorRSA' from project 'CryptorRSA')
    SwiftVerifyEmittedModuleInterface normal arm64 Verifying\ emitted\ module\ interface\ CryptorRSA.swiftinterface /Users/tj/Library/Developer/Xcode/DerivedData/VNWebSDK-fwdasyvrfoacjledmziziwepgjrj/Build/Intermediates.noindex/ArchiveIntermediates/VNWebSDK/IntermediateBuildFilesPath/CryptorRSA.build/Release-iphoneos/CryptorRSA.build/Objects-normal/arm64/CryptorRSA.swiftinterface (in target 'CryptorRSA' from project 'CryptorRSA')
(2 failures)

I've tried several things, like setting -Xfrontend -module-interface-preserve-types-as-written in OTHER_SWIFT_FLAGS and excluding architectures. I can't get it to work.

Could this be due to a conflict/duplication between a module and class name inside of CryptorRSA, or is there something I can do to get this to build the xcframework in Xcode 14.3?

Note: CryptorRSA is a dependency of SwiftJWT.


Solution

  • I am not entirely certain of what the issue is, but the reason this is failing in Xcode 14.3 is due to this from the Xcode 14.3 release notes:

    Something in the dependency is failing module validation.

    I am now suffering from this failure in my project but due to a different reason. I am currently looking to see if there is a way to disable this verifier for the time being until I can resolve the underlying issue.

    UPDATE:

    There is a flag, -no-verify-emitted-module-interface that can be applied to the Other Swift Flags Swift Compiler Flag which disables the module verifier during the build process.

    Found it mentioned on this Swift issue on GitHub.

    There are a few variations of what the flag should be listed in that issue, however, what I have noted above is what worked for me with Xcode 14.3.