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

Add a new definition to build TruffleRuby from source. #16

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 47 additions & 0 deletions rubies/truffleruby+graalvm-integration
@@ -0,0 +1,47 @@
build_package_graalvm() {
platform="$(uname -s)-$(uname -m)"
case $platform in
Linux-x86_64)
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-x64_bin.tar.gz"
;;
Linux-aarch64)
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-aarch64_bin.tar.gz"
;;
Darwin-x86_64)
#use_homebrew_openssl
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_macos-x64_bin.tar.gz"
;;
Darwin-arm64)
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_macos-aarch64_bin.tar.gz"
;;
*)
colorize 1 "Unsupported platform: $platform"
return 1
;;
esac

mkdir ../graalvm
curl $GRAALVM_URL | tar xz - -C "../graalvm" --strip-components=1

if is_mac; then
export JAVA_HOME="$PWD/../graalvm/Contents/Home"
else
export JAVA_HOME="$PWD/../graalvm"
fi
}

build_package_jt() {
#unset JAVA_HOME
unset GEM_HOME GEM_PATH
JT_IMPORTS_DONT_ASK=true bin/jt build --env jvm
graalvm=$(bin/jt --use jvm graalvm-home)
mv "$graalvm" "$PREFIX_PATH"
}

if is_mac; then
use_homebrew_openssl
else
install_package "openssl-3.1.3" "https://www.openssl.org/source/openssl-3.1.3.tar.gz#f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6" openssl --if needs_openssl_102_300
fi

install_git "truffleruby+graalvm-integration" "https://github.com/Shopify/truffleruby.git" "master" graalvm jt
14 changes: 14 additions & 0 deletions rubies/truffleruby-integration
@@ -0,0 +1,14 @@
build_package_jt() {
unset JAVA_HOME GEM_HOME GEM_PATH
JT_IMPORTS_DONT_ASK=true bin/jt build --env native
graalvm=$(bin/jt --use native graalvm-home)
mv "$graalvm" "$PREFIX_PATH"
}

if is_mac; then
use_homebrew_openssl
else
install_package "openssl-3.1.3" "https://www.openssl.org/source/openssl-3.1.3.tar.gz#f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6" openssl --if needs_openssl_102_300
fi

install_git "truffleruby-integration" "https://github.com/Shopify/truffleruby.git" "master" jt
2 changes: 2 additions & 0 deletions test/shopify_ruby_definitions/test_ruby_versions.rb
Expand Up @@ -15,6 +15,8 @@ def test_ALL_VERSIONS
end

truffleruby_versions.each do |v|
next if v.include?("integration")

assert_match(/\Atruffleruby(?:\+graalvm)?\-\d+\.\d+\.\d+(?:\-ce)?\z/, v)
end
end
Expand Down