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

Not supported for XCode10 #39

Open
nikhilbfru opened this issue Mar 28, 2019 · 9 comments
Open

Not supported for XCode10 #39

nikhilbfru opened this issue Mar 28, 2019 · 9 comments

Comments

@nikhilbfru
Copy link

No description provided.

@adolfo
Copy link
Collaborator

adolfo commented Apr 11, 2019

@nikhilbfru is this Xcode 10.2?

@anatoliykant
Copy link

yes, Xcode 10.2

@anatoliykant
Copy link

@aciidb0mb3r, @airmap
The framework tests on Xcode 10.2.1 do not pass.
For example, if I run the testPublishData() test in class SwiftMQTTTests, then I get an error.
At the same time on Xcode 10.1 test testPublishData() like all other tests pass.
I spent a lot of time to find the error and problem in func parse (_ read: StreamReader) -> MQTTPacket? in the MQTTPacketFactory.swift file, namely the data returned for Data (len: packetLength, from: read) (line 39).
Instead
▿ data: 2 bytes
                 - count: 2
                 ▿ pointer: 0x00007000069f6f20
                   - pointerValue: 123145413422880
                 ▿ bytes: 2 elements
                   - 0
                   - 1

Returns 0 in the second byte:
▿ data: 2 bytes
                 - count: 2
                 ▿ pointer: 0x00007000069f6f20
                   - pointerValue: 123145413422880
                 ▿ bytes: 2 elements
                   - 0
                   - 0
This byte corresponds to the response ID of the sent message.
Do you have any thoughts on how this can be fixed and is it a mistake for Apple engineers to use UnsafeMutablePointer(mutating:) or Data.init (count: len)?
Thanks

@kervich
Copy link

kervich commented Jun 24, 2019

The issue can be reproduced with swift-5/5.1 toolchain and Xcode 9/10.1. It is my feeling that this has to do something with ABI stability that was introduced in swift-5, possibly changing whatever reading Swift.Data/NSData with Unsafe{Mutable{Raw}}Pointer yields. Even though SWIFT_VERSION is set to 4.x, it is still Swift-5 compiler that runs in 4.2 compatibility mode (as in lexical structure, not binary produced)

@anatoliykant
Copy link

The issue can be reproduced with swift-5/5.1 toolchain and Xcode 9/10.1. It is my feeling that this has to do something with ABI stability that was introduced in swift-5, possibly changing whatever reading Swift.Data/NSData with Unsafe{Mutable{Raw}}Pointer yields. Even though SWIFT_VERSION is set to 4.x, it is still Swift-5 compiler that runs in 4.2 compatibility mode (as in lexical structure, not binary produced)

I solved the problem.
THX

@kervich
Copy link

kervich commented Jun 24, 2019

@anatoliykant, dare to share your solution?

@anatoliykant
Copy link

@anatoliykant, dare to share your solution?

I can lay out in the evening, hours through 8.

@Zubkov89
Copy link

Hi, @anatoliykant!
We faced the same issue, could you upload your fix, please!

@anatoliykant
Copy link

@kervich
@Zubkov89
I created a pull request - #44
You can wait, when it will accept or clone my branch.

kervich pushed a commit to kervich/SwiftMQTT that referenced this issue Jun 28, 2019
kervich added a commit to kervich/SwiftMQTT that referenced this issue Jun 28, 2019
aChase55 added a commit to aChase55/SwiftMQTT that referenced this issue Apr 19, 2021
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

5 participants