Deprecation notice (rb_check_safe_obj will be removed)
Closed this issue · 10 comments
When the timetrap command is launched, the following message is displayed on stderr:
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.43.0/lib/sequel/adapters/sqlite.rb:109: warning: rb_check_safe_obj will be removed in Ruby 3.0
I run the following version of Ruby (on Archlinux): ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux].
same here. I'm trying to solve it by upgrading the dependency on the sequel
gem but have problems running this project (not a ruby developer)
sequel is an external project, timetrap is, apparently, using a very old version of that.
https://github.com/jeremyevans/sequel/releases
I think updating the version to 4.49.0 might already solve this. Upgrading to 5.x versions is probably possible too, but that might require some changes in the timetrap code that uses Sequel.
The version is set here: https://github.com/samg/timetrap/blob/master/timetrap.gemspec#L28
I'm experiencing the same issue. Unfortunately updating sequel to 4.49.0 results in a whole host of additional deprecation warnings for me about the schema plugin, and doesn't seem to remove the issue with rb_check_safe_obj
either:
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/adapters/sqlite.rb:112: warning: rb_check_safe_obj will be removed in Ruby 3.0
SEQUEL DEPRECATION WARNING: The schema plugin is deprecated and will be removed
in Sequel 5. Switch to defining your schema using Database schema methods
before creating your model classes.
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/plugins/schema.rb:3:in `<top (required)>'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/model/base.rb:1247:in `plugin_module'
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/model/base.rb:746:in `plugin'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/lib/timetrap/models.rb:3:in `<class:Entry>'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/lib/timetrap/models.rb:2:in `<module:Timetrap>'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/lib/timetrap/models.rb:1:in `<top (required)>'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
SEQUEL DEPRECATION WARNING: Calling a dataset filtering method with multiple
arguments or an array where the first argument/element is a string is deprecated
and will be removed in Sequel 5. Use Sequel.lit("sheet = ?", "sheet") to
create an SQL fragment expression and pass that to the dataset filtering method,
or use the auto_literal_strings extension.
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/dataset/query.rb:1296:in `filter_expr'
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/dataset/query.rb:1252:in `add_filter'
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/dataset/query.rb:1036:in `where'
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/dataset/query.rb:221:in `filter'
/path/to/home/.gem/ruby/2.7.0/gems/sequel-4.49.0/lib/sequel/model/plugins.rb:33:in `filter'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/lib/timetrap/helpers.rb:47:in `selected_entries'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/lib/timetrap/cli.rb:367:in `display'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/lib/timetrap/cli.rb:175:in `invoke_command_if_valid'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/lib/timetrap/cli.rb:149:in `invoke'
/path/to/home/.gem/ruby/2.7.0/gems/timetrap-1.15.1/bin/t:3:in `<top (required)>'
And of course, the things mentioned in the deprecation warnings are indeed removed in Sequel 5, so 5.x versions also don't work.
I'm trying to reproduce this issue, but have a hard time getting the exact versions to run.
Can you please give me the ouput of:
ruby --version
bundler --version
bundle list
gem list bundler
It seams from the error logs posted by @gadanidis and @felmab this only happens on Ruby 2.7.0. Anyone seeing this issue on other ruby versions?
Also: what OS/Distro is shipping with 2.7.0 by default, if any?
Can you please give me the ouput of:
ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
bundler --version
Bundler version 2.1.4
bundle list
Could not locate Gemfile or .bundle/ directory
gem list bundler
*** LOCAL GEMS ***
bundler (2.1.4)
Also: what OS/Distro is shipping with 2.7.0 by default, if any?
I'm using the Archlinux distribution. I installed timetrap by running this command: gem install timetrap
.
I've updated all dependencies and fixed the issues from that in #180
This specific warning was caused by an outdated sqlite gem. This has been fixed in that PR.
@samg, is there anything I can do to push this forward?
If you lack time to work on this, I can fully understand (I have several such gems myself...:) ). But I can create a release, from my fork.
I can e.g. build a gem and release a berkes-timetrap version for now. In which I highlight the distinction of the samg-version
being the official and "LTS" and in which the berkes-version
is the intermediate "unstable" version.
Would that work? Or maybe something else?
Thanks for this @berkes! I pushed a new gem version with these changes: https://rubygems.org/gems/timetrap/versions/1.15.2
I'd also be open to getting other folks as maintainers on this project as I don't have much time to work on it these days, and don't need to be a bottleneck for updates and bug fixes.