Skip to content

Commit 78ee9d9

Browse files
committed
[GR-32802] Use bin/jt wrapper for tool/jt.rb, so $SYSTEM_RUBY is used to run jt
PullRequest: truffleruby/2832
2 parents 8306ad5 + d7d1e7e commit 78ee9d9

File tree

12 files changed

+30
-25
lines changed

12 files changed

+30
-25
lines changed

.spin/bin/env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export JT_ENV=jvm-ce
66

77
unset JAVA_HOME
88

9+
# Use CRuby to run jt
10+
export SYSTEM_RUBY=$(which ruby)
11+
912
function jt {
10-
ruby "$TRUFFLERUBY_DIR"/tool/jt.rb "$@"
13+
"$TRUFFLERUBY_DIR"/bin/jt "$@"
1114
}

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ local common = (import "common.json");
2828
# All used objects used to compose a build are listed
2929
# where build is defined, there are no other objects in the middle.
3030
local part_definitions = {
31-
local jt = function(args) [["ruby", "tool/jt.rb"] + args],
31+
local jt = function(args) [["bin/jt"] + args],
3232
local mri_path = function(version) "/cm/shared/apps/ruby/" + version + "/bin/ruby",
3333
local mri_version = "2.7.2",
3434

doc/contributor/workflow.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ cd truffleruby
3333
We then use a Ruby script to run most commands.
3434

3535
```bash
36-
ruby tool/jt.rb --help
36+
bin/jt --help
3737
```
3838

3939
Most of us add an alias to our shell profile file so that it can be run with
40-
just `jt`. To allow this to run from any path, add this to your `.bash_profile`:
40+
just `jt`. To allow this to run from any path, add this to your `~/.bash_profile`:
4141

4242
```bash
43-
echo 'alias jt=/path/to/mri/bin/ruby /path/to/truffleruby/tool/jt.rb' >> ~/.bash_profile
43+
export SYSTEM_RUBY=/path/to/mri/bin/ruby
44+
alias jt=/path/to/truffleruby/bin/jt
4445
```
4546

4647
```bash

mx.truffleruby/mx_truffleruby.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def contents(self, result):
118118

119119
def jt(*args):
120120
mx.log("\n$ " + ' '.join(['jt'] + list(args)) + "\n")
121-
mx.run(['ruby', join(root, 'tool/jt.rb')] + list(args))
121+
mx.run([join(root, 'bin/jt')] + list(args))
122122

123123
def build_truffleruby(args):
124124
mx.command_function('sversions')([])
@@ -159,9 +159,9 @@ def ruby_check_heap_dump(input_args, out=None):
159159
raise Exception("heap dump check failed")
160160

161161
def ruby_run_ruby(args):
162-
"""run TruffleRuby (through tool/jt.rb)"""
162+
"""run TruffleRuby (through bin/jt)"""
163163

164-
jt = join(root, 'tool/jt.rb')
164+
jt = join(root, 'bin/jt')
165165
os.execlp(jt, jt, "ruby", *args)
166166

167167
def ruby_run_specs(ruby, args):

test/truffle/common.sh.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ function test_server {
6363

6464
shopt -s expand_aliases
6565
# shellcheck disable=SC2139
66-
alias jt="$repo/tool/jt.rb"
66+
alias jt="$repo/bin/jt"

tool/bisect.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
def jt(cmd)
2020
puts "jt #{cmd}"
21-
cmd = "ruby tool/jt.rb #{cmd}"
21+
cmd = "bin/jt #{cmd}"
2222
output = `#{cmd}`
2323
raise "#{cmd} failed: #{$?}" unless $?.success?
2424
output

tool/hooks/lint-check.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
filename=$(basename "${BASH_SOURCE[0]}")
1212

1313
case "$filename" in
14-
pre-commit) exec tool/jt.rb lint fast HEAD ;;
15-
post-commit) exec tool/jt.rb lint fast HEAD^ ;;
16-
pre-push) exec tool/jt.rb lint fast origin/master ;;
14+
pre-commit) exec bin/jt lint fast HEAD ;;
15+
post-commit) exec bin/jt lint fast HEAD^ ;;
16+
pre-push) exec bin/jt lint fast origin/master ;;
1717
esac

tool/java-coverage/coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ JACOCO_AGENT=$(pwd)/jacoco-agent.jar
1212
JACOCO_LOG=$(pwd)/jacoco.exec
1313

1414
rm -f jacoco.exec
15-
tool/jt.rb test "--vm.javaagent:$JACOCO_AGENT=destfile=$JACOCO_LOG"
15+
bin/jt test "--vm.javaagent:$JACOCO_AGENT=destfile=$JACOCO_LOG"
1616
ant -f tool/java-coverage/build.xml

tool/jt.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919

2020
if RUBY_ENGINE != 'ruby' && !RUBY_DESCRIPTION.include?('Native')
2121
STDERR.puts 'WARNING: jt is not running on MRI or TruffleRuby Native, startup is slow'
22-
STDERR.puts ' Consider using following bash alias to run on MRI.'
23-
STDERR.puts ' `alias jt=/path/to/mri/bin/ruby /path/to/truffleruby/tool/jt.rb`'
22+
STDERR.puts ' Consider adding this to your `~/.bash_profile` to run jt on MRI.'
23+
STDERR.puts ' export SYSTEM_RUBY=/path/to/mri/bin/ruby'
24+
STDERR.puts ' alias jt=/path/to/truffleruby/bin/jt'
2425
end
2526

2627
abort "ERROR: jt requires Ruby 2.3 and above, was #{RUBY_VERSION}" if (RUBY_VERSION.split('.').map(&:to_i) <=> [2, 3, 0]) < 0

tool/make-standalone-distribution.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ set -e
1010
set -x
1111

1212
# Build
13-
tool/jt.rb build --env native
13+
bin/jt build --env native
1414

15-
standalone=$(tool/jt.rb mx --env native standalone-home ruby)
15+
standalone=$(bin/jt mx --env native standalone-home ruby)
1616
release_home="$PWD/mxbuild/truffleruby-standalone"
1717
rm -rf "$release_home"
1818
cp -R "$standalone" "$release_home"
1919
# Clean build results to make sure nothing refers to them while testing
20-
tool/jt.rb mx --env native clean
20+
bin/jt mx --env native clean
2121
rm -rf ../graal/sdk/mxbuild
22-
rm -rf bin lib src
22+
rm -rf exe lib src
2323

2424
# Test the post-install hook
2525
TRUFFLERUBY_RECOMPILE_OPENSSL=true "$release_home/lib/truffle/post_install_hook.sh"
@@ -30,5 +30,5 @@ TRUFFLERUBY_RECOMPILE_OPENSSL=true "$release_home/lib/truffle/post_install_hook.
3030
"$release_home/bin/ruby" -v
3131

3232
# Run all specs
33-
tool/jt.rb -u "$release_home/bin/truffleruby" test :all
34-
tool/jt.rb -u "$release_home/bin/truffleruby" test :next
33+
bin/jt -u "$release_home/bin/truffleruby" test :all
34+
bin/jt -u "$release_home/bin/truffleruby" test :next

0 commit comments

Comments
 (0)