Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into wip/interpreter-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
DieKautz committed Jan 20, 2024
2 parents abfd2a9 + 636d16e commit cc91a71
Show file tree
Hide file tree
Showing 229 changed files with 657 additions and 540 deletions.
42 changes: 25 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-20.04-aarch64, macos-11, windows-2022]
java: [21]
java: [22]
env:
RUN_WITH_COVERAGE: "${{ matrix.os == 'ubuntu-20.04' }}"
MX_ENV: "trufflesqueak-jar"
Expand All @@ -72,7 +72,7 @@ jobs:
python-version: '3.8'
- name: Set up dependencies
shell: bash
run: mx.trufflesqueak/utils.sh set-up-dependencies java${{ matrix.java }} jar
run: mx.trufflesqueak/utils.sh set-up-dependencies jar
- name: Build GraalVM with TruffleSqueak
run: mx.trufflesqueak/utils.sh build-graalvm ${{ matrix.java }}
if: ${{ runner.os != 'Windows' }}
Expand All @@ -89,6 +89,13 @@ jobs:
echo GRAALVM_HOME=%GRAALVM_HOME%>>%GITHUB_ENV%
echo [%GRAALVM_HOME% set as $GRAALVM_HOME]
if: ${{ runner.os == 'Windows' }}
- name: Publish TruffleSqueak packages to GitHub Packages
shell: bash
run: |
sed "s/{USERNAME}/${GITHUB_ACTOR}/g; s/{TOKEN}/${{ secrets.GITHUB_TOKEN }}/g" mx.trufflesqueak/mvn-settings.xml.template > mx.trufflesqueak/mvn-settings.xml
mx.trufflesqueak/utils.sh conditional-deploy \
mx --env trufflesqueak-jar maven-deploy --settings mx.trufflesqueak/mvn-settings.xml --version-string ${{ github.ref_name }} --validate full --licenses MIT --suppress-javadoc github https://maven.pkg.github.com/hpi-swa/trufflesqueak
if: ${{ matrix.os == 'ubuntu-20.04' }}
- name: Run SystemReporter on TruffleSqueak
run: 'trufflesqueak --code "(String streamContents: [:s | SystemReporter basicNew reportImage: s; reportVM: s; reportVMParameters: s]) withUnixLineEndings" images/test-64bit.image'
- name: Clone Graal.js repository
Expand Down Expand Up @@ -133,7 +140,7 @@ jobs:
os: [ubuntu-20.04, ubuntu-20.04-aarch64, windows-2022, macos-11]
type: [native, jvm]
env:
JAVA_VERSION: "21"
JAVA_VERSION: "22"
MX_ENV: "trufflesqueak-${{ matrix.type }}"
VERBOSE_GRAALVM_LAUNCHERS: true
name: ${{ matrix.type }} ${{ matrix.os }}
Expand All @@ -142,26 +149,27 @@ jobs:
steps:
- name: Clone TruffleSqueak repository
uses: actions/checkout@v3
- name: Set up Oracle GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.type == 'native' }}
- name: Enable Oracle GraalVM
shell: bash
run: |
echo "EXTRA_GRAALVM_HOME=$JAVA_HOME" >> $GITHUB_ENV
cat "${JAVA_HOME}/LICENSE.txt" > "${GITHUB_WORKSPACE}/LICENSE"
if: ${{ matrix.type == 'native' }}
# Oracle GraalVM for JDK 22 not released yet
# - name: Set up Oracle GraalVM
# uses: graalvm/setup-graalvm@v1
# with:
# java-version: ${{ env.JAVA_VERSION }}
# distribution: 'graalvm'
# github-token: ${{ secrets.GITHUB_TOKEN }}
# if: ${{ matrix.type == 'native' }}
# - name: Enable Oracle GraalVM
# shell: bash
# run: |
# echo "EXTRA_GRAALVM_HOME=$JAVA_HOME" >> $GITHUB_ENV
# cat "${JAVA_HOME}/LICENSE.txt" > "${GITHUB_WORKSPACE}/LICENSE"
# if: ${{ matrix.type == 'native' }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Set up dependencies
shell: bash
run: mx.trufflesqueak/utils.sh set-up-dependencies java${{ env.JAVA_VERSION }} ${{ matrix.type }}
run: mx.trufflesqueak/utils.sh set-up-dependencies ${{ matrix.type }}
- name: Build TruffleSqueak standalone
run: mx.trufflesqueak/utils.sh build-standalone ${{ matrix.type }} ${{ env.JAVA_VERSION }}
if: ${{ runner.os != 'Windows' }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ build.xml
/mx.trufflesqueak/.pydevproject
/mx.trufflesqueak/env
/mx.trufflesqueak/eclipse-launches
/mx.trufflesqueak/mvn-settings.xml
/mxbuild
/TRUFFLESQUEAK*.dist
/coverage
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2017-2023 Software Architecture Group, Hasso Plattner Institute
Copyright (c) 2021-2023 Oracle and/or its affiliates
Copyright (c) 2017-2024 Software Architecture Group, Hasso Plattner Institute
Copyright (c) 2021-2024 Oracle and/or its affiliates

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions mx.trufflesqueak/copyrights/oracle.copyright.hash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (c) 2017-2023 Software Architecture Group, Hasso Plattner Institute
# Copyright (c) 2021-2023 Oracle and/or its affiliates
# Copyright (c) 2017-2024 Software Architecture Group, Hasso Plattner Institute
# Copyright (c) 2021-2024 Oracle and/or its affiliates
#
# Licensed under the MIT License.
#
Expand Down
4 changes: 2 additions & 2 deletions mx.trufflesqueak/copyrights/oracle.copyright.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2017-2023 Software Architecture Group, Hasso Plattner Institute
* Copyright (c) 2021-2023 Oracle and/or its affiliates
* Copyright (c) 2017-2024 Software Architecture Group, Hasso Plattner Institute
* Copyright (c) 2021-2024 Oracle and/or its affiliates
*
* Licensed under the MIT License.
*/
38 changes: 38 additions & 0 deletions mx.trufflesqueak/mvn-settings.xml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<!-- https://github.com/github/docs/blob/5f551ae6209c994f9ef5130a1596a7330badc398/content/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry.md -->

<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/hpi-swa/trufflesqueak</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>{USERNAME}</username>
<password>{TOKEN}</password>
</server>
</servers>
</settings>
51 changes: 24 additions & 27 deletions mx.trufflesqueak/mx_trufflesqueak.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (c) 2017-2023 Software Architecture Group, Hasso Plattner Institute
# Copyright (c) 2021-2023 Oracle and/or its affiliates
# Copyright (c) 2017-2024 Software Architecture Group, Hasso Plattner Institute
# Copyright (c) 2021-2024 Oracle and/or its affiliates
#
# Licensed under the MIT License.
#
Expand Down Expand Up @@ -44,19 +44,6 @@
VM_ARGS_TESTING.append('-Dpolyglot.engine.CompilationFailureAction=Diagnose')


def _get_runtime_jvm_args(jdk):
dists = ['TRUFFLESQUEAK', 'TRUFFLESQUEAK_LAUNCHER']

is_graalvm = mx_truffle._is_graalvm(jdk or mx.get_jdk())

if not is_graalvm:
dists.append('TRUFFLE_NFI')
if mx.suite('graal-js', fatalIfMissing=False):
dists.append('GRAALJS')

return mx.get_runtime_jvm_args(dists, jdk=jdk)


def _trufflesqueak_gate_runner(args, tasks):
os.environ['MX_GATE'] = 'true'
supports_coverage = '--jacocout' in sys.argv
Expand Down Expand Up @@ -112,7 +99,6 @@ def _unittest_config_participant(config):

mx_unittest.add_config_participant(_unittest_config_participant)

mx_truffle.should_add_tck_participant(False)

def _add_tck_tests(tasks, supports_coverage):
with mx_gate.Task('TruffleSqueak TCK tests', tasks, tags=['test']) as t:
Expand Down Expand Up @@ -163,15 +149,28 @@ def patched_init(self, *args, **kw_args):
_enable_local_compression()


def _use_different_graalvm_home_for_native_image(extra_graalvm_home):
def _patch_svm_support_native_image():

native_image_original = mx_sdk_vm_impl.SvmSupport.native_image

def patched_native_image(self, build_args, output_file, allow_server=False, nonZeroIsFatal=True, out=None, err=None):
def patched_native_image(self, build_args, output_file, out=None, err=None, find_bad_strings=False):
if 'smalltalkvm' not in output_file:
return native_image_original(self, build_args, output_file, out, err, find_bad_strings)
is_oracle_graalvm = False
extra_graalvm_home = os.getenv('EXTRA_GRAALVM_HOME')
if extra_graalvm_home:
native_image_bin = os.path.join(extra_graalvm_home, 'bin', mx.cmd_suffix('native-image'))
is_oracle_graalvm = '-community' not in extra_graalvm_home
else:
stage1 = mx_sdk_vm_impl.get_stage1_graalvm_distribution()
native_image_project_name = mx_sdk_vm_impl.GraalVmLauncher.launcher_project_name(mx_sdk.LauncherConfig(mx.exe_suffix('native-image'), [], "", []), stage1=True)
native_image_bin = os.path.join(stage1.output, stage1.find_single_source_location('dependency:' + native_image_project_name))
build_args.remove('--macro:smalltalkvm-library')
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'
build_command = [native_image_path] + build_args + mx.get_runtime_jvm_args(names=dist_names) + [
dist_names = ['TRUFFLESQUEAK', 'TRUFFLESQUEAK_LAUNCHER', 'TRUFFLE_NFI_LIBFFI', 'SDK-NATIVEBRIDGE'] \
+ (['TRUFFLE-ENTERPRISE'] if is_oracle_graalvm else []) \
+ mx_truffle.resolve_truffle_dist_names(use_optimized_runtime=True, use_enterprise=True)
selected_gc = 'G1' if is_oracle_graalvm and mx.is_linux() else 'serial'
build_command = [native_image_bin] + build_args + mx.get_runtime_jvm_args(names=dist_names) + [
'-o', os.path.splitext(output_file)[0],
'--shared',
'--gc=' + selected_gc,
Expand All @@ -183,9 +182,7 @@ def patched_native_image(self, build_args, output_file, allow_server=False, nonZ
mx_sdk_vm_impl.SvmSupport.native_image = patched_native_image


extra_graalvm_home = os.getenv('EXTRA_GRAALVM_HOME')
if extra_graalvm_home:
_use_different_graalvm_home_for_native_image(extra_graalvm_home)
_patch_svm_support_native_image()


mx_sdk_vm.register_vm_config('trufflesqueak-jar', ['sdk', 'sdkc', 'sdkni', 'ins', 'cov', 'dap', 'lsp', 'sdkl', 'pro', 'insight', 'insightheap', 'tfl', 'tfla', 'tflc', 'truffle-json', 'nfi', 'nfi-libffi', 'st'],
Expand Down Expand Up @@ -229,7 +226,7 @@ def patched_native_image(self, build_args, output_file, allow_server=False, nonZ
'--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',
Expand Down
63 changes: 48 additions & 15 deletions mx.trufflesqueak/suite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (c) 2017-2023 Software Architecture Group, Hasso Plattner Institute
# Copyright (c) 2021-2023 Oracle and/or its affiliates
# Copyright (c) 2017-2024 Software Architecture Group, Hasso Plattner Institute
# Copyright (c) 2021-2024 Oracle and/or its affiliates
#
# Licensed under the MIT License.
#
Expand All @@ -11,10 +11,10 @@
# METADATA
# ==========================================================================
"name": "trufflesqueak",
"mxversion": "6.41.0",
"mxversion": "7.0.3",
"versionConflictResolution": "latest",

"version": "23.1.0",
"version": "24.0.0",
"trufflesqueak:dependencyMap": {
"cuis_test_image": "CuisTestImage-6.0-5053.zip",
"cuis_test_image_tag": "21.3.0",
Expand Down Expand Up @@ -46,7 +46,7 @@
"suites": [{
"name": "truffle",
"subdir": True,
"version": "vm-23.1.0",
"version": "release/graal-vm/24.0",
"urls": [{
"url": "https://github.com/oracle/graal",
"kind": "git"
Expand Down Expand Up @@ -88,28 +88,28 @@
},
"moduleName": "org.bouncycastle.util",
},
"CHECKSTYLE_10.7.0" : {
"urls" : [
"CHECKSTYLE_10.7.0": {
"urls": [
"https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.7.0/checkstyle-10.7.0-all.jar"
],
"sha1": "acd1c78c07e894647e8dcbd72c4fa9a136e20d6d",
"licence" : "LGPLv21",
"licence": "LGPLv21",
},
"TRUFFLE-ENTERPRISE": {
"digest": "sha512:2948bd1779fe1c2b0b70de76220582d54bb59a2d9048c4a09d5148a7358014ae6484a373a1076f5dad7f861723981407ea48e247a6ef7d4659eef28ee9c86354",
"digest": "sha512:b883d3ead84778617f9b09edaa43634183f07cdc6ae0666cb2f4edabc52fca913138c4a7a8f9ada1adbd4a9bbe7d16fb4a1b3ceac13446f4e0c47f3d1a20469f",
"maven": {
"groupId": "org.graalvm.truffle",
"artifactId": "truffle-enterprise",
"version": "23.1.0",
"version": "23.1.2",
},
"useModulePath": True,
},
"SDK-NATIVEBRIDGE": {
"digest": "sha512:bc28336e23d5abc4bc7704093b0e1546ac1aa972dfabe24e94dad19b4b0a36df62c6322dc33a0dadeb2a741a8fa1cb116d4248e09362f0c16924ff25672bc61d",
"digest": "sha512:5c2187fa912ab9cc1bb872e08acd3cae5332e2920502b1d7cbe6bc1e70431960e8ed28d153cddd0a3f7d99f618f229d9ac78969d2c94ee1a9a79c003f5c9cc46",
"maven": {
"groupId": "org.graalvm.sdk",
"artifactId": "nativebridge",
"version": "23.1.0",
"version": "23.1.2",
},
"useModulePath": True,
},
Expand Down Expand Up @@ -141,7 +141,7 @@
"jdk.management",
"jdk.unsupported",
],
"requiresConcealed" : {
"requiresConcealed": {
"java.base": ["jdk.internal.module"],
},
"checkstyleVersion": "10.7.0",
Expand Down Expand Up @@ -261,6 +261,37 @@
"tag": ["default", "public"],
},
"noMavenJavadoc": True,
"license": ["MIT"],
},

"SMALLTALK": {
"type": "pom",
"runtimeDependencies": [
"TRUFFLESQUEAK",
"TRUFFLE-ENTERPRISE",
],
"description": "TruffleSqueak virtual machine for Oracle GraalVM",
"maven": {
"groupId": "de.hpi.swa.trufflesqueak",
"artifactId": "smalltalk",
"tag": ["default", "public"],
},
"license": ["MIT"],
},

"SMALLTALK_COMMUNITY": {
"type": "pom",
"runtimeDependencies": [
"TRUFFLESQUEAK",
"truffle:TRUFFLE_RUNTIME",
],
"description": "TruffleSqueak virtual machine for GraalVM CE",
"maven": {
"groupId": "de.hpi.swa.trufflesqueak",
"artifactId": "smalltalk-community",
"tag": ["default", "public"],
},
"license": ["MIT"],
},

"TRUFFLESQUEAK_HOME": {
Expand Down Expand Up @@ -297,6 +328,7 @@
"tag": ["default", "public"],
},
"noMavenJavadoc": True,
"license": ["MIT"],
},

"TRUFFLESQUEAK_SHARED": {
Expand All @@ -319,6 +351,7 @@
"tag": ["default", "public"],
},
"noMavenJavadoc": True,
"license": ["MIT"],
},

"TRUFFLESQUEAK_TCK": {
Expand All @@ -336,7 +369,7 @@
"sdk:POLYGLOT_TCK",
],
"testDistribution": True,
"maven" : False,
"maven": False,
},

"TRUFFLESQUEAK_TEST": {
Expand All @@ -356,7 +389,7 @@
"exclude": ["mx:JUNIT", "mx:HAMCREST"],
"distDependencies": ["TRUFFLESQUEAK"],
"testDistribution": True,
"maven" : False,
"maven": False,
},
},
}
Loading

0 comments on commit cc91a71

Please sign in to comment.