Skip to content

Commit 111d037

Browse files
committed
Remove --graalvm in tool/docker.rb
* It is no longer supported as that uses `gu`. * Simplify since there is a single mode now, never --jvm + --native in the same artifact.
1 parent 55ff389 commit 111d037

File tree

1 file changed

+16
-58
lines changed

1 file changed

+16
-58
lines changed

tool/docker.rb

+16-58
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ def docker(*args)
9292
case arg
9393
when *docker_distros
9494
distro_name = arg[2..-1]
95-
when '--graalvm'
96-
install_method = :graalvm
97-
graalvm_tarball = args.shift
98-
graalvm_components = args.shift.split(':').map { |path| File.expand_path(path) }
9995
when '--standalone'
10096
install_method = :standalone
10197
standalone_tarball = args.shift
@@ -160,34 +156,7 @@ def docker(*args)
160156
Dir.mkdir docker_dir
161157
end
162158

163-
check_post_install_message = [
164-
"RUN grep 'The Ruby openssl C extension needs to be recompiled on your system to work with the installed libssl' install.log",
165-
"RUN grep '/languages/ruby/lib/truffle/post_install_hook.sh' install.log"
166-
]
167-
168159
case install_method
169-
when :graalvm
170-
FileUtils.copy graalvm_tarball, docker_dir unless print_only
171-
graalvm_tarball = File.basename(graalvm_tarball)
172-
language_dir = graalvm_tarball.include?('java11') ? 'languages' : 'jre/languages'
173-
174-
lines << "COPY #{graalvm_tarball} /test/"
175-
graalvm_base = '/test/graalvm'
176-
lines << "RUN mkdir #{graalvm_base}"
177-
lines << "RUN tar -zxf #{graalvm_tarball} -C #{graalvm_base} --strip-components=1"
178-
graalvm_bin = "#{graalvm_base}/bin"
179-
180-
graalvm_components.each do |component|
181-
FileUtils.copy component, docker_dir unless print_only
182-
component = File.basename(component)
183-
lines << "COPY #{component} /test/"
184-
lines << "RUN #{graalvm_bin}/gu install --file /test/#{component} | tee -a install.log"
185-
end
186-
ruby_base = "#{graalvm_base}/#{language_dir}/ruby"
187-
ruby_bin = graalvm_bin
188-
189-
lines.push(*check_post_install_message)
190-
lines << "RUN #{ruby_base}/lib/truffle/post_install_hook.sh" if run_post_install_hook
191160
when :standalone
192161
FileUtils.copy standalone_tarball, docker_dir unless print_only
193162
standalone_tarball = File.basename(standalone_tarball)
@@ -222,29 +191,23 @@ def docker(*args)
222191

223192
lines << "ENV PATH=#{ruby_bin}:$PATH"
224193

225-
configs = install_method == :graalvm ? %w[--native --jvm] : ['']
226-
227-
configs.each do |c|
228-
lines << "RUN ruby #{c} --version"
229-
end
194+
lines << 'RUN ruby --version'
230195

231196
if basic_test || full_test
232-
configs.each do |c|
233-
lines << "RUN cp -R #{ruby_base}/lib/gems /test/clean-gems"
197+
lines << "RUN cp -R #{ruby_base}/lib/gems /test/clean-gems"
234198

235-
gem_install = "ruby #{c} -S gem install --no-document"
236-
lines << "RUN #{gem_install} color"
237-
lines << "RUN ruby #{c} -rcolor -e 'raise unless defined?(Color)'"
199+
gem_install = 'ruby -S gem install --no-document'
200+
lines << "RUN #{gem_install} color"
201+
lines << "RUN ruby -rcolor -e 'raise unless defined?(Color)'"
238202

239-
lines << "RUN #{gem_install} oily_png"
240-
lines << "RUN ruby #{c} -roily_png -e 'raise unless defined?(OilyPNG::Color)'"
203+
lines << "RUN #{gem_install} oily_png"
204+
lines << "RUN ruby -roily_png -e 'raise unless defined?(OilyPNG::Color)'"
241205

242-
lines << "RUN #{gem_install} unf"
243-
lines << "RUN ruby #{c} -runf -e 'raise unless defined?(UNF)'"
206+
lines << "RUN #{gem_install} unf"
207+
lines << "RUN ruby -runf -e 'raise unless defined?(UNF)'"
244208

245-
lines << "RUN rm -rf #{ruby_base}/lib/gems"
246-
lines << "RUN mv /test/clean-gems #{ruby_base}/lib/gems"
247-
end
209+
lines << "RUN rm -rf #{ruby_base}/lib/gems"
210+
lines << "RUN mv /test/clean-gems #{ruby_base}/lib/gems"
248211
end
249212

250213
if full_test
@@ -254,19 +217,14 @@ def docker(*args)
254217
lines << "COPY --chown=test #{file} #{file}"
255218
end
256219

257-
configs.each do |c|
258-
excludes = %w[fails slow]
220+
excludes = %w[fails slow]
259221

260-
%w[:command_line :security :language :core :tracepoint :library :capi :library_cext :truffle :truffle_capi].each do |set|
261-
t_config = c.empty? ? '' : '-T' + c
262-
t_excludes = excludes.map { |e| '--excl-tag ' + e }.join(' ')
263-
lines << "RUN ruby spec/mspec/bin/mspec -t #{ruby_bin}/ruby #{t_config} #{t_excludes} #{set}"
264-
end
222+
%w[:command_line :security :language :core :tracepoint :library :capi :library_cext :truffle :truffle_capi].each do |set|
223+
t_excludes = excludes.map { |e| '--excl-tag ' + e }.join(' ')
224+
lines << "RUN ruby spec/mspec/bin/mspec -t #{ruby_bin}/ruby #{t_excludes} #{set}"
265225
end
266226

267-
configs.each do |c|
268-
lines << "RUN ruby #{c} --experimental-options --engine.CompilationFailureAction=ExitVM --compiler.TreatPerformanceWarningsAsErrors=all --compiler.IterativePartialEscape --engine.MultiTier=false pe/pe.rb || true"
269-
end
227+
lines << 'RUN ruby --experimental-options --engine.CompilationFailureAction=ExitVM --compiler.TreatPerformanceWarningsAsErrors=all --compiler.IterativePartialEscape --engine.MultiTier=false pe/pe.rb || true'
270228
end
271229

272230
lines << 'CMD bash'

0 commit comments

Comments
 (0)