Closed jmartin-tech closed 1 year ago
Thanks for the report, could you test this branch: https://github.com/msgpack/msgpack-ruby/pull/335 ?
Branch builds in my test env, thanks for the quick look!
Pending: (Failures listed here are expected and do not affect your suite's status)
1) MessagePack with other things raises an error on #unpack with garbage
# but nothing was raised. why?
# ./spec/msgpack_spec.rb:118
Finished in 23.29 seconds (files took 0.35594 seconds to load)
448 examples, 0 failures, 1 pending
msgpack 1.7.0 built to pkg/msgpack-1.7.0.gem.
[warn]: @param tag has unknown parameter name: obj
in file `doclib/msgpack/factory.rb' near line 139
[warn]: Unknown tag @returns in file `doclib/msgpack/factory.rb` near line 150
[warn]: Unknown tag @returns in file `doclib/msgpack/factory.rb` near line 161
Files: 11
Modules: 1 ( 1 undocumented)
Classes: 23 ( 17 undocumented)
Constants: 5 ( 1 undocumented)
Attributes: 6 ( 0 undocumented)
Methods: 77 ( 0 undocumented)
83.04% documented
based on:
docker run --rm=true --tty -u jenkins \
rapid7/msf-centos6-x64-omnibus:2020_03 \
bash -l -c "cd ~/; git clone https://github.com/msgpack/msgpack-ruby; cd msgpack-ruby; git checkout test-static-insert; rvm get stable; rvm install 3.0.5; rvm use 3.0.5; bundle; rake; gem install --local pkg/msgpack"
Of note when building against Ruby 2.6.5 there are other failures.
mkdir -p tmp/x86_64-linux/msgpack/2.6.5
cd tmp/x86_64-linux/msgpack/2.6.5
/var/jenkins_home/.rvm/rubies/ruby-2.6.5/bin/ruby -I. -r.rake-compiler-siteconf.rb ../../../../ext/msgpack/extconf.rb
checking for ruby/st.h... yes
checking for st.h... yes
checking for rb_enc_interned_str() in ruby.h... no
checking for rb_hash_new_capa() in ruby.h... no
checking for whether -fvisibility=hidden is accepted as CFLAGS... yes
checking for whether -I.. is accepted as CFLAGS... yes
checking for whether -Wall is accepted as CFLAGS... yes
checking for whether -O3 is accepted as CFLAGS... yes
checking for whether -ggdb3 is accepted as CFLAGS... yes
checking for whether -DHASH_ASET_DEDUPE=1 is accepted as CFLAGS... yes
checking for whether -DSTR_UMINUS_DEDUPE_FROZEN=0 is accepted as CFLAGS... yes
creating Makefile
cd -
cd tmp/x86_64-linux/msgpack/2.6.5
/usr/bin/gmake
compiling ../../../../ext/msgpack/buffer.c
compiling ../../../../ext/msgpack/buffer_class.c
compiling ../../../../ext/msgpack/extension_value_class.c
compiling ../../../../ext/msgpack/factory_class.c
../../../../ext/msgpack/factory_class.c: In function ‘Factory_registered_types_internal’:
../../../../ext/msgpack/factory_class.c:189: error: ‘for’ loop initial declarations are only allowed in C99 mode
../../../../ext/msgpack/factory_class.c:189: note: use option -std=c99 or -std=gnu99 to compile your code
At top level:
cc1: warning: unrecognized command line option "-Wno-tautological-compare"
cc1: warning: unrecognized command line option "-Wno-self-assign"
cc1: warning: unrecognized command line option "-Wno-parentheses-equality"
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand"
cc1: warning: unrecognized command line option "-Wno-cast-function-type"
gmake: *** [factory_class.o] Error 1
rake aborted!
Command failed with status (2): [/usr/bin/gmake...]
/var/jenkins_home/.rvm/gems/ruby-2.6.5/gems/rake-compiler-1.2.1/lib/rake/extensiontask.rb:181:in `block (2 levels) in define_compile_tasks'
/var/jenkins_home/.rvm/gems/ruby-2.6.5/gems/rake-compiler-1.2.1/lib/rake/extensiontask.rb:180:in `block in define_compile_tasks'
/var/jenkins_home/.rvm/gems/ruby-2.6.5/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/var/jenkins_home/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `eval'
/var/jenkins_home/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => default => spec => compile => compile:x86_64-linux => compile:msgpack:x86_64-linux => copy:msgpack:x86_64-linux:2.6.5 => tmp/x86_64-linux/msgpack/2.6.5/msgpack.so
(See full trace by running task with --trace)
Hum, right. Static_assert
is C11, so that's a bit complicated.
I converted it to a runtime assert during init and restored the -std=gnu99
flags.
So it should be good now.
Reporting what looks like a unintended loss in compatibility for some old compilers.
When building bundles for compatibility using older platforms the gem fails to compile. There are many workarounds for this including update the build enviournment to bring in more current toolsets, however is seems reasonable to report the impacts.
It looks like #324 introduced syntax not compatible with some gcc old toolchains such as those in Centos6 and RHEL6. This results in 1.7.0 failing to build native objects on some older platforms.
Target toolset is:
Reproduction env: