Skip to content

Commit e50119f

Browse files
committed
[GR-50715] Update dependencies and docker documentation
PullRequest: truffleruby/4183
2 parents 6d71a29 + b40b295 commit e50119f

File tree

5 files changed

+36
-75
lines changed

5 files changed

+36
-75
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Runtime configurations are further detailed in [Deploying TruffleRuby](doc/user/
8787
TruffleRuby is actively tested on the following systems:
8888

8989
* Oracle Linux 7, 8, 9
90-
* Ubuntu 16.04, 18.04, 20.04, 22.04 (all LTS)
90+
* Ubuntu 18.04, 20.04, 22.04 (all LTS)
9191
* Fedora 37, 38
9292
* Debian 10, 11, 12
9393
* macOS 11 (Big Sur)
@@ -102,7 +102,7 @@ environment, for example, by unmounting system filesystems such as `/dev/shm`.
102102

103103
## Dependencies
104104

105-
* [make and gcc](doc/user/installing-llvm.md) for building C and C++ extensions
105+
* [make, gcc and g++](doc/user/installing-llvm.md) for building C and C++ extensions
106106
* [libssl](doc/user/installing-libssl.md) for the `openssl` C extension
107107
* [libyaml](doc/user/installing-libyaml.md) for the `psych` C extension
108108
* [zlib](doc/user/installing-zlib.md) for the `zlib` C extension

doc/contributor/docker.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ Then download the standalone's `.tar.gz` for linux-amd64 (looks like `ruby-stand
2929
The jdk version to use for the standalone is the one in `graal/vm/ce-release-artifacts.json`.
3030
The TruffleRuby commit in that build should correspond to the last commit of the release branch (`release/graal-vm/$VERSION`).
3131

32-
We run all Docker tests, only on the standalone distribution to make it reasonably fast.
32+
We run all Docker tests on the standalone distributions.
3333
This can be done with:
3434
```bash
3535
jt docker test --standalone $PATH_TO_STANDALONE_TAR_GZ --test release/graal-vm/$VERSION
3636
# A concrete example
37-
jt docker test --standalone $PWD/ruby-standalone-svm-java17-linux-amd64-*.tar.gz --test release/graal-vm/23.0
37+
jt docker test --standalone $PWD/ruby-native-standalone-svm-svmee-java22-linux-amd64-*.tar.gz --test release/graal-vm/23.0
3838
```
3939

4040
We typically run them in parallel instead to make it faster, running each of these commands in a different terminal:

doc/user/installing-llvm.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@ The packages below are required to build C and C++ extensions.
1212
### Fedora-based: RHEL, Oracle Linux, etc
1313

1414
```bash
15-
sudo dnf install make gcc
15+
sudo dnf install make gcc gcc-c++
1616
```
1717

18+
`gcc-c++` is only necessary for building C++ extensions.
19+
1820
### Debian-based: Ubuntu, etc
1921

2022
```bash
21-
sudo apt-get install make gcc
23+
sudo apt-get install make gcc g++
2224
```
2325

26+
`g++` is only necessary for building C++ extensions.
27+
2428
### macOS
2529

2630
On macOS, make sure you have installed the command line developer tools from Xcode:

tool/docker-configs.yaml

+9-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ rpm: &rpm
55
openssl: openssl-devel
66
yaml: libyaml-devel
77
cext: gcc make
8+
c++: gcc-c++
89
set-locale:
910
- ENV LANG=en_US.UTF-8
1011

@@ -16,19 +17,21 @@ deb: &deb
1617
openssl: libssl-dev
1718
yaml: libyaml-dev
1819
cext: gcc make
20+
c++: g++
1921
set-locale:
2022
# Uncomment the en_US.UTF-8 line in /etc/locale.gen
2123
- RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
2224
# locale-gen generates locales for all uncommented locales in /etc/locale.gen
2325
- RUN locale-gen
2426
- ENV LANG=en_US.UTF-8
2527

26-
ol7:
27-
base: oraclelinux:7-slim
28-
# --enablerepo needed for libyaml-devel
29-
install: RUN yum install --enablerepo=ol7_optional_latest -y
30-
locale:
31-
<<: *rpm
28+
# Too old g++
29+
#ol7:
30+
# base: oraclelinux:7-slim
31+
# # --enablerepo needed for libyaml-devel
32+
# install: RUN yum install --enablerepo=ol7_optional_latest -y
33+
# locale:
34+
# <<: *rpm
3235

3336
ol8:
3437
base: oraclelinux:8-slim
@@ -56,11 +59,6 @@ fedora38:
5659
locale: glibc-langpack-en
5760
<<: *rpm
5861

59-
ubuntu1604:
60-
base: ubuntu:16.04
61-
install: RUN apt-get update && apt-get install -y
62-
<<: *deb
63-
6462
ubuntu1804:
6563
base: ubuntu:18.04
6664
install: RUN apt-get update && apt-get install -y

tool/docker.rb

+17-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
@@ -129,6 +125,7 @@ def docker(*args)
129125
packages << distro.fetch('openssl')
130126
packages << distro.fetch('yaml')
131127
packages << distro.fetch('cext')
128+
packages << distro.fetch('c++') if full_test
132129

133130
proxy_vars = []
134131
# There is an issue with dnf + proxy in Fedora 34, install packages outside proxy to workaround
@@ -160,34 +157,7 @@ def docker(*args)
160157
Dir.mkdir docker_dir
161158
end
162159

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-
168160
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
191161
when :standalone
192162
FileUtils.copy standalone_tarball, docker_dir unless print_only
193163
standalone_tarball = File.basename(standalone_tarball)
@@ -222,29 +192,23 @@ def docker(*args)
222192

223193
lines << "ENV PATH=#{ruby_bin}:$PATH"
224194

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

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

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)'"
200+
gem_install = 'ruby -S gem install --no-document'
201+
lines << "RUN #{gem_install} color"
202+
lines << "RUN ruby -rcolor -e 'raise unless defined?(Color)'"
238203

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

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

245-
lines << "RUN rm -rf #{ruby_base}/lib/gems"
246-
lines << "RUN mv /test/clean-gems #{ruby_base}/lib/gems"
247-
end
210+
lines << "RUN rm -rf #{ruby_base}/lib/gems"
211+
lines << "RUN mv /test/clean-gems #{ruby_base}/lib/gems"
248212
end
249213

250214
if full_test
@@ -254,19 +218,14 @@ def docker(*args)
254218
lines << "COPY --chown=test #{file} #{file}"
255219
end
256220

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

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
223+
%w[:command_line :security :language :core :tracepoint :library :capi :library_cext :truffle :truffle_capi].each do |set|
224+
t_excludes = excludes.map { |e| '--excl-tag ' + e }.join(' ')
225+
lines << "RUN ruby spec/mspec/bin/mspec -t #{ruby_bin}/ruby #{t_excludes} #{set}"
265226
end
266227

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
228+
lines << 'RUN ruby --experimental-options --engine.CompilationFailureAction=ExitVM --compiler.TreatPerformanceWarningsAsErrors=all --compiler.IterativePartialEscape --engine.MultiTier=false pe/pe.rb || true'
270229
end
271230

272231
lines << 'CMD bash'

0 commit comments

Comments
 (0)