a2 / MessagePack.swift

It's like JSON, but fast and small…and Swift! – msgpack.org[Swift]
http://msgpack.org
MIT License
283 stars 60 forks source link

Compilation fails on 32bit devices #57

Closed ogres closed 6 years ago

ogres commented 6 years ago

When trying to compile MessagePack for 32 bit ( iOS ) devices, following lines fail on Integer overflow

https://github.com/a2/MessagePack.swift/blob/master/Sources/MessagePack/Pack.swift#L29 https://github.com/a2/MessagePack.swift/blob/master/Sources/MessagePack/Pack.swift#L123 https://github.com/a2/MessagePack.swift/blob/master/Sources/MessagePack/Pack.swift#L153 https://github.com/a2/MessagePack.swift/blob/master/Sources/MessagePack/Pack.swift#L91 https://github.com/a2/MessagePack.swift/blob/master/Sources/MessagePack/Pack.swift#L108

Tested on Xcode 9, Swift 3.2

a2 commented 6 years ago

@ogres @n3trino I'm trying to reproduce the issue with Xcode 9 but I don't have a 32-bit iOS device. Is it possible to reproduce with the simulator at all?

ogres commented 6 years ago

Try making an archive with armv7 architecture enabled

a2 commented 6 years ago

Hmm, I'm able to build an armv7 framework on my machine.

ogres commented 6 years ago

I am able to reproduce this on an empty project.

  1. Create new iOS project
  2. Set min iOS version to 9
  3. Install MessagePack via CocoaPods
  4. Set Swift lang to 3.2 for MessagePack.swift target ( and 4.0 for the project itself )
  5. Select 'Generic iOS Device' in devices list
  6. Project -> Archive
sschizas commented 6 years ago

Hello @a2 ,

Have you tried to archive? The issue appears when you archive a project and not when you build and run either on simulator or on device.

a2 commented 6 years ago

Ah I see the problem. This was fixed with PR #53 but I hadn't tagged a new release. Will do so later today.

a2 commented 6 years ago

I just pushed version 2.1.1 to CocoaPods. Let me know if this is still an issue. 😄

ogres commented 6 years ago

Works fine on 32 bit device, Thanks @a2