Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eregon
Copy link
Contributor

@eregon eregon commented Jun 17, 2018

Hello,

Here is a PR to add TruffleRuby to rvm. It fixes issue #4297.
I tried to keep the logic simple, and to update all relevant places mentioning other implementations.

I tested rvm install truffleruby locally and it seems to work well.

This is a fully open-source version of TruffleRuby, corresponding to a subset of the Community Edition of GraalVM (see http://www.graalvm.org/downloads/)
It includes the native configuration only, not the JVM configuration, so there is no JVM involved.

I have a few questions, which I'll point in the diff, as well as the more general question of should it be considered a "binary ruby", mentioned in #4297 (comment).

Please review carefully, I'm not familiar with the RVM code base and I can't say I have a very good understanding of it (it's quite large and complex).

cc @mpapis @havenwood

eregon added 5 commits June 17, 2018 01:43
* TruffleRuby 1.0.0-rc2 contains an Array as a RbConfig::CONFIG value.
* Uses JRuby as model for the install steps.
* Best effort, I have no way to check if it actually works on so many
  platforms.
.RS 4
TruffleRuby, a high performance implementation of Ruby built on GraalVM\&.
.RE
.PP
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I updated rvm.1.gz with gzip -k rvm.1.

else
__rvm_ruby_string_autodetect
case "${rvm_ruby_string}" in
# Should truffleruby-* be added here?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should truffleruby-* be added here? It's not clear to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need

__rvm_ruby_package_file()
{
# What's this? Is it just for binary rubies? Do we need to change something for TruffleRuby?
# We already set rvm_ruby_package_file in __rvm_select_interpreter_truffleruby().
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this function?
Is it just for binary rubies?
Do we need to change something for TruffleRuby?
Note that we already set rvm_ruby_package_file in __rvm_select_interpreter_truffleruby().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make sense if we install TruffleRuby, prepare binary for it, upload it to RVM binaries and then people download them, I'm not sure this would work with TruffleRuby license, but still could be used for multiserver deploys in private environment.

I guess we can add this in separate PR.

fi
}

# Should we add an entry for truffleruby here? What's the purpose of this function?
Copy link
Contributor Author

@eregon eregon Jun 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add an entry for truffleruby here?
What's the purpose of this function?
Is it for guessing a good name based on the URL/archive given to mount?

rvm mount -r 'https://github.com/oracle/truffleruby/releases/download/vm-1.0.0-rc2/truffleruby-1.0.0-rc2-linux-amd64.tar.gz' seems to choose truffleruby-1.0.0-rc2-linux-amd64 as the name currently.
It's mostly fine, except we might want to drop the -linux-amd64.
OTOH, it would then conflict with the normal name from rvm install truffleruby, which I'm not sure is a good idea.
Maybe it should have some prefix or suffix when rvm mount-ed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the comment in scripts/functions/utility_system

@eregon
Copy link
Contributor Author

eregon commented Jun 17, 2018

I think it would be nice to test installing TruffleRuby with rvm in Travis CI.
Should I just add a variant of rvm-test/long/jruby_comment_test.sh then?

else
__rvm_ruby_string_autodetect
case "${rvm_ruby_string}" in
# Should truffleruby-* be added here?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need

__rvm_ruby_package_file()
{
# What's this? Is it just for binary rubies? Do we need to change something for TruffleRuby?
# We already set rvm_ruby_package_file in __rvm_select_interpreter_truffleruby().
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make sense if we install TruffleRuby, prepare binary for it, upload it to RVM binaries and then people download them, I'm not sure this would work with TruffleRuby license, but still could be used for multiserver deploys in private environment.

I guess we can add this in separate PR.

fi
}

# Should we add an entry for truffleruby here? What's the purpose of this function?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the comment in scripts/functions/utility_system

@mpapis
Copy link
Member

mpapis commented Jun 17, 2018

merged in 70ff3d0

I have left comments about mounting binary rubies, we can address this in separate PR.

@mpapis mpapis closed this Jun 17, 2018
@mpapis
Copy link
Member

mpapis commented Jun 17, 2018

btw. great job!

@eregon
Copy link
Contributor Author

eregon commented Jun 17, 2018

@mpapis Thank you for the review and merging!

@chrisseaton
Copy link

There should be no licence issue with modifying the TruffleRuby distribution by doing things such as precompiling C extensions. The standalone Ruby distribution contains only open-source code under simple licenses (BSD, GPL, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants