Closed josh-m-sharpe closed 1 year ago
I managed to get gcc 10 installed, but I still get the same error:
gcc --version
gcc (GCC) 10.4.1 20221124 (Red Hat 10.4.0-1)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This SO suggests some 'extension' can be installed to support this? https://stackoverflow.com/a/48841597
Seems like the way these rb_data_type_t
constants are defined is different in other gems:
date: https://github.com/ruby/date/blob/master/ext/date/date_core.c#L3023-L3028 puma: https://github.com/puma/puma/blob/master/ext/puma_http11/puma_http11.c#L276-L280
vs:
This is a C++ problem. C supports designated initializers since C99 but C++ supports them only since C++20, and Amazon Linux does not have C++20. I wonder why date and puma don't use designated initializers... perhaps they are written by C++ programmer, not a C programmer like me.
Fixed with commit 7ea683cd9a716d7218ba268a23386095a00b453e and released as version 3.5.3: https://github.com/akihikodaki/cld3-ruby/releases/tag/v3.5.3
Awesome - thank you!
3.5.1 also fails with the same error 3.5.0 installs and works
My C is rusty. Various googling suggests this is some kind of "using the wrong compiler issue" - but isn't that something the ruby gem should obfuscate away? Here's a SO with that error: https://stackoverflow.com/questions/31215971/non-trivial-designated-initializers-not-supported
Not sure if this is relevant, but I have this gcc: