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

** ARCHIVE FAILED ** due to _NumericsShims missing #267

Open
maximkhatskevich opened this issue Aug 15, 2023 · 5 comments
Open

** ARCHIVE FAILED ** due to _NumericsShims missing #267

maximkhatskevich opened this issue Aug 15, 2023 · 5 comments

Comments

@maximkhatskevich
Copy link

maximkhatskevich commented Aug 15, 2023

Despite _NumericsShims is NOT intended to be part of public API, attempt to archive any of the publicly exposed modules results into failure.

The command to execute in CLI:

xcodebuild archive -scheme Numerics -destination "generic/platform=iOS" -archivePath "build/ios-device" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

it fails with underlaying error being:

.../Library/Developer/Xcode/DerivedData/swift-numerics-dgyhdelhvghturdxbqtbuzsazzjo/Build/Intermediates.noindex/ArchiveIntermediates/Numerics/IntermediateBuildFilesPath/swift-numerics.build/Release-iphoneos/RealModule.build/Objects-normal/arm64/RealModule.swiftinterface:6:8: error: no such module '_NumericsShims'

Same happens when try to archive in similar fashion any framework (does not matter if it's a Swift Package or created via Xcode framework), WHERE swift-numerics is in the dependencies list.

NOTE: in case of a framework that is built using Xcode, Archive via Xcode GUI works fine with same settings set in Xcode build settings (SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES) - archive works fine. I'd resort to that option, but it does not allow to archive for iOS simulator and I really want to put it in a script for automated execution.

Is it expected/intended behaviour? Any clarifications/suggestions would be much appreciated!

Xcode version 14.3.1

@maximkhatskevich
Copy link
Author

A bit more context. This issue happens when I use https://github.com/apple/swift-openapi-generator (which uses this package as dependency) as development time plugin, but it interferes with the build/archive process anyway. If I switch to manual CLI invocation for the generator - I do not need to mention swift-openapi-generator anywhere in dependencies, and this package is not a dependency anymore, hence it does not block my archive process, which means my problem is solved. But I am curious nonetheless if it is supposed to be this way or is it a bug? What if I want to use this package as dependency in my package and then need to archive a binary version?

@stephentyrone
Copy link
Member

stephentyrone commented Sep 7, 2023

It's not totally clear if this is a project issue or an Xcode build issue, or if this is simply a configuration that we can't support yet, but we're taking a look at it.

@maximkhatskevich
Copy link
Author

maximkhatskevich commented Sep 7, 2023

I agree, it might be Xcode build system issue, indeed. Thank you for looking into it!

@ptliddle
Copy link

ptliddle commented May 7, 2024

Did this ever get resolved or was a workaround found? I just hit this same issue when validating my build for upload to the AppStore. Numerics is a dependency in mlx-swift in my case https://github.com/ml-explore/mlx-swift. I also run into this issue with swift-async-algorithms where the swift-collections was causing the same issue. Here's a link to the issue and a current workaround. apple/swift-collections#364

@Intiserahmed
Copy link

Hi @ptliddle , May I know how you have solved the Numerics issue? I have also having the same issue '_NumericsShims'
Screenshot 2024-08-25 at 9 31 38 PM

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

No branches or pull requests

4 participants