ml-explore / mlx-swift

Swift API for MLX
https://ml-explore.github.io/mlx-swift/
MIT License
675 stars 54 forks source link

Invalid Bundle Identifier for framework _NumericsShims #85

Closed ptliddle closed 6 months ago

ptliddle commented 6 months ago

When i try and upload a build which uses the MLX library to TestFlight in Xcode i'm receiving the following error.

Invalid Bundle Identifier. The application bundle contains a tool or framework _NumericsShims [tech.xxxx.xxxx.pkg/Payload/XXXX.app/Contents/Frameworks/_NumericsShims.framework] using the bundle identifier '_NumericsShims', which is not a valid bundle identifier. (ID: fda826bb-f3ef-44c3-9f7b-f8c18360d157)

This also occurs if i just run validation. This looks very similar to an issue on the swift collections framework https://github.com/apple/swift-collections/issues/364. It seems like it maybe a tooling issue that needs to be fixed but i was wondering if anyone else has hit this issues and possibly found a work around?

I did try a similar approach to what was suggested in the swift collections issue above, creating a fork of the Numerics library and removing the underscore from the NumericShims target but while that passed validation, when i then download that build in TestFlight and try testing on my intel mac it just crashes. Interestingly it seems to work on my M1 Mac, both are on Ventura, M1 (13.6.3) and Intel (13.6.6).

davidkoski commented 6 months ago

Yes, I think you are right -- you might want to file an issue on the numerics library as the change will have to happen there.

What kind of crash do you see on the Intel Mac?

I know things build for intel but I am not sure how supported that is -- I certainly don't test on that platform. @awni ?

awni commented 6 months ago

We don't support Intel Macs in general. The code should build but some things may indeed crash. We don't have plans to improve support for that platform.

ptliddle commented 6 months ago

Yep, just to clarify i'm not actually invoking any MLX functionality on the Intel Mac, all that functionality is gated on a check to see if the app is running on Apple Silicon.

I was receiving a crash right on launch with the TestFlight version on the Intel Mac. After deeper investigation that issue was unrelated to the underscore issue with NumericShims and just happened to coincide with the TestFlight build where i was testing that change.

So, the forked version of Swift Numerics i made where i replaced all references to _NumericsShims seems to work correctly. I'll leave a link here incase anyone needs it. Essentially you can just add this directly to your project as a dependency and it will take precedence over the reference in mlx-swift's Package.swift and thus allow you to pass AppStore validation.

https://github.com/ptliddle/swift-numerics