-
Notifications
You must be signed in to change notification settings - Fork 246
Doesn't work in playground due to zlib code #50
Comments
I'm not familiar with playgrounds, but I did take a look and I couldn't find a solution just yet. It appears that there is no I looked at other libraries that Apple recommends such as LZ4, LZMA, and LZFSE. All of them seem to require a linking stage which I don't think is possible in playground. As it stands the only reasonable solution that I know of is to comment out the code. I'll keep looking and hopefully I'll find something. |
The documentation you linked to is what I was looking at. It looks trivially easy to use in the playground, just |
Thanks for pointing that out. I was able to swap out the old code with the new and it seems to compile (though I haven't test if the inflating actually works). I had to include the Compression framework to the project. I'm still not able to get it to work in the playground. I added the WebSocket.swift and the libcompression.tbd file to the project. Here's a gist of the WebSocket.swift I must be close. Do you have any ideas? |
I'm having trouble with Xcode 7.3/Swift 2.2. It's choking on the libcompression code when it's in the Sources directory. It looks like it's not linking against the library correctly. I set up a minimal test case playground: a single file in Sources containing just enough code to call
Taking the exact same playground & code (changing 1 line for Swift 3), it seems to be working in Xcode 8b2. Moving that minimal code out of the file in Sources directory and putting it into the playground's Contents.swift (the "playground" file), it works fine under 7.3. So maybe there's a 7.3 incompatibility or bug? I did not need to include libcompression.tbd (and don't know what that does, but it seemed to make things worse in 7.3). I may keep looking at this today or tomorrow, and see if I can get libcompression working with the Swift 3.0 version of WebSocket.swift that I've been playing with. |
That's good news. If all seem well with Xcode 8 then I'll migrate to libcompression for Swift 3. |
When I include WebSocket.swift in a playground's sources directory, the playground fails to execute.
I'm able to work around the failure by commenting out the @_silgen_name declarations for libz methods and the uses of those methods in the Inflator/Deflator classes.
I'm not sure what the real solution to the problem is. Maybe using Apple's libcompression API, but I haven't (yet) taken the time to compare it to libz.
The text was updated successfully, but these errors were encountered: