Skip to content

Commit

Permalink
Use default_vm_args and revise launcher config
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 22, 2023
1 parent c933577 commit 2fe4807
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 96 deletions.
29 changes: 0 additions & 29 deletions mx.trufflesqueak/launchers/trufflesqueak

This file was deleted.

33 changes: 0 additions & 33 deletions mx.trufflesqueak/launchers/trufflesqueak.cmd

This file was deleted.

42 changes: 19 additions & 23 deletions mx.trufflesqueak/mx_trufflesqueak.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@

_SUITE = mx.suite('trufflesqueak')
_COMPILER = mx.suite('compiler', fatalIfMissing=False)
_SVM = mx.suite('substratevm', fatalIfMissing=False)

LANGUAGE_ID = 'smalltalk'
PACKAGE_NAME = 'de.hpi.swa.trufflesqueak'
USE_LIBRARY_LAUNCHER = True
BASE_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
VM_ARGS_TESTING = [
# Tweak Runtime
Expand Down Expand Up @@ -164,6 +162,7 @@ def patched_init(self, *args, **kw_args):
def _use_different_graalvm_home_for_native_image(extra_graalvm_home):

def patched_native_image(self, build_args, output_file, allow_server=False, nonZeroIsFatal=True, out=None, err=None):
assert 'smalltalkvm' in output_file
native_image_path = os.path.join(extra_graalvm_home, 'bin', mx.cmd_suffix('native-image'))
dist_names = ['TRUFFLESQUEAK', 'TRUFFLESQUEAK_LAUNCHER', 'TRUFFLE_NFI_LIBFFI', 'TRUFFLE-ENTERPRISE', 'SDK-NATIVEBRIDGE'] + mx_truffle.resolve_truffle_dist_names(use_optimized_runtime=True, use_enterprise=True)
selected_gc = 'G1' if mx.is_linux() else 'serial'
Expand Down Expand Up @@ -192,20 +191,6 @@ def patched_native_image(self, build_args, output_file, allow_server=False, nonZ
_SUITE, env_file='trufflesqueak-native')


LAUNCHER_DESTINATION = 'bin/<exe:trufflesqueak>' if _SVM else 'bin/<exe:trufflesqueak-launcher>'

BASE_LANGUAGE_CONFIG = {
'language': LANGUAGE_ID,
'jar_distributions': ['trufflesqueak:TRUFFLESQUEAK_LAUNCHER'],
'main_class': '%s.launcher.TruffleSqueakLauncher' % PACKAGE_NAME,
'build_args': [
'-H:+ReportExceptionStackTraces',
'-H:+DumpThreadStacksOnSignal',
'-H:+DetectUserDirectoriesInImageHeap',
'-H:+TruffleCheckBlockListMethods',
],
}

mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
suite=_SUITE,
name='TruffleSqueak',
Expand All @@ -223,14 +208,25 @@ def patched_native_image(self, build_args, output_file, allow_server=False, nonZ
'trufflesqueak:BOUNCYCASTLE-PKIX',
'trufflesqueak:BOUNCYCASTLE-UTIL',
],
support_distributions=['trufflesqueak:TRUFFLESQUEAK_HOME'] + [] if _SVM else ['trufflesqueak:TRUFFLESQUEAK_LAUNCHER_SCRIPTS'],
provided_executables=[] if _SVM else ['bin/<cmd:trufflesqueak>'],
launcher_configs=[
mx_sdk.LanguageLauncherConfig(destination=LAUNCHER_DESTINATION, **BASE_LANGUAGE_CONFIG)
] if not USE_LIBRARY_LAUNCHER else [],
support_distributions=['trufflesqueak:TRUFFLESQUEAK_HOME'],
library_configs=[
mx_sdk.LanguageLibraryConfig(destination='lib/<lib:%svm>' % LANGUAGE_ID, launchers=[LAUNCHER_DESTINATION], **BASE_LANGUAGE_CONFIG)
] if USE_LIBRARY_LAUNCHER else [],
mx_sdk.LanguageLibraryConfig(
language=LANGUAGE_ID,
jar_distributions=['trufflesqueak:TRUFFLESQUEAK_LAUNCHER'],
main_class='%s.launcher.TruffleSqueakLauncher' % PACKAGE_NAME,
build_args=[
'-H:+DumpThreadStacksOnSignal',
'-H:+DetectUserDirectoriesInImageHeap',
],
destination='lib/<lib:%svm>' % LANGUAGE_ID,
launchers=['bin/<exe:trufflesqueak>'],
default_vm_args=[
'--vm.Xms512M',
'--vm.Xss16M',
'--vm.-add-exports=java.base/jdk.internal.module=de.hpi.swa.trufflesqueak',
] + (['--vm.Xdock:name=TruffleSqueak'] if mx.is_darwin() else []),
)
],
stability='experimental',
post_install_msg=None,
))
Expand Down
10 changes: 0 additions & 10 deletions mx.trufflesqueak/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,6 @@
],
},

"TRUFFLESQUEAK_LAUNCHER_SCRIPTS": {
"native": True,
"platformDependent": True,
"description": "TruffleSqueak home distribution",
"layout": {
"bin/": ["file:mx.trufflesqueak/launchers/<cmd:trufflesqueak>"],
},
"maven": False,
},

"TRUFFLESQUEAK_SHARED": {
"description": "TruffleSqueak shared distribution",
"moduleInfo": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Requires = language:nfi

JavaArgs = -Dpolyglot.engine.PreinitializeContexts=squeak -Djava.awt.headless=false
JavaArgs = -Djava.awt.headless=false

Args = --initialize-at-build-time=de.hpi.swa.trufflesqueak,org.bouncycastle \
--initialize-at-run-time=com.sun.imageio.plugins,com.sun.java.swing,java.applet,java.awt,javax.accessibility,com.sun.java.accessibility,javax.imageio,javax.swing,sun.awt,sun.datatransfer,sun.font,sun.java2d,sun.swing,com.sun.beans.util \
Expand Down

0 comments on commit 2fe4807

Please sign in to comment.