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
Replace therubyracer with mini_racer #1961
Conversation
I haven't been following this closely. Would you mind summarizing the main motivation(s) for moving away from therubyracer? |
From my perspective, my biggest motivation is the alpine issue with therubyracer currently. mini_racer has a smaller bind footprint to libv8, so it can be updated to modern versions more easily. Which may come with performance/etc benefits (i'm not too well versed on this area) I was thinking if it wasn't too hard to support both, maybe there would be some benefit to that. Originally I was thinking execjs might serve as a higher level wrapper to support that, but as @dsander pointed out in #1959 , due to the functions this wouldn't be possible. |
It will definitely be faster rubyracers libv8 version is pretty old (3.16 vs 5.3). I am also hoping for better arm support due to the newer libv8 (#1586). |
How hard would it be to write our own little JS lib helper abstraction? That would check which lib was installed (or use an env var) and then expose the appropriate functions that we use.
|
@alias1 Not very I suppose, what would be the benefit of that? |
I guess I always think in terms of flexibility/options, rather than rigid decisions. So it would be providing the option of using either therubyracer or mini_racer (and perhaps setting a framework for supporting other options that may be available in that sense). It was the original reason I was thinking execjs would make a good choice. I'm not really strongly set on it though, if you prefer to go the convention over configuration, 'best choice' approach. |
Should have checked that earlier, I think we should only pursue this further if it at least solves the ARM 64biy or alpine issues (ideally both). |
While I haven't directly tested it, i'm at least 90% sure this will work for the alpine issue. From my reading, My thought process at the moment would be to create a small wrapper class that holds the appropriate context, and exposes If we designed the API properly, it could almost be a source compatible drop-in, at least for our use case. |
Ah, got it. As long as mini_racer works for the JS Agent and on our supported platforms, it seems fine to me. It sucks that the_ruby_racer isn't being well supported. |
My hesitation is not due to the small wrapper it would require, but more about the needed |
@cantino There is some work on upgrading therubyracer to v4.5, but from the little look i've had it seems like it may still be slow going. @dsander Haha, yeah, that's fair.. Just increases the surface area for potential issues I suppose :p
Do we know much around usage/etc. I guess we wouldn't have stats at all.. (on a sidenote, I wonder if there is some benefit to having a 'send basic stats' option on install.. mostly gathering OS/ruby vers/etc to help when deciding around platforms to continue supporting) Would dropping support for debian 7 be a major hit to users? Could we add both runtimes as an interim 'fallback' measure until LTS ends in 2018, then move it entirely to |
I do think having stats would be nice. I wouldn't want to just add Google Analytics, though, since people like their privacy. Not sure what the best way to add stats in a privacy-respecting way would be. |
Having usage statistics would be great, but I don't know how many users would agree to send them. Unsure about dropping Debian 7 support, as a user I would be very annoyed if a software dropped support for a OS that is still in LTS. |
Scaleway release 64bit ARM servers today and I tested the installation of
|
Hrmm, that sucks :( |
The latest version of |
JFYI, Ubuntu 12.04 LTS finally reached its EOL last April. Yay! |
Switching to mini_racer would probably be the unblock I need to get those alpine docker containers finished off too. |
What is the status of this PR? It would be great to get a more modern version of JS into Huginn. |
We should be able to merge this soon. LTS support for debian 7 ended in may, hopefully everybody upgrades their servers by now 😄 |
Is there any concrete timeline? |
Not really, but any testing of this branch or the |
I'll run the huginnbuilder branch :) |
I've been running huginnbuilder/huginn:pr-1961 for a few days using my personal Huginn and it seems to work fine. The only issue for me is that the latest version of libv8 is 6.7 which supports older Ecmascript and not ES6, but I guess there is not much we can do there. |
We also need to drop support for Ruby 2.2 on top of Debian 7 because it's not supported by the latest |
Updated the PR description, I think we should merge this soon (Debian 7 and Ruby 2.2 hit their EOL a long time ago). |
@@ -374,7 +374,7 @@ GEM | |||
actionmailer (>= 3.2) | |||
letter_opener (~> 1.0) | |||
railties (>= 3.2) | |||
libv8 (3.16.14.19) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we finally dumping this ancient version? So great! 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we could even go better than that.. mini_racer supports 7.3.x as of this PR
And this looks like they do (or soon will) support 7.4.x
Though this lib is still 7.3.x
With the latest v8 version currently being 7.7.x
Initially this PR was created to improve compatibility on ARM(64) devices. Sadly this did not work out, the newer libv8 version still has issues compiling on arm devices.
For all other users the change is a improvement,
mini_racer
is a lot faster because the libv8 version is newer.It also fixes a massive memory leak reported in #2512.
#1959
Might help with #1919