From: "naruse (Yui NARUSE) via ruby-core" Date: 2023-12-07T04:48:42+00:00 Subject: [ruby-core:115623] [Ruby master Feature#19998] Emit deprecation warnings when the old (non-Typed) Data_XXX API is used Issue #19998 has been updated by naruse (Yui NARUSE). Generally deprecation and migration takes development cost for gem developer. Therefore such proposal needs to clearly shows the merit of the removal. ("marked as deprecated" is not such reason) About the strategy of C API deprecation, runtime warning is not a good way because such warning make the gem unusable. As byroot originally says first it should show a build time warning, then just remove the API is reasonable. If the migration really has the benefit, gem owners should fix the usage. ---------------------------------------- Feature #19998: Emit deprecation warnings when the old (non-Typed) Data_XXX API is used https://bugs.ruby-lang.org/issues/19998#change-105555 * Author: byroot (Jean Boussier) * Status: Open * Priority: Normal ---------------------------------------- The replacement API was introduced in Ruby 1.9.2 (2010) [Feature #3064], and the old untyped data API was marked a deprecated in the documentation as of Ruby 2.3.0 (2015): https://github.com/ruby/ruby/commit/98544c372d948717de22afc86d162e411f1fb5f1 However, as of today, no deprecation warning of any sort is emitted when the API is used. Ultimately removing the old untyped API would allow to easily reclaim 8B on every `T_DATA` which could be used by the newly introduced embedded TypedData objects https://github.com/ruby/ruby/pull/7440 Was there any discussions about removing the old API at some point? Could we emit a warning when the API is used? Either verbose or non-verbose, to at least surface the issue to gem owners? This would help drive the effort to fix outdated gems, allowing to eventually remove this old API in the future. Looking at our big applications dependencies, there seem to be a small minority of gems still using the old API: - https://rubygems.org/gems/unf_ext (https://github.com/knu/ruby-unf_ext/pull/72) - https://rubygems.org/gems/rotoscope (https://github.com/Shopify/rotoscope/pull/99) - https://rubygems.org/gems/re2 (https://github.com/mudge/re2/pull/116) - ~~https://rubygems.org/gems/mysql2~~ (use either API to support old rubies) Migrating them over doesn't seem too hard. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/