Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions sdk/mx.sdk/DISCLAIMER_FOR_GFTC_SNAPSHOT_ARTIFACTS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This is a daily development build of the Oracle product and is offered to you
as part of the development and testing process. Oracle does not recommend
bundling this build with your products or otherwise using for any production
purpose. This build is offered to and received by you solely under the GraalVM
Free Terms and Conditions (GFTC), and is not governed by any other license
between you and Oracle, including without limitation the Oracle Master
Agreement. The features and functionality of the product are subject to change
at any time and the existence of any features or functionality in this build
should not be relied upon in making purchasing decisions. The existence of
particular features or functionality in this build is not a commitment to
deliver any hardware, software or other material, or code, or functionality,
and you should not rely on the future availability of any feature or
functionality in the product. The development, release, and timing of any
features or functionality for this product remain at the sole discretion of
Oracle. In the event you decide to provide any input to Oracle regarding the
product, you acknowledge that Oracle may use that input for any purpose,
including but not limited to incorporation or implementation of the input in
any Oracle product or service, and the display, marketing, sublicensing and
distribution of the input as incorporated or embedded in any product or service
distributed or offered by Oracle.
62 changes: 45 additions & 17 deletions sdk/mx.sdk/mx_sdk_vm_ng.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2025, 2025, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
Expand Down Expand Up @@ -126,10 +126,16 @@ def _get_dyn_attribute(dep, attr_name, default):
raise mx.abort(f"Could not resolve {attr_name} '{attr}' in {suite.extensions.__file__}", context=dep)
return func(), attr

def _is_enterprise():
return mx.suite('graal-enterprise', fatalIfMissing=False) or mx.suite('truffle-enterprise', fatalIfMissing=False) or mx.suite('substratevm-enterprise', fatalIfMissing=False)

def _is_nativeimage_ee():
def _has_suite(name):
return mx.suite(name, fatalIfMissing=False)

# Whether any of truffle-enterprise, graal-enterprise or substratevm-enterprise are imported.
def uses_enterprise_sources():
# Technically testing for truffle-enterprise might be enough currently, but unclear if graal-enterprise will always depend on truffle-enterprise.
return _has_suite('truffle-enterprise') or _has_suite('graal-enterprise') or _has_suite('substratevm-enterprise')

def is_nativeimage_ee():
global _is_nativeimage_ee_cache
if _is_nativeimage_ee_cache is None:
if not _external_bootstrap_graalvm:
Expand All @@ -138,13 +144,18 @@ def _is_nativeimage_ee():
_is_nativeimage_ee_cache = exists(join(_external_bootstrap_graalvm, 'lib', 'svm', 'builder', 'svm-enterprise.jar'))
return _is_nativeimage_ee_cache

# Whether the produced standalone uses anything enterprise, either from source or prebuilt (i.e., a boostrap Oracle GraalVM)
def is_enterprise():
return uses_enterprise_sources() or is_nativeimage_ee()

class StandaloneLicenses(mx.Project):
def __init__(self, suite, name, deps, workingSets, theLicense=None, **kw_args):
self.community_license_file = _require(kw_args, 'community_license_file', suite, name)
self.community_3rd_party_license_file = _require(kw_args, 'community_3rd_party_license_file', suite, name)

self.enterprise = _is_enterprise()
if self.enterprise:
self.uses_enterprise_sources = uses_enterprise_sources()
self.enterprise = is_enterprise()
if self.uses_enterprise_sources:
deps.append('lium:LICENSE_INFORMATION_USER_MANUAL')
super().__init__(suite, name, subDir=None, srcDirs=[], deps=deps, workingSets=workingSets, d=suite.dir, theLicense=theLicense, **kw_args)

Expand All @@ -156,12 +167,17 @@ def getArchivableResults(self, use_relpath=True, single=False):
raise ValueError('single not supported')

if self.enterprise:
truffle_enterprise = mx.suite('truffle-enterprise', fatalIfMissing=True, context=self)
vm_enterprise_dir = join(dirname(truffle_enterprise.dir), 'vm-enterprise')
yield join(vm_enterprise_dir, 'GraalVM_GFTC_License.txt'), 'LICENSE.txt'
yield from mx.distribution('lium:LICENSE_INFORMATION_USER_MANUAL').getArchivableResults(use_relpath, single=True)
if not mx.suite('sdk').is_release():
yield join(vm_enterprise_dir, 'DISCLAIMER_FOR_SNAPSHOT_ARTIFACTS.txt'), 'DISCLAIMER.txt'
if not _suite.is_release():
yield join(_suite.mxDir, 'DISCLAIMER_FOR_GFTC_SNAPSHOT_ARTIFACTS.txt'), 'DISCLAIMER.txt'
if self.uses_enterprise_sources:
lium_suite = mx.suite('lium', fatalIfMissing=True, context=self)
vm_enterprise_dir = join(dirname(lium_suite.dir), 'vm-enterprise')
yield join(vm_enterprise_dir, 'GraalVM_GFTC_License.txt'), 'LICENSE.txt'
yield from mx.distribution('lium:LICENSE_INFORMATION_USER_MANUAL').getArchivableResults(use_relpath, single=True)
else:
# If the only enterprise input is a bootstrap Oracle GraalVM then copy the license from there
yield join(_external_bootstrap_graalvm, 'LICENSE.txt'), 'LICENSE.txt'
yield join(_external_bootstrap_graalvm, 'license-information-user-manual.zip'), 'license-information-user-manual.zip'
else:
yield join(self.suite.dir, self.community_license_file), 'LICENSE.txt'
yield join(self.suite.dir, self.community_3rd_party_license_file), '3rd_party_licenses.txt'
Expand All @@ -182,14 +198,19 @@ def needsBuild(self, newestInput):
else:
contents = None
if contents != self.witness_contents():
return True, 'CE<=>EE'
return True, f"{contents} => {self.witness_contents()}"
return False, 'Files are already on disk'

def witness_file(self):
return join(self.subject.get_output_root(), 'witness')

def witness_contents(self):
return 'ee' if self.subject.enterprise else 'ce'
if self.subject.uses_enterprise_sources:
return 'ee sources'
elif self.subject.enterprise:
return _external_bootstrap_graalvm
else:
return 'ce'

def build(self):
witness_file = self.witness_file()
Expand Down Expand Up @@ -338,7 +359,7 @@ def name_suffix(self):

def get_build_args(self):
extra_build_args = ['--shared']
if _is_nativeimage_ee():
if is_nativeimage_ee():
# PGO is supported
extra_build_args += mx_sdk_vm_impl.svm_experimental_options(['-H:+ProfilingEnableProfileDumpHooks'])
return super().get_build_args() + extra_build_args
Expand Down Expand Up @@ -381,6 +402,9 @@ def __init__(self, args, project: NativeImageProject):
max_parallelism = 12
super().__init__(project, args, min(max_parallelism, mx.cpu_count()))

def newestOutput(self):
return mx.TimeStampFile.newest([_path for _path, _ in self.subject.getArchivableResults()])

def get_build_args(self):
experimental_build_args = [
'-H:+GenerateBuildArtifactsFile', # generate 'build-artifacts.json'
Expand All @@ -397,7 +421,7 @@ def get_build_args(self):
canonical_name = self.subject.base_file_name()
profiles = mx_sdk_vm_impl._image_profiles(canonical_name)
if profiles:
if not _is_nativeimage_ee():
if not is_nativeimage_ee():
raise mx.abort("Image profiles can not be used if PGO is not supported.")
basenames = [basename(p) for p in profiles]
if len(set(basenames)) != len(profiles):
Expand Down Expand Up @@ -753,6 +777,10 @@ def archived_deps(self):
def isJDKDependent(self):
return False

# Needed when somesuite._output_root_includes_config() == False
def get_output_root(self):
return join(self.get_output_base(), self.name)


class JavaHomeBuildTask(mx.BuildTask):
subject: JavaHomeDependency
Expand Down Expand Up @@ -951,7 +979,7 @@ def __init__(self, suite, name=None, deps=None, excludedLibs=None, platformDepen
path_substitutions.register_no_arg('graalvm_os', mx_sdk_vm_impl.get_graalvm_os())
string_substitutions = mx_subst.SubstitutionEngine(path_substitutions)

if _is_enterprise():
if is_enterprise():
dir_name = enterprise_dir_name or f'{enterprise_archive_name}-<version>-<graalvm_os>-<arch>'
dist_name = 'STANDALONE_' + enterprise_archive_name.upper().replace('-', '_')
else:
Expand Down
7 changes: 7 additions & 0 deletions tools/mx.tools/mx_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ def apply(self, config):
# in turn allows us to dynamically open fields/methods to reflection.
vmArgs = vmArgs + ['--add-exports=java.base/jdk.internal.module=ALL-UNNAMED']
vmArgs = vmArgs + ['--add-modules=ALL-MODULE-PATH']
# The tools unittests use internals
mainClassArgs.extend(['-JUnitOpenPackages', 'com.oracle.truffle.tools.chromeinspector/*=ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'com.oracle.truffle.tools.coverage/*=ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'com.oracle.truffle.tools.dap/*=ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'org.graalvm.tools.insight/*=ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'org.graalvm.tools.insight.heap/*=ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'org.graalvm.tools.lsp/*=ALL-UNNAMED'])
return (vmArgs, mainClass, mainClassArgs)

mx_unittest.register_unittest_config(ToolsUnittestConfig())
Expand Down
8 changes: 8 additions & 0 deletions tools/mx.tools/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@
"org.graalvm.polyglot",
],
},
"useModulePath" : True,
"dependencies": ["com.oracle.truffle.tools.chromeinspector"],
"distDependencies" : [
"truffle:TRUFFLE_API",
Expand Down Expand Up @@ -431,6 +432,7 @@
"org.graalvm.collections",
],
},
"useModulePath" : True,
"dependencies": [
"org.graalvm.tools.insight",
"com.oracle.truffle.tools.agentscript"
Expand Down Expand Up @@ -467,6 +469,7 @@
"org.graalvm.polyglot",
],
},
"useModulePath" : True,
"dependencies": [
"org.graalvm.tools.insight.heap"
],
Expand Down Expand Up @@ -538,6 +541,7 @@
"org.graalvm.polyglot",
],
},
"useModulePath" : True,
"dependencies": [
"com.oracle.truffle.tools.profiler",
],
Expand Down Expand Up @@ -597,6 +601,7 @@
"org.graalvm.polyglot",
],
},
"useModulePath" : True,
"dependencies": [
"com.oracle.truffle.tools.coverage",
],
Expand Down Expand Up @@ -658,6 +663,7 @@
"org.graalvm.polyglot",
],
},
"useModulePath" : True,
"dependencies": [
"com.oracle.truffle.tools.dap",
],
Expand Down Expand Up @@ -724,6 +730,7 @@
"subDir": "src",
# This distribution defines a module.
"moduleName" : "org.graalvm.tools.api.lsp",
"useModulePath" : True,
"dependencies": ["org.graalvm.tools.api.lsp"],
"distDependencies" : [
"truffle:TRUFFLE_API",
Expand All @@ -746,6 +753,7 @@
"org.graalvm.truffle",
],
},
"useModulePath" : True,
"dependencies": [
"org.graalvm.tools.api.lsp",
"org.graalvm.tools.lsp"
Expand Down
Loading