Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-13803] Can’t archive App that uses a swift package with an xcframework #4481

Closed
swift-ci opened this issue Nov 2, 2020 · 16 comments
Closed
Assignees
Labels

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Nov 2, 2020

Previous ID SR-13803
Radar rdar://problem/70967526
Original Reporter canius (JIRA User)
Type Bug
Environment

Xcode Version 12.3 (12C33)

Additional Detail from JIRA
Votes 12
Component/s Package Manager
Labels Bug
Assignee @neonichu
Priority Medium

md5: c6a1645c0dfce3d2940b09dc2a5c8d57

Issue Description:

thread:
https://developer.apple.com/forums/thread/662247

reproduce project:
https://github.com/canius/ArchiveErrorDemo

feedback:

https://feedbackassistant.apple.com/feedback/8932696

@typesanitizer
Copy link

@swift-ci create

@swift-ci
Copy link
Contributor Author

Comment by Uttam Pandey (JIRA)

I'm having problem with archiving the project when I use xcframework as binary dependency inside Swift Package, tried to archive with different build configurations like Release, Debug, and Custom configurations.

I'm getting error: "No such module found".

I checked this in Xcode 12.4 but problem is still not solved.

@swift-ci
Copy link
Contributor Author

Comment by Fabio Tacke (JIRA)

Same here. The issue is still present in Xcode 12.5 beta 3.

@typesanitizer
Copy link

fabiotacke (JIRA User) could you clarify what error you are seeing? This particular issue should be fixed in Xcode 12.5 beta 2, but it's possible you're seeing a different issue.

@swift-ci
Copy link
Contributor Author

Comment by Fabio Tacke (JIRA)

That's interesting. I checked out the example project in the description above and tried archiving using Xcode 12.5 beta 3 and it indeed succeeded.

However in my own project (iOS project using SPM) I'm dealing with a dependency which itself has dependency on swift-sodium which includes an XCFramework. I thought this was the same setup as described in the thread referenced in the description above but the issue ("No such module") remains even in beta 3.

For more details about the specific case and a minimal example to reproduce the issue you can take a look at the recent comments of the GitHub issue.

@swift-ci
Copy link
Contributor Author

Comment by Rick M (JIRA)

I'm running into this issue with Braintree. They claim a workaround, but it doesn't work for me.

@typesanitizer
Copy link

rmann (JIRA User), could you file a separate bug report with more details on how to reproduce your setup, the error you are seeing and what you've tried? You can link this one as related if you'd like.

@swift-ci
Copy link
Contributor Author

swift-ci commented Jun 1, 2021

Comment by Rick M (JIRA)

theindigamer (JIRA User) I posted the full project to Apple's bug reporter FB9121480. It's proprietary and didn't want to share it with the world.

@typesanitizer
Copy link

That works too, thanks!

@swift-ci
Copy link
Contributor Author

swift-ci commented Jun 2, 2021

Comment by Rick M (JIRA)

Another user out there has posted this small project that reproduces the problem: https://github.com/simonpierreroy/xcframework-issue

He wrote this: braintree/braintree_ios#679 (comment)

This seems to be a bug in the Xcode build system for swiftPM integration![]( Try this https://github.com/simonpierreroy/xcframework-issue and always clean in between it should fail) It does the same with my own local package that has an XCframework! Here is my feedback FB9125479 . I used this repo for my feedback to apple, since I was having the same issues with close source package I can not share.

@swift-ci
Copy link
Contributor Author

Comment by Simon McLoughlin (JIRA)

I'm facing a very similar issue. When importing this swift package: https://github.com/jedisct1/swift-sodium which contains an `xcframework`. I regularly get build failures (locally and on CI) whenever its the first run or has been cleaned.

To reproduce, create a package, add this as a dependency. Clean and build to see the issue. Build again and it will succeed. Clean and build again sometimes fails, sometimes passes.

The sodium package is importing the C code from an xcframework. It looks like theres an issue in the build / import order.

I'm building and running tests on my package via github actions, and its failing 50-70% of the time due to this. Becoming hugely problematic for us. Action is running on the latest Xcode 12.4. I've reproduced the issue locally on Xcode 12.5

@swift-ci
Copy link
Contributor Author

Comment by Simon McLoughlin (JIRA)

theindigamer (JIRA User) is there any update on this? The ticket not been assigned to anyone, has no labels etc. Xcode 12.5.1 seems to have made the issue worse, breaking the only workaround available

@typesanitizer
Copy link

There was an initial fix for this in Xcode 13 beta 3 (e.g. this release note)

  • Using Swift packages with binary targets no longer occasionally emits a “no such module” error when attempting to import the module of a binary target. (77465707)

But it looks like the fix only made the issue less frequent, but it still happens sometimes, as Rick M noted earlier in the thread.

@swift-ci
Copy link
Contributor Author

Comment by tigran ghazinyan (JIRA)

The errors are different from Xcode 12 to 13, hopefully, this will be assigned to somebody soon

@swift-ci
Copy link
Contributor Author

Comment by Canius Chu (JIRA)

There is another bug similar with the origin bug,
it will cause running app failed in Xcode 13 using xcframework.
The root cause is Xcode treate "Mach-O 64-bit object arm64" kind of xcframework as dynamic framework and will copy it into framework folder.
The code sign for this framework will be failed and result in running app failed.
https://bugs.swift.org/browse/SR-15256

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@neonichu
Copy link
Member

This has been fixed in Xcode 12.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants