Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation notice (rb_check_safe_obj will be removed) #178

Closed
felmab opened this issue Jan 16, 2020 · 10 comments
Closed

Deprecation notice (rb_check_safe_obj will be removed) #178

felmab opened this issue Jan 16, 2020 · 10 comments

Comments

@felmab
Copy link

felmab commented Jan 16, 2020

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].

@categulario
Copy link
Collaborator

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)

@berkes
Copy link
Contributor

berkes commented Mar 3, 2020

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

@gadanidis
Copy link

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.

@berkes
Copy link
Contributor

berkes commented Mar 6, 2020

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?

@felmab
Copy link
Author

felmab commented Mar 6, 2020

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.

@categulario
Copy link
Collaborator

categulario commented Mar 6, 2020 via email

@berkes
Copy link
Contributor

berkes commented Mar 9, 2020

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.

@berkes
Copy link
Contributor

berkes commented Mar 16, 2020

@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?

@samg samg closed this as completed in 19111e3 Mar 17, 2020
@samg
Copy link
Owner

samg commented Mar 17, 2020

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.

@felmab
Copy link
Author

felmab commented Mar 17, 2020

Thanks @samg and @berkes. I've just tested the new version and it works great!

dechimp pushed a commit to dechimp/timetrap that referenced this issue Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants