Hello, one of my dependencies for a project is panko_serializer, and I am using Windows. I wasn't able to compile because there is an enum value Unknown
used somewhere in the project, but there is also an enum value Unknown
in windows' networking headers. When I temporarily renamed windows' Unkown
to _Unknown
library compiled successfuly. So I believe fix for this issue is very easy, just rename your Unknown
enum value to something else. You can see more info in logs bellow.
Installing panko_serializer 0.7.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/panko_serializer-0.7.3/ext/panko_serializer
C:/Ruby27-x64/bin/ruby.exe -I C:/Ruby27-x64/lib/ruby/2.7.0 -r
./siteconf20201021-13060-2iokr6.rb extconf.rb
creating Makefile
current directory:
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/panko_serializer-0.7.3/ext/panko_serializer
make "DESTDIR=" clean
current directory:
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/panko_serializer-0.7.3/ext/panko_serializer
make "DESTDIR="
generating panko_serializer-x64-mingw32.def
compiling ./attributes_writer/active_record.c
./attributes_writer/active_record.c: In function
'active_record_attributes_writer':
./attributes_writer/active_record.c:122:70: warning: passing argument 3 of
'read_attribute' discards 'volatile' qualifier from pointer target type
[-Wdiscarded-qualifiers]
122 | volatile VALUE value = read_attribute(attributes_ctx, attribute,
&isJson);
|
^~~~~~~
./attributes_writer/active_record.c:68:84: note: expected 'VALUE *' {aka 'long
long unsigned int *'} but argument is of type 'volatile VALUE *' {aka 'volatile
long long unsigned int *'}
68 | VALUE read_attribute(struct attributes attributes_ctx, Attribute
attribute, VALUE* isJson) {
|
~~~~~~~^~~~~~
In file included from ./attributes_writer/active_record.h:9,
from ./attributes_writer/active_record.c:1:
At top level:
./attributes_writer/type_cast/type_cast.h:65:25: warning: 'type_casts' defined
but not used [-Wunused-variable]
65 | static struct _TypeCast type_casts[] = {
| ^~~~~~~~~~
compiling ./attributes_writer/attributes_writer.c
In file included from ./attributes_writer/attributes_writer.c:1:
./attributes_writer/attributes_writer.h:10:19: error: redeclaration of
enumerator 'Unknown'
10 | enum ObjectType { Unknown = 0, ActiveRecord = 1, Plain = 2, Hash = 3 };
| ^~~~~~~
In file included from
C:/Ruby27-x64/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:11,
from
C:/Ruby27-x64/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
from
C:/Ruby27-x64/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
from C:/Ruby27-x64/include/ruby-2.7.0/ruby/win32.h:41,
from C:/Ruby27-x64/include/ruby-2.7.0/ruby/defines.h:371,
from C:/Ruby27-x64/include/ruby-2.7.0/ruby/ruby.h:29,
from C:/Ruby27-x64/include/ruby-2.7.0/ruby.h:33,
from ./attributes_writer/attributes_writer.h:3,
from ./attributes_writer/attributes_writer.c:1:
C:/Ruby27-x64/msys64/mingw64/x86_64-w64-mingw32/include/winioctl.h:526:3: note:
previous definition of 'Unknown' was here
526 |
Unknown,F5_1Pt2_512,F3_1Pt44_512,F3_2Pt88_512,F3_20Pt8_512,F3_720_512,F5_360_512,F5_320_512,F5_320_1024,F5_180_512,F5_160_512,
| ^~~~~~~
In file included from ./attributes_writer/active_record.h:9,
from ./attributes_writer/attributes_writer.h:5,
from ./attributes_writer/attributes_writer.c:1:
./attributes_writer/type_cast/type_cast.h:65:25: warning: 'type_casts' defined
but not used [-Wunused-variable]
65 | static struct _TypeCast type_casts[] = {
| ^~~~~~~~~~
make: *** [Makefile:244: attributes_writer.o] Error 1
make failed, exit code 2
Gem files will remain installed in
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/panko_serializer-0.7.3 for inspection.
Results logged to
C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/panko_serializer-0.7.3/gem_make.out
An error occurred while installing panko_serializer (0.7.3), and Bundler cannot
continue.
Make sure that `gem install panko_serializer -v '0.7.3' --source
'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
panko_serializer