-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Nilable property issue in YAML::Serializable on macOS #11934
Comments
for me its ok:
|
What if you don't use zig cc? |
crystal run ser.cr
as I mentioned here. |
OK. I followed the suggestion in #10653 (comment) : crystal build --link-flags -L/usr/lib ser.cr and run the built binary executable: ./ser then got expected
otool -L ser
now Crystal compiler uses system provided libiconv. |
From documentation https://crystal-lang.org/install/on_mac_os/
This should be the root cause of the libiconv issue. |
This looks like two different problems. One is a weird deserialization error (that apparently only happens when linking with |
@straight-shoota Yes. Now there are two different problems in my case. But I will not open a seperate issue for the second one because I don't know the status of linking |
|
There is no crystal build --link-flags=-fuse-ld=lld ser.cr got
pkgin/pkgsrc has the |
Oh. There is another issue raised when compiling with option
got
got the same
got the same
Note:
There is no such issue when compiling the hello word example and most of the example code on the homepage of the official website of Crystal, e.g. |
Confirm the above issue is fixed in the 1.8.0 release. <3 @HertzDevil % crystal --version
Crystal 1.8.0 [14bfa992e] (2023-04-14)
LLVM: 15.0.7
Default target: x86_64-apple-macosx % crystal build --debug ser.cr
% otool -L ser
ser:
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
% ./ser
Manager
John
Jenny % zig version
0.10.1
% CC="zig cc" crystal build --debug ser.cr
% otool -L ser
ser:
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
% ./ser
Failed to raise an exception: END_OF_STACK
[0x0] ???
Tried to raise:: Expected Nil, not "Manager" at line 1, column 8 (YAML::ParseException) |
File
ser.cr
:Run it under Linux:
docker run --rm -it -v $(pwd):/workspace -w /workspace crystallang/crystal:latest-alpine \ crystal run ser.cr
got expected:
But run it under macOS:
got exception:
Crystal version on Linux:
got
Crystal version on macOS:
got
Note: I am using
zig cc
as C compiler on macOS. Please see here for the details.The text was updated successfully, but these errors were encountered: