Skip to content

Commit df6066a

Browse files
[GR-36794] Solving a problem with with netty library initialization on renaissance 14.
PullRequest: graal/10985
2 parents 72980c9 + 12562de commit df6066a

File tree

1 file changed

+39
-15
lines changed

1 file changed

+39
-15
lines changed

substratevm/mx.substratevm/mx_substratevm_benchmark.py

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,39 +60,61 @@ def list_jars(path):
6060
return jars
6161

6262

63+
force_buildtime_init_slf4j_1_7_73 = '--initialize-at-build-time=org.slf4j,org.apache.log4j'
64+
force_runtime_init_netty_4_1_72 = '--initialize-at-run-time=io.netty.channel.unix,io.netty.channel.epoll,io.netty.handler.codec.http2,io.netty.handler.ssl,io.netty.internal.tcnative,io.netty.util.internal.logging.Log4JLogger'
6365
_RENAISSANCE_EXTRA_IMAGE_BUILD_ARGS = {
6466
'als' : [
65-
'--allow-incomplete-classpath',
6667
'--report-unsupported-elements-at-runtime',
67-
'--initialize-at-build-time=org.slf4j,org.apache.log4j', # mis-initialized from netty
68-
'--initialize-at-run-time=io.netty.channel.unix.IovArray,io.netty.channel.epoll.EpollEventLoop,io.netty.channel.unix.Errors,io.netty.channel.unix.Socket,io.netty.channel.unix.Limits'
68+
force_buildtime_init_slf4j_1_7_73,
69+
force_runtime_init_netty_4_1_72
6970
],
7071
'chi-square' : [
71-
'--allow-incomplete-classpath',
7272
'--report-unsupported-elements-at-runtime',
73+
force_buildtime_init_slf4j_1_7_73,
74+
force_runtime_init_netty_4_1_72
75+
],
76+
'finagle-chirper' : [
77+
force_buildtime_init_slf4j_1_7_73,
78+
force_runtime_init_netty_4_1_72
7379
],
7480
'finagle-http' : [
75-
'--allow-incomplete-classpath'
81+
force_buildtime_init_slf4j_1_7_73,
82+
force_runtime_init_netty_4_1_72
7683
],
7784
'log-regression' : [
78-
'--allow-incomplete-classpath',
7985
'--report-unsupported-elements-at-runtime',
86+
force_buildtime_init_slf4j_1_7_73,
87+
force_runtime_init_netty_4_1_72
8088
],
8189
'movie-lens' : [
82-
'--allow-incomplete-classpath',
8390
'--report-unsupported-elements-at-runtime',
91+
force_buildtime_init_slf4j_1_7_73,
92+
force_runtime_init_netty_4_1_72
8493
],
8594
'dec-tree' : [
86-
'--allow-incomplete-classpath',
8795
'--report-unsupported-elements-at-runtime',
96+
force_buildtime_init_slf4j_1_7_73,
97+
force_runtime_init_netty_4_1_72
8898
],
8999
'page-rank' : [
90-
'--allow-incomplete-classpath',
91-
'--report-unsupported-elements-at-runtime'
100+
'--report-unsupported-elements-at-runtime',
101+
force_buildtime_init_slf4j_1_7_73,
102+
force_runtime_init_netty_4_1_72
92103
],
93104
'naive-bayes' : [
94-
'--allow-incomplete-classpath',
95-
'--report-unsupported-elements-at-runtime'
105+
'--report-unsupported-elements-at-runtime',
106+
force_buildtime_init_slf4j_1_7_73,
107+
force_runtime_init_netty_4_1_72
108+
],
109+
'gauss-mix' : [
110+
'--report-unsupported-elements-at-runtime',
111+
force_buildtime_init_slf4j_1_7_73,
112+
force_runtime_init_netty_4_1_72
113+
],
114+
'neo4j-analytics': [
115+
'--report-unsupported-elements-at-runtime',
116+
force_buildtime_init_slf4j_1_7_73,
117+
force_runtime_init_netty_4_1_72
96118
],
97119
'dotty' : [
98120
'-H:+AllowJRTFileSystem'
@@ -260,9 +282,11 @@ def standalone_jar_path(self, benchmark_name):
260282
def extra_run_arg(self, benchmark, args, image_run_args):
261283
run_args = super(RenaissanceNativeImageBenchmarkSuite, self).extra_run_arg(benchmark, args, image_run_args)
262284
if benchmark == "dotty" and self.version() not in ["0.9.0", "0.10.0", "0.11.0", "0.12.0", "0.13.0"]:
263-
# Before Renaissance 0.14.0, we had all dependencies on a classpath. As of Renaissance 0.14.0, we use
264-
# the standalone mode which, requires building a classpath for a scala-dotty on a runtime. For that
265-
# purpose, we are specifying a path to a fatjar.
285+
# Before Renaissance 0.14.0, mx was manually placing all dependencies on the same classpath at build time
286+
# and at run time. As of Renaissance 0.14.0, we use the standalone mode which uses the classpath defined
287+
# in the manifest file at build time only. Dotty is a special benchmark since it also needs to know
288+
# this classpath at runtime to be able to perform compilations. The location of the fatjar must then be
289+
# explicitly passed also to the final image.
266290
return ["-Djava.class.path={}".format(self.standalone_jar_path(self.benchmarkName()))] + run_args
267291
else:
268292

0 commit comments

Comments
 (0)