The taint mechanism was deprecated in Ruby 2.7#7
Conversation
0b18b0a to
bef1114
Compare
|
You could drop the required Ruby version back to 1.8.7 if you liked, with these changes. |
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7 and will remove that in Ruby 3. https://bugs.ruby-lang.org/issues/16131 ruby/ruby#2476 In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related functions in the C-API no longer have an effect (all objects are always considered untainted), and are now warned with deprecation messages. The format of Proc inspect has changed too. Adjusted the affected test. [Fixes kyrylo#6]
Restores the functionality removed in kyrylo#3 in a way that's compatible with the newer Ruby versions.
- Newer Ruby is more picky about datatypes. - Make RBTREE(rbtree) do the type conversion, like RARRAY and such do. - Use Data_Make_Struct instead of doing the same thing that it used to do, because newer Ruby versions do things slightly differently and we want to be compatible with MJIT and compaction GC eventually. - Don't make assumptions about the headers before checking. - Fixed the one test that wasn't entirely 1.8.7 compatible.
| - <<: *unit | ||
| "ruby-2.7": | ||
| docker: | ||
| - image: circleci/ruby:2.7.0 |
There was a problem hiding this comment.
Not sure we want to specify exactly 2.7.0. We used to skip TEENY version, so that if Circle updates their image, we don't need to update the code to test against the latest version.
There was a problem hiding this comment.
Circleci has no 2.7 tag. The only tag they have is 2.7.0. I checked.
|
Woah, this is amazing! 💯 P.S. I don't think Ruby 1.8 compatibility is important anymore but if it's nearly for free, then why not? |
|
We have a tool that is still on 1.8.7, and won't be updated because it's in maintenance mode. If I can do 1.8.7 for free, I don't see why not. We don't need more encouragement to upgrade stuff than we have already. Our code was compatible with 2.7 within a week of release. |
|
Agreed 👍 |
|
For that matter, while this code restores the Hash compatibility, it's only compatible with the 1.8.7 Hash API. I'll look into increasing the API coverage later, especially for the 2.5+ compatible additions. |
|
Sorry, what kind of incompatibility are we talking about? The tests that you added pass on all Rubies. Are we talking about |
|
Yes, it restored that default_proc thing that you deleted in #3; I even copied the test from the previous version. But as for the rest, it's just missing methods that were added in Ruby versions since 2009 :) |
|
Ah, yeah, I understand now. Is this really a big deal, though? It'll always be a losing battle because we would need to keep an eye on the Hash class every time Ruby releases. As for me, I can guarantee that I will forget to check that when Ruby 2.8/3.0 gets released. |
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.
https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476
In Ruby 2.7,
Object#{taint,untaint,trust,untrust}and relatedfunctions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned with deprecation messages.
The format of Proc inspect has changed too. Adjusted the affected test.
[Fixes #6]