Skip to content

Commit

Permalink
Do not consider deprecated functions as errors for core C extensions
Browse files Browse the repository at this point in the history
* This was problematic for extconf.rb checks as they would think such deprecated functions do not exist.
  Notably it caused the openssl extconf.rb for openssl 3.4.0 to think there is no
  TS_VERIFY_CTS_set_certs() and then openssl_missing.h would redefine it, causing a compilation error.
* CRuby does not set -Werror for core C extensions, maybe we should not either.
  OTOH it is useful to notice new warnings in core C extensions, even more with mx hiding the output by default now.
* Note that changing $warnflags or $defs only affects the Makefile, but not the have_func() checks.
* Fixes #3724
  • Loading branch information
eregon committed Jan 8, 2025
1 parent 2c24089 commit eadfc4f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Bug fixes:

* Fix `Module#name` called inside the `Module#const_added` callback when the module is defined in the top-level scope (#3683, @andrykonchin).
* Fix duplicated calls of a `Module#const_added` callback when a module with nested modules is assigned to a constant (@andrykonchin).
* Support OpenSSL 1.1-3.4 and prefer in order OpenSSL 3.0.x, 3.x and 1.1 (EOL). There was a compilation issue with OpenSSL 3.4 (#3724, @eregon).

Compatibility:

Expand Down
2 changes: 1 addition & 1 deletion lib/cext/include/truffleruby/truffleruby-abi-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
// $RUBY_VERSION must be the same as TruffleRuby.LANGUAGE_VERSION.
// $ABI_NUMBER starts at 1 and is incremented for every ABI-incompatible change.

#define TRUFFLERUBY_ABI_VERSION "3.3.5.7"
#define TRUFFLERUBY_ABI_VERSION "3.3.5.8"

#endif
3 changes: 3 additions & 0 deletions lib/truffle/rbconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ module RbConfig

warnflags << '-Wundef' # Warn for undefined preprocessor macros for core C extensions
warnflags << '-Werror' # Make sure there are no warnings in core C extensions
# If there are deprecations in core C extensions, do not error for them.
# This would be problematic for extconf.rb checks as they would think such deprecated functions do not exist.
warnflags << '-Wno-error=deprecated-declarations'
else
libtruffleruby = "#{cext_dir}/libtruffleruby.#{soext}"
libtrufflerubytrampoline = "#{cext_dir}/libtrufflerubytrampoline.#{soext}"
Expand Down
5 changes: 0 additions & 5 deletions src/main/c/openssl/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

require "mkmf"

if defined?(::TruffleRuby)
# Needed with libssl 3.0.0 and -Werror from building core C extensions
$warnflags += ' -Wno-deprecated-declarations'
end

ssl_dirs = nil
if defined?(::TruffleRuby)
# Always respect the openssl prefix chosen by truffle/openssl-prefix
Expand Down

0 comments on commit eadfc4f

Please sign in to comment.