Dne 01. 07. 22 v 17:27 Jun Aruga napsal(a):
Hi,
I tried to build rpms/ruby branches below on the mock build rawhide.
Then I got the build errors below. It's great if someone will take a
look at it or give me advice.
I wanted to rebase Ruby 2.5 from 2.5.8 to 2.5.9 if possible on the
ruby-2.5 branch.
https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-5-9-released/
* stream-ruby-2.7
* stream-ruby-2.6
* ruby-2.5
## stream-ruby-2.7
gcc -shared -o ../../.ext/x86_64-linux/ripper.so ripper.o -L. -L../..
-L. -Wl,-z,relro -Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
-Wl,-dT,/builddir/build/BUILD/ruby-2.7.4/.package_note-ruby-0.3.0-139.fc37.x86_64.ld
-fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-z,relro
-Wl,--as-needed -Wl,-z,now
-specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
-Wl,-dT,/builddir/build/BUILD/ruby-2.7.4/.package_note-ruby-0.3.0-139.fc37.x86_64.ld
-m64 -lruby -lm -lc
make[2]: Leaving directory '/builddir/build/BUILD/ruby-2.7.4/ext/ripper'
make[1]: Leaving directory '/builddir/build/BUILD/ruby-2.7.4'
make: *** [uncommon.mk:296: build-ext] Error 2
I don't think you have included the real error in the log. The real
error is here:
~~~
In file included from ../.././include/ruby.h:33,
from ossl.h:16:
ossl_pkey_rsa.c: In function 'Init_ossl_rsa':
ossl_pkey_rsa.c:877:58: error: 'RSA_SSLV23_PADDING' undeclared (first
use in this function); did you mean 'RSA_NO_PADDING'?
877 | #define DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))
| ^~~~
../.././include/ruby/ruby.h:262:33: note: in definition of macro
'RB_INT2FIX'
262 | #define RB_INT2FIX(i) (((VALUE)(i))<<1 | RUBY_FIXNUM_FLAG)
| ^
../.././include/ruby/ruby.h:1609:20: note: in expansion of macro
'RB_INT2NUM'
1609 | #define INT2NUM(x) RB_INT2NUM(x)
| ^~~~~~~~~~
ossl_pkey_rsa.c:877:50: note: in expansion of macro 'INT2NUM'
877 | #define DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))
| ^~~~~~~
ossl_pkey_rsa.c:942:5: note: in expansion of macro 'DefRSAConst'
942 | DefRSAConst(SSLV23_PADDING);
| ^~~~~~~~~~~
ossl_pkey_rsa.c:877:58: note: each undeclared identifier is reported
only once for each function it appears in
877 | #define DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))
| ^~~~
../.././include/ruby/ruby.h:262:33: note: in definition of macro
'RB_INT2FIX'
262 | #define RB_INT2FIX(i) (((VALUE)(i))<<1 | RUBY_FIXNUM_FLAG)
| ^
../.././include/ruby/ruby.h:1609:20: note: in expansion of macro
'RB_INT2NUM'
1609 | #define INT2NUM(x) RB_INT2NUM(x)
| ^~~~~~~~~~
ossl_pkey_rsa.c:877:50: note: in expansion of macro 'INT2NUM'
877 | #define DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))
| ^~~~~~~
ossl_pkey_rsa.c:942:5: note: in expansion of macro 'DefRSAConst'
942 | DefRSAConst(SSLV23_PADDING);
| ^~~~~~~~~~~
compiling basicsocket.c
gcc -I. -I../../.ext/include/x86_64-linux -I../.././include
-I../.././ext/socket -I../.. -I../../. -DRUBY_EXTCONF_H=\"extconf.h\"
-fPIC -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
-fcf-protection -fPIC -m64 -o basicsocket.o -c basicsocket.c
make[2]: *** [Makefile:313: ossl_pkey_rsa.o] Error 1
make[2]: *** Waiting for unfinished jobs....
~~~
IOW this is OpenSSL 3.x issue. There is no simple way around unless you want
1) Backport the OpenSSL 3.x patches from Ruby 3.0
2) Use some other workaround such as including upstream version of
OpenSSL gem.
I'd suggest against building Ruby 3.0 on F36+
## stream-ruby-2.6
./configure: line 4122: syntax error near unexpected token `fi'
./configure: line 4122: `fi'
## ruby-2.5
./configure: line 4101: syntax error near unexpected token `fi'
./configure: line 4101: `fi'
My guess would be some autotools compatibility or some wrongly applied
patch? I know that at times, we need to change the autotools version.
But this was typically done just in RHEL AFAIR.
Vít