Skip to content

Commit beadd09

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

File tree

3 files changed

+60
-2
lines changed

3 files changed

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

rubies/truffleruby-integration

Lines changed: 10 additions & 2 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 ruby-home)
5+
mv "$graalvm" "$PREFIX_PATH"
46
}
57

8+
if is_mac; then
9+
use_homebrew_openssl
10+
else
11+
install_package "openssl-3.0.14" "https://www.openssl.org/source/openssl-3.0.14.tar.gz#eeca035d4dd4e84fc25846d952da6297484afa0650a6f84c682e39df3a4123ca" openssl --if needs_openssl:1.0.2-3.x.x
12+
fi
13+
614
install_git "truffleruby-integration" "https://github.com/Shopify/truffleruby.git" "integration" 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)?(?:-gftc)?(\-\d+\.\d+\.\d+|-dev)(?:\-ce)?\z/, v)
1921
end
2022
end

0 commit comments

Comments
 (0)