ruby-changes:72457
From: Peter <ko1@a...>
Date: Fri, 8 Jul 2022 02:14:58 +0900 (JST)
Subject: [ruby-changes:72457] c8b3bd45cc (master): Fix extconf.rb for OpenSSL 3 without $warnflags
https://git.ruby-lang.org/ruby.git/commit/?id=c8b3bd45cc From c8b3bd45cc3cae93ae701333202416838ee6a00c Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Thu, 7 Jul 2022 09:32:43 -0400 Subject: Fix extconf.rb for OpenSSL 3 without $warnflags On Windows with OpenSSL 3, the gem fails to compile with the following error message: ruby/src/ext/openssl/extconf.rb:188: undefined method \`sub!' for nil:NilClass This is because $warnflags is nil. --- ext/openssl/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index 467f7e7a86..26abfc8b2a 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -185,7 +185,7 @@ have_func("EVP_PKEY_dup") https://github.com/ruby/ruby/blob/trunk/ext/openssl/extconf.rb#L185 Logging::message "=== Checking done. ===\n" if openssl_3 - if $warnflags.sub!(/-W\K(?=deprecated-declarations)/, 'no-') + if $warnflags&.sub!(/-W\K(?=deprecated-declarations)/, 'no-') $warnflags << " -Wno-incompatible-pointer-types-discards-qualifiers" end end -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/