Skip to content

Commit c300829

Browse files
committed
updated java modules
1 parent 165b262 commit c300829

File tree

1 file changed

+36
-12
lines changed
  • localstack-core/localstack/packages

1 file changed

+36
-12
lines changed

localstack-core/localstack/packages/java.py

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,49 @@ def _post_process(self, target: InstallTarget) -> None:
116116

117117
# Build a custom JRE with only the necessary bits to minimise disk footprint
118118
LOG.debug("Optimising JRE installation")
119-
cmd = (
120-
"bin/jlink --add-modules "
119+
120+
base_modules = [
121121
# Required modules
122-
"java.base,java.desktop,java.instrument,java.management,"
123-
"java.naming,java.scripting,java.sql,java.xml,jdk.compiler,"
124-
# Required module for trino latest version
125-
"jdk.incubator.vector,"
122+
"java.base",
123+
"java.desktop",
124+
"java.instrument",
125+
"java.management",
126+
"java.naming",
127+
"java.scripting",
128+
"java.sql",
129+
"java.xml",
130+
"jdk.compiler",
126131
# jdk.unsupported contains sun.misc.Unsafe which is required by some dependencies
127-
"jdk.unsupported,"
132+
"jdk.unsupported",
128133
# Additional cipher suites
129-
"jdk.crypto.cryptoki,"
134+
"jdk.crypto.cryptoki",
130135
# Archive support
131-
"jdk.zipfs,"
136+
"jdk.zipfs",
132137
# Required by MQ broker
133-
"jdk.httpserver,jdk.management,jdk.management.agent,"
138+
"jdk.httpserver",
139+
"jdk.management",
140+
"jdk.management.agent",
134141
# Required by Spark and Hadoop
135-
"java.security.jgss,jdk.security.auth,"
142+
"java.security.jgss",
143+
"jdk.security.auth",
144+
# Include required locales
145+
"jdk.localedata",
146+
]
147+
148+
# Add version-specific modules, not all versions require/support the same set
149+
version_specific_modules = {
150+
"24": ["jdk.incubator.vector"], # Required for Trino latest version
151+
}
152+
153+
modules = base_modules + version_specific_modules.get(self.version, [])
154+
modules_str = ",".join(modules)
155+
156+
cmd = (
157+
"bin/jlink "
158+
# Add modules
159+
f"--add-modules {modules_str} "
136160
# Include required locales
137-
"jdk.localedata --include-locales en "
161+
"--include-locales en "
138162
# Supplementary args
139163
"--compress 2 --strip-debug --no-header-files --no-man-pages "
140164
# Output directory

0 commit comments

Comments
 (0)