Skip to content

Commit bf1b40d

Browse files
committed
[GR-48237] Backports for 23.1 batch 3
PullRequest: truffleruby/3992
2 parents 3a9693b + eed858a commit bf1b40d

File tree

26 files changed

+109
-103
lines changed

26 files changed

+109
-103
lines changed

mx.truffleruby/native

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DYNAMIC_IMPORTS=/tools,/compiler,/substratevm
33
COMPONENTS=TruffleRuby,suite:tools,GraalVM compiler,SubstrateVM,Truffle Macro
44
NATIVE_IMAGES=suite:sulong,lib:rubyvm
55
EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:BuildOutputJSONFile=native-image-build-rubyvm.json rubyvm:-H:-UnlockExperimentalVMOptions
6+
GENERATE_DEBUGINFO=false
67
# To also create the standalone
78
INSTALLABLES=TruffleRuby
89
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES

mx.truffleruby/native-ee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DYNAMIC_IMPORTS=/tools,/truffleruby-enterprise,/graal-enterprise,/substratevm-en
33
COMPONENTS=TruffleRuby,suite:tools,GraalVM enterprise compiler,Truffle enterprise,SubstrateVM Enterprise,Truffle Macro Enterprise,suite:substratevm-enterprise-gcs
44
NATIVE_IMAGES=suite:sulong,lib:rubyvm
55
EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:BuildOutputJSONFile=native-image-build-rubyvm.json rubyvm:-H:-UnlockExperimentalVMOptions
6+
GENERATE_DEBUGINFO=false
67
# To also create the standalone
78
INSTALLABLES=TruffleRuby
89
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES

mx.truffleruby/native-ee-aux

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DYNAMIC_IMPORTS=/tools,/truffleruby-enterprise,/graal-enterprise,/substratevm-en
33
COMPONENTS=TruffleRuby,suite:tools,GraalVM enterprise compiler,Truffle enterprise,SubstrateVM Enterprise,Truffle Macro Enterprise
44
NATIVE_IMAGES=suite:sulong,lib:rubyvm
55
EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:BuildOutputJSONFile=native-image-build-rubyvm.json rubyvm:-H:-UnlockExperimentalVMOptions rubyvm:-H:+AuxiliaryEngineCache rubyvm:-H:ReservedAuxiliaryImageBytes=1073741824
6+
GENERATE_DEBUGINFO=false
67
NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE=true
78
# To also create the standalone
89
INSTALLABLES=TruffleRuby

mx.truffleruby/native-host-inlining

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DYNAMIC_IMPORTS=/tools,/compiler,/substratevm
33
COMPONENTS=TruffleRuby,suite:tools,GraalVM compiler,SubstrateVM,Truffle Macro
44
NATIVE_IMAGES=lib:rubyvm
55
EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:BuildOutputJSONFile=native-image-build-rubyvm.json rubyvm:-H:Log=HostInliningPhase,~CanonicalizerPhase,~GraphBuilderPhase rubyvm:-H:+TruffleHostInliningPrintExplored rubyvm:-H:-UnlockExperimentalVMOptions rubyvm:-Dgraal.LogFile=host-inlining.txt
6+
GENERATE_DEBUGINFO=false
67
# To also create the standalone
78
INSTALLABLES=TruffleRuby
89
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES

mx.truffleruby/suite.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
"requires": ["java.management"],
165165
"dependencies": [
166166
"truffleruby:TRUFFLERUBY-ANNOTATIONS",
167-
"sdk:GRAAL_SDK",
167+
"sdk:POLYGLOT",
168168
],
169169
"annotationProcessors": [
170170
"TRUFFLERUBY-PROCESSOR",
@@ -207,20 +207,6 @@
207207
"license": ["EPL-2.0"],
208208
},
209209

210-
"org.truffleruby.services": {
211-
"dir": "src/services",
212-
"sourceDirs": ["java"],
213-
"requires": ["java.scripting"],
214-
"dependencies": [
215-
"sdk:GRAAL_SDK",
216-
],
217-
"jacoco": "include",
218-
"javaCompliance": "17+",
219-
"checkstyle": "org.truffleruby",
220-
"workingSets": "TruffleRuby",
221-
"license": ["EPL-2.0"],
222-
},
223-
224210
"org.truffleruby.rubysignal": {
225211
"dir": "src/main/c/rubysignal",
226212
"native": "shared_lib",
@@ -325,7 +311,7 @@
325311
"dependencies": [
326312
"truffleruby:TRUFFLERUBY-ANNOTATIONS",
327313
"truffleruby:TRUFFLERUBY-SHARED",
328-
"sdk:GRAAL_SDK",
314+
"sdk:POLYGLOT",
329315
"sdk:LAUNCHER_COMMON",
330316
],
331317
"jacoco": "include",
@@ -468,7 +454,7 @@
468454
],
469455
"distDependencies": [
470456
"truffleruby:TRUFFLERUBY-ANNOTATIONS",
471-
"sdk:GRAAL_SDK",
457+
"sdk:POLYGLOT",
472458
],
473459
"description": "TruffleRuby Shared constants and predicates",
474460
"license": ["EPL-2.0"],
@@ -578,7 +564,7 @@
578564
"distDependencies": [
579565
"truffleruby:TRUFFLERUBY-ANNOTATIONS",
580566
"truffleruby:TRUFFLERUBY-SHARED",
581-
"sdk:GRAAL_SDK",
567+
"sdk:POLYGLOT",
582568
"sdk:LAUNCHER_COMMON",
583569
],
584570
"description": "TruffleRuby Launcher",

