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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSONDecoder fails, same code works on x86_64 #2223
Comments
JSONDecoder
fails, same code works on x86_64
Thanks for the report @flavio, great catch! Interestingly enough, |
@kateinoigakukun Let's wait until a corresponding 5.3 snapshot is built, test if it works, and then release as 5.3.1, WDYT? |
@MaxDesiatov I support that plan 馃憤 |
I've verified that the issue is fixed in @kateinoigakukun Do we have a process for tagging a new release? Should I just create the 5.3.1 release that points to the same commit as |
@MaxDesiatov Yes, I think it's ready for the next release. |
I know you've released 5.3.0, so just want to check that I don't miss anything. Is there anything that you've done for the 5.3.0 other than creating a GitHub release and reuploading renamed assets from a corresponding snapshot tag? |
@MaxDesiatov Those jobs can be done by "Manual distribution" with the params |
@flavio the issue should be fixed in the latest 5.3.1 release. Does it resolve the problem for you? |
Big disclaimer: I'm new to swift, I spent the last days playing around with it because it seems the WASM support you are working on is already pretty good. Kudos to you 馃憦
The problem
I'm trying to decode an instance of a custom
struct
starting from a JSON object. I tried to leverage theJSONDecoder
class from the foundation module. It looks like the same code works on x86_64, but does not on WASM.Any help is appreciated 鉂わ笍
How to reproduce the issue
I created an empty folder, inside of that I wrote this simple
main.swift
file:I compiled the code on my Linux system using the latest version of the
ghcr.io/swiftwasm/swift
container.I produced a x86_64 binary via
swiftc main.swift
, this produces amain
binary.I produced a WASM binary via
swiftc -target wasm32-unknown-wasi main.swift -o main.wasm
, this produces amain.wasm
binary.The regular x86_64 binary can be run without any issue:
The WASM file instead fails:
As you can see the WASM binary cannot use the
JSONDecode
class, but it can useJSONSerialization
just fine.Environment details
Swift compiler
Coming from the container
ghcr.io/swiftwasm/swift@sha256:763cb6e1a18ce18ebc71634186c4d18d718a594bab149077478695ab9b2e0fd4
WASM runtime
I'm using
wasmtime
version 0.21.0Host
My host is openSUSE Tumbleweed, running on a x86_64 machine.
The text was updated successfully, but these errors were encountered: