Skip to content

Commit b00beba

Browse files
committed
Add options to build TruffleRuby from source to test out integration branches before code is merged upstream.
1 parent 3512581 commit b00beba

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
build_package_graalvm() {
2+
platform="$(uname -s)-$(uname -m)"
3+
case $platform in
4+
Linux-x86_64)
5+
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-x64_bin.tar.gz"
6+
;;
7+
Linux-aarch64)
8+
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_linux-aarch64_bin.tar.gz"
9+
;;
10+
Darwin-x86_64)
11+
#use_homebrew_openssl
12+
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_macos-x64_bin.tar.gz"
13+
;;
14+
Darwin-arm64)
15+
GRAALVM_URL="https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_macos-aarch64_bin.tar.gz"
16+
;;
17+
*)
18+
colorize 1 "Unsupported platform: $platform"
19+
return 1
20+
;;
21+
esac
22+
23+
mkdir ../graalvm
24+
curl $GRAALVM_URL | tar xz - -C "../graalvm" --strip-components=1
25+
26+
if is_mac; then
27+
export JAVA_HOME="$PWD/../graalvm/Contents/Home"
28+
else
29+
export JAVA_HOME="$PWD/../graalvm"
30+
fi
31+
}
32+
33+
build_package_jt() {
34+
#unset JAVA_HOME
35+
unset GEM_HOME GEM_PATH
36+
JT_IMPORTS_DONT_ASK=true bin/jt build --env jvm
37+
graalvm=$(bin/jt --use jvm graalvm-home)
38+
mv "$graalvm" "$PREFIX_PATH"
39+
}
40+
41+
if is_mac; then
42+
use_homebrew_openssl
43+
else
44+
install_package "openssl-3.1.2" "https://www.openssl.org/source/openssl-3.1.2.tar.gz#a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539" openssl --if needs_openssl_102_300
45+
fi
46+
47+
install_git "truffleruby+graalvm-integration" "https://github.com/Shopify/truffleruby.git" "master" graalvm jt

rubies/truffleruby-integration

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
build_package_jt() {
2-
unset JAVA_HOME
3-
JT_IMPORTS_DONT_ASK=true ruby tool/jt.rb build --env native --install $PREFIX_PATH
2+
unset JAVA_HOME GEM_HOME GEM_PATH
3+
JT_IMPORTS_DONT_ASK=true bin/jt build --env native
4+
graalvm=$(bin/jt --use native graalvm-home)
5+
mv "$graalvm" "$PREFIX_PATH"
46
}
57

6-
install_git "truffleruby-integration" "https://github.com/Shopify/truffleruby.git" "integration" jt
8+
if is_mac; then
9+
use_homebrew_openssl
10+
else
11+
install_package "openssl-3.1.2" "https://www.openssl.org/source/openssl-3.1.2.tar.gz#a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539" openssl --if needs_openssl_102_300
12+
fi
13+
14+
install_git "truffleruby-integration" "https://github.com/Shopify/truffleruby.git" "master" jt

test/shopify_ruby_definitions/test_ruby_versions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def test_ALL_VERSIONS
1515
end
1616

1717
truffleruby_versions.each do |v|
18+
next if v.include?("integration")
19+
1820
assert_match(/\Atruffleruby(?:\+graalvm)?\-\d+\.\d+\.\d+(?:\-ce)?\z/, v)
1921
end
2022
end

0 commit comments

Comments
 (0)