spec/mspec/tool/tag_from_output.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Adds tags based on error and failures output (e.g., from a CI log),
44
# without running any spec code.
55

6+
tag = ENV["TAG"] || "fails"
7+
68
tags_dir = %w[
79
spec/tags
810
spec/tags/ruby
@@ -54,7 +56,7 @@
5456
dir = File.dirname(tags_file)
5557
Dir.mkdir(dir) unless Dir.exist?(dir)
5658

57-
tag_line = "fails:#{description}"
59+
tag_line = "#{tag}:#{description}"
5860
lines = File.exist?(tags_file) ? File.readlines(tags_file, chomp: true) : []
5961
unless lines.include?(tag_line)
6062
puts tags_file

spec/ruby/command_line/dash_a_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets()" do
9-
ruby_exe("puts $F.last", options: "-n -a", escape: true,
9+
ruby_exe("puts $F.last", options: "-n -a",
1010
args: " < #{@names}").should ==
1111
"jones\nfield\ngrey\n"
1212
end
1313

1414
it "sets $-a" do
15-
ruby_exe("puts $-a", options: "-n -a", escape: true,
15+
ruby_exe("puts $-a", options: "-n -a",
1616
args: " < #{@names}").should ==
1717
"true\ntrue\ntrue\n"
1818
end

spec/ruby/command_line/dash_l_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
end
77

88
it "chomps lines with default separator" do
9-
ruby_exe('puts $_.end_with?("\n")', options: "-n -l", escape: true,
9+
ruby_exe('puts $_.end_with?("\n")', options: "-n -l",
1010
args: " < #{@names}").should ==
1111
"false\nfalse\nfalse\n"
1212
end
1313

1414
it "chomps last line based on $/" do
15-
ruby_exe('BEGIN { $/ = "ones\n" }; puts $_', options: "-W0 -n -l", escape: true,
15+
ruby_exe('BEGIN { $/ = "ones\n" }; puts $_', options: "-W0 -n -l",
1616
args: " < #{@names}").should ==
1717
"alice j\nbob field\njames grey\n"
1818
end
1919

2020
it "sets $\\ to the value of $/" do
21-
ruby_exe("puts $\\ == $/", options: "-W0 -n -l", escape: true,
21+
ruby_exe("puts $\\ == $/", options: "-W0 -n -l",
2222
args: " < #{@names}").should ==
2323
"true\ntrue\ntrue\n"
2424
end
2525

2626
it "sets $-l" do
27-
ruby_exe("puts $-l", options: "-n -l", escape: true,
27+
ruby_exe("puts $-l", options: "-n -l",
2828
args: " < #{@names}").should ==
2929
"true\ntrue\ntrue\n"
3030
end

spec/ruby/command_line/dash_n_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets()" do
9-
ruby_exe("puts $_", options: "-n", escape: true,
9+
ruby_exe("puts $_", options: "-n",
1010
args: " < #{@names}").should ==
1111
"alice\nbob\njames\n"
1212
end
1313

1414
it "only evaluates BEGIN blocks once" do
15-
ruby_exe("BEGIN { puts \"hi\" }; puts $_", options: "-n", escape: true,
15+
ruby_exe("BEGIN { puts \"hi\" }; puts $_", options: "-n",
1616
args: " < #{@names}").should ==
1717
"hi\nalice\nbob\njames\n"
1818
end
1919

2020
it "only evaluates END blocks once" do
21-
ruby_exe("puts $_; END {puts \"bye\"}", options: "-n", escape: true,
21+
ruby_exe("puts $_; END {puts \"bye\"}", options: "-n",
2222
args: " < #{@names}").should ==
2323
"alice\nbob\njames\nbye\n"
2424
end
@@ -29,7 +29,7 @@
2929
$total += 1
3030
END { puts $total }
3131
script
32-
ruby_exe(script, options: "-n", escape: true,
32+
ruby_exe(script, options: "-n",
3333
args: " < #{@names}").should ==
3434
"3\n"
3535
end

spec/ruby/command_line/dash_p_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets() and prints $_" do
9-
ruby_exe("$_ = $_.upcase", options: "-p", escape: true,
9+
ruby_exe("$_ = $_.upcase", options: "-p",
1010
args: " < #{@names}").should ==
1111
"ALICE\nBOB\nJAMES\n"
1212
end
1313

1414
it "sets $-p" do
15-
ruby_exe("$_ = $-p", options: "-p", escape: true,
15+
ruby_exe("$_ = $-p", options: "-p",
1616
args: " < #{@names}").should ==
1717
"truetruetrue"
1818
end

spec/ruby/command_line/dash_upper_f_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
end
77

88
it "specifies the field separator pattern for -a" do
9-
ruby_exe("puts $F[0]", options: "-naF:", escape: true,
9+
ruby_exe("puts $F[0]", options: "-naF:",
1010
args: " < #{@passwd}").should ==
1111
"nobody\nroot\ndaemon\n"
1212
end

spec/ruby/command_line/rubyopt_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
it "adds the -I path to $LOAD_PATH" do
1313
ENV["RUBYOPT"] = "-Ioptrubyspecincl"
14-
result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)", escape: true)
14+
result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)")
1515
result.chomp[-15..-1].should == "optrubyspecincl"
1616
end
1717

1818
it "sets $DEBUG to true for '-d'" do
1919
ENV["RUBYOPT"] = '-d'
2020
command = %[puts "value of $DEBUG is \#{$DEBUG}"]
21-
result = ruby_exe(command, escape: true, args: "2>&1")
21+
result = ruby_exe(command, args: "2>&1")
2222
result.should =~ /value of \$DEBUG is true/
2323
end
2424

@@ -36,27 +36,27 @@
3636

3737
it "sets $VERBOSE to true for '-w'" do
3838
ENV["RUBYOPT"] = '-w'
39-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
39+
ruby_exe("p $VERBOSE").chomp.should == "true"
4040
end
4141

4242
it "sets $VERBOSE to true for '-W'" do
4343
ENV["RUBYOPT"] = '-W'
44-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
44+
ruby_exe("p $VERBOSE").chomp.should == "true"
4545
end
4646

4747
it "sets $VERBOSE to nil for '-W0'" do
4848
ENV["RUBYOPT"] = '-W0'
49-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "nil"
49+
ruby_exe("p $VERBOSE").chomp.should == "nil"
5050
end
5151

5252
it "sets $VERBOSE to false for '-W1'" do
5353
ENV["RUBYOPT"] = '-W1'
54-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "false"
54+
ruby_exe("p $VERBOSE").chomp.should == "false"
5555
end
5656

5757
it "sets $VERBOSE to true for '-W2'" do
5858
ENV["RUBYOPT"] = '-W2'
59-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
59+
ruby_exe("p $VERBOSE").chomp.should == "true"
6060
end
6161

6262
it "suppresses deprecation warnings for '-W:no-deprecated'" do

spec/ruby/core/argf/readpartial_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
print ARGF.readpartial(#{@stdin.size})
7070
ARGF.readpartial(1) rescue print $!.class
7171
STR
72-
stdin = ruby_exe(ruby_str, args: "< #{@stdin_name}", escape: true)
72+
stdin = ruby_exe(ruby_str, args: "< #{@stdin_name}")
7373
stdin.should == @stdin + "EOFError"
7474
end
7575
end

spec/ruby/core/file/flock_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
it "returns false if trying to lock an exclusively locked file" do
3131
@file.flock File::LOCK_EX
3232

33-
ruby_exe(<<-END_OF_CODE, escape: true).should == "false"
33+
ruby_exe(<<-END_OF_CODE).should == "false"
3434
File.open('#{@name}', "w") do |f2|
3535
print f2.flock(File::LOCK_EX | File::LOCK_NB).to_s
3636
end
@@ -40,7 +40,7 @@
4040
it "blocks if trying to lock an exclusively locked file" do
4141
@file.flock File::LOCK_EX
4242

43-
out = ruby_exe(<<-END_OF_CODE, escape: true)
43+
out = ruby_exe(<<-END_OF_CODE)
4444
running = false
4545
4646
t = Thread.new do

spec/ruby/core/kernel/exec_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
end
88

99
it "runs the specified command, replacing current process" do
10-
ruby_exe('exec "echo hello"; puts "fail"', escape: true).should == "hello\n"
10+
ruby_exe('exec "echo hello"; puts "fail"').should == "hello\n"
1111
end
1212
end
1313

1414
describe "Kernel.exec" do
1515
it "runs the specified command, replacing current process" do
16-
ruby_exe('Kernel.exec "echo hello"; puts "fail"', escape: true).should == "hello\n"
16+
ruby_exe('Kernel.exec "echo hello"; puts "fail"').should == "hello\n"
1717
end
1818
end

0 commit comments

Comments
 (0)