swiftlang / swift-markdown

A Swift package for parsing, building, editing, and analyzing Markdown documents.
https://swiftpackageindex.com/swiftlang/swift-markdown/documentation/markdown
Apache License 2.0
2.79k stars 191 forks source link

Cannot use `swift-markdown` in package built for distribution #195

Closed dfeinzimer closed 3 months ago

dfeinzimer commented 3 months ago

I've created an incredibly simple package with swift-markdown as the only dependency.

Archiving my package for distribution with the following command fails:

xcodebuild archive -scheme MyLibrary -destination generic/platform=iOS -archivePath /Users/[username]/Desktop/iOS.xcarchive BUILD_LIBRARY_FOR_DISTRIBUTION=YES

/Users/[username]/Library/Developer/Xcode/DerivedData/MyLibrary-guqxdcvdzivakeakwqoytmpxwgur/Build/Intermediates.noindex/ArchiveIntermediates/MyLibrary/IntermediateBuildFilesPath/swift-markdown.build/Release-iphoneos/Markdown.build/Objects-normal/arm64/Markdown.private.swiftinterface:4:8: error: no such module 'CAtomic'
import CAtomic
       ^
/Users/[username]/Library/Developer/Xcode/DerivedData/MyLibrary-guqxdcvdzivakeakwqoytmpxwgur/Build/Intermediates.noindex/ArchiveIntermediates/MyLibrary/IntermediateBuildFilesPath/swift-markdown.build/Release-iphoneos/Markdown.build/Objects-normal/arm64/Markdown.private.swiftinterface:1:1: error: failed to verify module interface of 'Markdown' due to the errors above; the textual interface may be broken by project issues or a compiler bug
// swift-interface-format-version: 1.0
^

** ARCHIVE FAILED **

Removing BUILD_LIBRARY_FOR_DISTRIBUTION=YES succeeds

** ARCHIVE SUCCEEDED **
dfeinzimer commented 3 months ago
dfeinzimer commented 3 months ago

OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface seems to be the fix.