----- Original Message -----
From: "Vít Ondruch" <vondruch(a)redhat.com>
To: ruby-sig(a)lists.fedoraproject.org
Sent: Tuesday, January 28, 2020 12:30:04 PM
Subject: Re: rubygem-openssl changes in rawhide
I think it might happen like this:
1) Vagrant loads OpenSSL:
https://github.com/hashicorp/vagrant/blob/master/lib/vagrant.rb#L90
2) Later, net-ssh is required somewhere. When net-ssh is loaded, the
OpenSSH from gem is loaded due to dependencies:
https://src.fedoraproject.org/rpms/rubygem-net-ssh/blob/master/f/rubygem-...
Well, yes, I've missed that it can be loaded twice. Thanks for spotting!
IOW the solution could be to pre-load net-ssh gem. May be we should even
consider to use Bundler to execute the test suite, because that would
pre-load the dependencies from the vagrant.gemspec.
Well, apart from bundler. Wouldn't `require_once`, instead of `require` help in this
case? Not sure how pre-loading helps, but I'll investigate.
I'll also ask gem-openssl and Vagrant upstreams what they think is best.
Regards,
Pavel
Vít
Dne 28. 01. 20 v 12:09 Vít Ondruch napsal(a):
> I think you focus on wrong problem. Of course the code construction in
> OpenSSL is weird:
>
>
> ~~~
>
> # Deprecated.
> #
> # This class is only provided for backwards compatibility.
> # Use OpenSSL::Cipher.
> class Cipher < Cipher; end
> deprecate_constant :Cipher
>
> ~~~
>
>
> But you should probably focus on the beginning of the test suite output:
>
>
> ~~~
>
> /usr/lib64/gems/ruby/openssl-2.1.2/openssl.so: warning: already
> initialized constant OpenSSL::ASN1::CHARACTER_STRING
> /usr/lib64/gems/ruby/openssl-2.1.2/openssl.so: warning: already
> initialized constant OpenSSL::ASN1::BMPSTRING
> /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:18: warning:
> constant OpenSSL::Cipher::Cipher is deprecated
> /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:24: warning:
> already initialized constant OpenSSL::Cipher::AES
> /usr/share/ruby/openssl/cipher.rb:24: warning: previous definition of
> AES was here
> /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:18: warning:
> constant OpenSSL::Cipher::Cipher is deprecated
> /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:24: warning:
> already initialized constant OpenSSL::Cipher::CAST5
> /usr/share/ruby/openssl/cipher.rb:24: warning: previous definition of
> CAST5 was here
> /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:18: warning:
> constant OpenSSL::Cipher::Cipher is deprecated
> /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:24: warning:
> already initialized constant OpenSSL::Cipher::BF
> /usr/share/ruby/openssl/cipher.rb:24: warning: previous definition of BF
> was here
>
> ~~~
>
>
> To me, this seems as if the gemified OpenSSL were mixed with the OpenSSL
> linked into the StdLib and therefore some code is loaded twice and it
> might result in errors as the one you are pointing out.
>
>
> Vít
>
>
> Dne 28. 01. 20 v 11:49 Pavel Valena napsal(a):
>
>> Hello,
>>
>> it seems Ruby 2.7 came with some openssl surprise, because for some reason
>> Vagrant testsuite breaks:
>>
>>
https://copr-be.cloud.fedoraproject.org/results/pvalena/vagrant/fedora-ra...
>>
https://koji.fedoraproject.org/koji/taskinfo?taskID=41097171
>>
>> f.e.:
>> ```
>> An error occurred while loading
>> ./test/unit/plugins/pushes/ftp/push_test.rb.
>> Failure/Error: class Cipher < Cipher; end
>> TypeError:
>> superclass mismatch for class Cipher
>> # /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:64:in
>> `<class:Cipher>'
>> # /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:16:in
>> `<module:OpenSSL>'
>> # /usr/share/gems/gems/openssl-2.1.2/lib/openssl/cipher.rb:15:in `<top
>> (required)>'
>> # /usr/share/gems/gems/openssl-2.1.2/lib/openssl.rb:17:in `<top
>> (required)>'
>> # /usr/share/ruby/net/ftp.rb:23:in `<top (required)>'
>> # ./plugins/pushes/ftp/push.rb:1:in `<top (required)>'
>> # ./test/unit/plugins/pushes/ftp/push_test.rb:4:in `<top (required)>'
>> ```
>>
>> But to my best efforts I wasn't able to trace it to the source.
>>
>> Ideas?
>>
>> Pavel