axiom-types
axiom-types copied to clipboard
Upgrade to concurrent ruby from threadsafe
ThreadSafe is unmaintained and is not compatible with Ruby 2.4.0 because Fixnum was unified into Integer. This leads to loads of deprecation warnings on projects that use gems which depend on ThreadSafe.
This gem is a dependency of virtus
, which is used quite widely. We've got a project which uses a gem which uses Virtus that we're running on 2.4.0 now, and I'm trying to cast a wide net and raise PR's that update this gem chain.
Switching to Concurrent::Hash
from ThreadSafe::Hash
is essentially a drop-in replacement, so that's what I've done here.
I've also had to update the devtools
dependency to a released gem version (As a bundle install
locally in development fails because the locked version isn't present on GH anymore).
As part of that upgrade I've updated the project local rubocop configuration to reflect the existing code, and fixed the reek configuration too.
I noticed Mutant failures while running rake ci
-- I've done the suggested upgrades in 4d6ba63 but I'm not sure why they're good (I don't really understand these changes) so if you're feeling generous some explanation would be amazing :)
Thanks!
Came here to report this, and saw an already open PR. Thank you very much @kalleth! I hope this gets merged soon!
I think the better way forward is to simply implement the thread save cache based on ruby core provided primitives. Rather than pulling another big dependency in for dropping one.
I see your point, although I'd argue concurrent-ruby
is not that big of a dependency as it doesn't pull anything with it and a lot of recent versions of libraries already depend on it (including sucker_punch, sidekiq, rails, rack, most dry-* gems, hanami, activesupport (!!), rom, etc) so if you're doing any kind of web service or app you'll definitely not get away without it, and even for other ruby apps it's rather probable you'll probably pull it in too. :smile: :smile: :smile:
@ivoanjo This argument is good but does not beat having no dependency at all.
Fair enough, I tried 👐 👌
@ivoanjo Its not my final call, its not my gem. Once my clients reach 2.4 (they are not because I'm very defensive until it stabilizes) I'll hit the problem by myself and likely have to come back to this one.