Dne 13. 11. 20 v 3:56 Pavel Valena napsal(a):
----- Original Message -----
> From: "Pavel Valena" <pvalena(a)redhat.com>
> To: "Dan Čermák" <dan.cermak(a)cgc-instruments.com>
> Cc: "Ruby SIG mailing list" <ruby-sig(a)lists.fedoraproject.org>
> Sent: Thursday, November 5, 2020 8:30:25 PM
> Subject: Re: Ruby 3.0
>
> ----- Original Message -----
>> From: "Dan Čermák" <dan.cermak(a)cgc-instruments.com>
>> To: "Vít Ondruch" <vondruch(a)redhat.com>
>> Cc: ruby-sig(a)lists.fedoraproject.org
>> Sent: Thursday, November 5, 2020 4:41:46 PM
>> Subject: Re: Ruby 3.0
>>
>> Hi Vít,
>>
>> Vít Ondruch <vondruch(a)redhat.com> writes:
>>
>>> Hi all,
>>>
>>> Here is once again freshly updated Ruby. The changes are available here:
>>>
>>>
https://src.fedoraproject.org/rpms/ruby/pull-request/70
>>>
>>> and you can find the scratch build in Koji:
>>>
>>>
https://koji.fedoraproject.org/koji/taskinfo?taskID=54978639
>>>
>>> From the notable changes, there is ongoing effort to gemify StdLib.
>>>
>>> As always, please let me know if you encounter any issues with the
>>> package.
It seems I'm still not able to build gems like eventmachine:
I wonder what precisely is "gems like eventmachine"
I think the issue is not in the `-` but in what is missing prior it. If
you see this line, isn't there something strange?
~~~
I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.
-DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -DBUILD_FOR_RUBY
-DHAVE_RB_THREAD_CALL_WITHOUT_GVL -DHAVE_RB_THREAD_FD_SELECT
-DHAVE_TYPE_RB_FDSET_T -DHAVE_RB_WAIT_FOR_SINGLE_FD -DHAVE_RB_TIME_NEW
-DHAVE_INOTIFY_INIT -DHAVE_INOTIFY -DHAVE_WRITEV -DHAVE_PIPE2
-DHAVE_ACCEPT4 -DHAVE_CONST_SOCK_CLOEXEC -DOS_UNIX -DHAVE_EPOLL_CREATE
-DHAVE_EPOLL -DHAVE_CLOCK_GETTIME -DHAVE_CONST_CLOCK_MONOTONIC_RAW
-DHAVE_CONST_CLOCK_MONOTONIC -fPIC -O2 -flto=auto -ffat-lto-objects
-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
-m64 -mtune=generic -fasynchronous-unwind-tables
-fstack-clash-protection -fcf-protection -m64 -o binder.o -c binder.cpp
~~~
For comparison, the same line from last official Fedora build:
~~~
g++ -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.
-DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -DWITH_SSL -DBUILD_FOR_RUBY
-DHAVE_RB_THREAD_CALL_WITHOUT_GVL -DHAVE_RB_THREAD_FD_SELECT
-DHAVE_TYPE_RB_FDSET_T -DHAVE_RB_WAIT_FOR_SINGLE_FD -DHAVE_RB_TIME_NEW
-DHAVE_INOTIFY_INIT -DHAVE_INOTIFY -DHAVE_WRITEV -DHAVE_PIPE2
-DHAVE_ACCEPT4 -DHAVE_CONST_SOCK_CLOEXEC -DOS_UNIX -DHAVE_EPOLL_CREATE
-DHAVE_EPOLL -DHAVE_CLOCK_GETTIME -DHAVE_CONST_CLOCK_MONOTONIC_RAW
-DHAVE_CONST_CLOCK_MONOTONIC -DHAVE_MAKE_PAIR -fPIC -O2 -flto=auto
-ffat-lto-objects -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
-m64 -mtune=generic -fasynchronous-unwind-tables
-fstack-clash-protection -fcf-protection -m64 -o binder.o -c binder.cpp
~~~
If you checked the Makefile, these are the corresponding lines:
~~~
.cpp.o:
$(ECHO) compiling $(<)
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c
$(CSRCFLAG)$<
~~~
And
~~~
CXX =
~~~
So one of the reasons is that we don't have C++ compiler available
during Ruby build and therefore there are not stored the appropriate
values into RbConfig (I mildly remember, that there could have been also
patch to remove the need for C++ or it was reported somewhere, but I
don't remember more details).
The other reason is that somebody changed something somewhere and
apparently something relies on it. The question is what. I would
appreciate if somebody helped me to understand what have changed.
One could also expect, that the extconf.rb + mkmf would include check
for compiler availability and let the compilation fail earlier, but this
is not the case unfortunately. So if somebody could investigate, if
eventmachine and possibly also other package could check on compiler
availability, that could help to prevent non-obvious issues like this.
Checking the mkmf.log, it is also interesting to see, that most of the
configuration check are done using `gcc`, while there also other checks:
~~~
" -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include
-I. -O2 -flto=auto -ffat-lto-objects -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 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
conftest.c -L. -L/usr/lib64 -L. -Wl,-z,relro -Wl,--as-needed
-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
-fstack-protector-strong -rdynamic -Wl,-export-dynamic -m64 -lssl
-lcrypto -lcrypto -lssl -lruby -Wall -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
~~~
They are missing the `gcc` on the beginning and they appears to be
silently ignored. But these corresponds to:
https://github.com/eventmachine/eventmachine/blob/b50c135dfdd4e7b20c8e0b7...
https://github.com/eventmachine/eventmachine/blob/b50c135dfdd4e7b20c8e0b7...
So these are somehow expected to fail, but they should probably fail in
different way.
Vít
( The same gem succeeds all other Fedoras:
https://copr.fedorainfracloud.org/coprs/pvalena/rubygems/build/1767304/ )
Pavel
>> Any idea what is the state of vagrant w.r.t Ruby 3.0? I know upstream
>> struggled quite a bit with 2.7 already.
>>
>>
>> Cheers,
>>
>> Dan
>>
> Hello Dan,
>
> that's a good point!
>
> Let me investigate / check in my vagrant-testing COPR repo, similarly to what
> I've done in rubygems-testing repo (for which I'll run the previuosly failed
> builds as well).
>
>
https://copr.fedorainfracloud.org/coprs/pvalena/rubygems-testing/
>
https://copr.fedorainfracloud.org/coprs/pvalena/vagrant-testing/
>
> I'll write a summary here once some the builds finish (~1week).
>
> Regards,
>
> --
> Pavel Valena
> Software Engineer, Red Hat
> Brno, Czech Republic