Skip to content

Commit 53101f2

Browse files
committed
Merge pull request #159 in G/truffleruby from post-install-message to master
* commit '86a809d9b64937ae3228ea408fd647fba321661b': Test that the post-install message is printed in Docker tests using gu Fix be_close to accept the actual value if it is equal to expected + or - delta Update to latest Truffle Add a post-install message about the OpenSSL extension when installing with `gu`
2 parents e732478 + 86a809d commit 53101f2

File tree

5 files changed

+24
-8
lines changed

5 files changed

+24
-8
lines changed

mx.truffleruby/mx_truffleruby.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ def ruby_testdownstream_sulong(args):
346346
links=['bin/<exe:ruby>'],
347347
)
348348
],
349+
post_install_msg="""
350+
IMPORTANT NOTE:
351+
---------------
352+
The Ruby openssl C extension needs to be recompiled on your system to work with the installed libssl.
353+
Make sure headers for libssl are installed, see https://github.com/oracle/truffleruby/blob/master/doc/user/installing-libssl.md for details.
354+
Then run the following command:
355+
${graalvm_home}/jre/languages/ruby/lib/truffle/post_install_hook.sh""",
349356
))
350357

351358
mx.update_commands(_suite, {

mx.truffleruby/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# We want tools to be reliably available with TruffleRuby, even with "mx build", so this is a static import.
99
"name": "tools",
1010
"subdir": True,
11-
"version": "ff6b87789b5990692333bf1fe4f9a6cabbff0bbd",
11+
"version": "822da2f5e092931e236885be3cc6e9cac35b5c7a",
1212
"urls": [
1313
{"url": "https://github.com/graalvm/graal.git", "kind": "git"},
1414
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},

spec/mspec/lib/mspec/matchers/be_close.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def initialize(expected, tolerance)
88

99
def matches?(actual)
1010
@actual = actual
11-
(@actual - @expected).abs < @tolerance
11+
(@actual - @expected).abs <= @tolerance
1212
end
1313

1414
def failure_message

spec/mspec/spec/matchers/be_close_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
BeCloseMatcher.new(5.0, 0.5).matches?(4.51).should == true
1717
end
1818

19-
it "does not match when actual == (expected + tolerance)" do
20-
BeCloseMatcher.new(5.0, 0.5).matches?(5.5).should == false
19+
it "matches when actual == (expected + tolerance)" do
20+
BeCloseMatcher.new(5.0, 0.5).matches?(5.5).should == true
21+
BeCloseMatcher.new(3, 2).matches?(5).should == true
2122
end
2223

23-
it "does not match when actual == (expected - tolerance)" do
24-
BeCloseMatcher.new(5.0, 0.5).matches?(4.5).should == false
24+
it "matches when actual == (expected - tolerance)" do
25+
BeCloseMatcher.new(5.0, 0.5).matches?(4.5).should == true
26+
BeCloseMatcher.new(3, 2).matches?(1).should == true
2527
end
2628

2729
it "does not match when actual < (expected - tolerance)" do

tool/jt.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,12 +1996,18 @@ def dockerfile(*args)
19961996
graalvm_version = graalvm_version.gsub(/-b\d+\Z/, '')
19971997
end
19981998

1999+
check_post_install_message = [
2000+
"RUN grep 'The Ruby openssl C extension needs to be recompiled on your system to work with the installed libssl' install.log",
2001+
"RUN grep '/jre/languages/ruby/lib/truffle/post_install_hook.sh' install.log"
2002+
]
2003+
19992004
case install_method
20002005
when :public
20012006
lines.push "RUN curl -OL https://github.com/oracle/graal/releases/download/vm-#{public_version}/graalvm-ce-#{public_version}-linux-amd64.tar.gz"
20022007
lines.push "RUN tar -zxf graalvm-ce-#{public_version}-linux-amd64.tar.gz"
20032008
lines.push "ENV D_GRAALVM_BASE=/test/graalvm-ce-#{public_version}"
2004-
lines.push "RUN $D_GRAALVM_BASE/bin/gu install org.graalvm.ruby"
2009+
lines.push "RUN $D_GRAALVM_BASE/bin/gu install org.graalvm.ruby | tee install.log"
2010+
lines.push(*check_post_install_message)
20052011
lines.push "ENV D_RUBY_BASE=$D_GRAALVM_BASE/jre/languages/ruby"
20062012
lines.push "ENV D_RUBY_BIN=$D_GRAALVM_BASE/bin"
20072013
lines.push "RUN PATH=$D_RUBY_BIN:$PATH $D_RUBY_BASE/lib/truffle/post_install_hook.sh" if run_post_install_hook
@@ -2014,7 +2020,8 @@ def dockerfile(*args)
20142020
lines.push "COPY #{graalvm_component} /test/"
20152021
lines.push "RUN tar -zxf #{graalvm_tarball}"
20162022
lines.push "ENV D_GRAALVM_BASE=/test/graalvm-#{graalvm_version}"
2017-
lines.push "RUN $D_GRAALVM_BASE/bin/gu install --file /test/#{graalvm_component}"
2023+
lines.push "RUN $D_GRAALVM_BASE/bin/gu install --file /test/#{graalvm_component} | tee install.log"
2024+
lines.push(*check_post_install_message)
20182025
lines.push "ENV D_RUBY_BASE=$D_GRAALVM_BASE/jre/languages/ruby"
20192026
lines.push "ENV D_RUBY_BIN=$D_GRAALVM_BASE/bin"
20202027
lines.push "RUN PATH=$D_RUBY_BIN:$PATH $D_RUBY_BASE/lib/truffle/post_install_hook.sh" if run_post_install_hook

0 commit comments

Comments
 (0)