fix(bindings,ci): Remove unsafeFlags from swift publish#1136
Open
DaughterOfMars wants to merge 1 commit intodevelopfrom
Open
fix(bindings,ci): Remove unsafeFlags from swift publish#1136DaughterOfMars wants to merge 1 commit intodevelopfrom
DaughterOfMars wants to merge 1 commit intodevelopfrom
Conversation
Thoralf-M
reviewed
May 8, 2026
Thoralf-M
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
make swift-release-example, which currently errors with:The published
Package.swiftoniotaledger/iota-sdk-swiftcarries alinkerSettings: [.unsafeFlags(["-L", "Sources/CIotaSDK", "-liota_sdk_ffi"])]clause on theIotaSDKtarget. SwiftPM forbids consuming a package whose targets declare.unsafeFlags(...), so any downstream consumer (including the release example) is broken. The flags were a side-effect of the publish workflow archiving the local-devbindings/swift/Package.swiftverbatim and overwriting the consumer repo'sPackage.swiftwith it on every release — the comment in that file claiming the published copy uses an XCFramework was aspirational.This PR makes that comment true: the publish flow now builds an XCFramework from the per-target dylibs and ships a clean
Package.swiftthat references it via.binaryTarget. The local-devPackage.swift(still using.unsafeFlagsfor fast in-repo iteration) is unchanged.Changes
bindings/swift/dist/(new)Package.swift— the manifest that gets written intoiota-sdk-swifton publish. Uses.binaryTarget(name: "CIotaSDK", path: "IotaSDK.xcframework"), drops the example targets and.unsafeFlags.module.modulemap— bundled into each XCFramework slice'sHeaders/..github/workflows/swift_publish.ymlxcframeworkjob: lipos the macOS x86_64 + arm64 dylibs into a universal slice, thenxcodebuild -create-xcframeworkover the macOS fat lib + iOS device dylib + iOS-sim dylib. ProducesIotaSDK.xcframeworkas an artifact.release-archivesnow consumesxcframework(instead ofprepare-libraries-archivesdirectly), copiesdist/Package.swiftover the local-dev one, removesSources/CIotaSDK,lib, anddistbefore commit.prepare-source-archivenow shipsbindings/swift/distinstead ofbindings/swift/Package.swift.prepare-libraries-archivesmatrix simplified:runs-on: macos-latesthoisted out of every entry, and the constantlib: libiota_sdk_ffi.dylibfield is gone (inlined where used)..github/workflows/{swift,csharp,go}_publish.ymlif:guards onprepare-libraries-archivesstandardized fromcontains(tag_name, ...)tostartsWith(tag_name, ...), matching the source-archive jobs and being precise about the tag prefix format.