Skip to content

Process the correct slice for multi-arch Linux XCFrameworks#1462

Open
vsarunas wants to merge 6 commits into
swiftlang:mainfrom
ordo-one:xcf-no-library-found-linux
Open

Process the correct slice for multi-arch Linux XCFrameworks#1462
vsarunas wants to merge 6 commits into
swiftlang:mainfrom
ordo-one:xcf-no-library-found-linux

Conversation

@vsarunas

Copy link
Copy Markdown
Contributor

@jakepetroules unfortunately one of the polishes in #1310 resulted in a breakage, now that 6.4 builds are available trying to use switch.

The task action fails, since it never supplies an architecture and an early returned was added in findLibrary(), resulting in:

error: While building for linux, no library for this platform was found in 'OrdoDistributedABI-Linux.xcframework'.
error: ProcessXCFramework /home/actions/_work/package-data-model/package-data-model/.build/artifacts/distributed-system-sdk/DistributedABI/OrdoDistributedABI-Linux.xcframework /home/actions/_work/package-data-model/package-data-model/.build/out/Products/Debug-linux/libOrdoDistributedABI.so linux failed with a nonzero exit code. Command line:     cd /home/actions/_work/package-data-model
    builtin-process-xcframework --xcframework /home/actions/_work/package-data-model/package-data-model/.build/artifacts/distributed-system-sdk/DistributedABI/OrdoDistributedABI-Linux.xcframework --platform linux --target-path /home/actions/_work/package-data-model/package-data-model/.build/out/Products/Debug-linux

Also fixes an issue with ordering of the x86 vs aarch64; depending on the order the XCF was generated, could have picked the wrong architecture.

// linux-x86_64) share a platform and library file name, so platform alone cannot disambiguate them here.
let library: XCFramework.Library
if let libraryIdentifier {
guard let resolved = xcframework.libraries.first(where: { $0.libraryIdentifier == libraryIdentifier && $0.supportedPlatform == plat }) else {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No first(where:) please. Use filter(where:) and then emit an error if there are >1 matches.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Comment thread Sources/SWBCore/SpecImplementations/Tools/ProcessXCFrameworkLibrary.swift Outdated
@freef4ll freef4ll requested a review from rjmansfield as a code owner June 19, 2026 13:41
@vsarunas vsarunas force-pushed the xcf-no-library-found-linux branch from 44f4770 to 283f3a0 Compare June 19, 2026 13:43
Comment thread Sources/SWBTaskExecution/TaskActions/ProcessXCFrameworkTaskAction.swift Outdated
@jakepetroules

Copy link
Copy Markdown
Collaborator

Looks like you accidentally included a bunch of other commits in your branch, can you go ahead and undo that?

@vsarunas vsarunas force-pushed the xcf-no-library-found-linux branch from 76c84f7 to bbefe99 Compare July 1, 2026 07:54
@vsarunas

vsarunas commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@jakepetroules thanks! Fixed now.

@jakepetroules

Copy link
Copy Markdown
Collaborator

@swift-ci test

@vsarunas vsarunas force-pushed the xcf-no-library-found-linux branch from bbefe99 to 38d9d2a Compare July 1, 2026 21:37
@vsarunas

vsarunas commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@jakepetroules , could you trigger CI again please?

@jakepetroules

Copy link
Copy Markdown
Collaborator

@swift-ci test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants