Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: support compilation from tarball [PoC, don't merge] #156

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def no_suite_discovery(func):
import mx_benchplot
import mx_downstream
import mx_subst
import mx_tar_vcs


from mx_javamodules import JavaModuleDescriptor, make_java_module, get_java_module_info, lookup_package, get_transitive_closure, get_module_name

Expand Down Expand Up @@ -214,6 +216,7 @@ def cpu_count():
_licenses = dict()
_repositories = dict()
_mavenRepoBaseURLs = [
"https://maven-central.storage.googleapis.com/repos/central/data/",
"https://repo1.maven.org/maven2/",
"https://search.maven.org/remotecontent?filepath="
]
Expand Down Expand Up @@ -5047,7 +5050,7 @@ def cleanForbidden(self):
class VC(object):
__metaclass__ = ABCMeta
"""
base class for all supported Distriuted Version Constrol abstractions
base class for all supported Distributed Version Control abstractions

:ivar str kind: the VC type identifier
:ivar str proper_name: the long name descriptor of the VCS
Expand Down Expand Up @@ -7978,7 +7981,7 @@ def parse_specification(import_dict, context, importer, dynamicImport=False):
if version_from and version:
abort("In import for '{}': 'version' and 'versionFrom' can not be both set".format(name), context=context)
if version is None and version_from is None:
if not (in_subdir and (importer.vc_dir != importer.dir or isinstance(importer, BinarySuite))):
if not (in_subdir and (importer.vc_dir != importer.dir or isinstance(importer, BinarySuite) or isinstance(importer.vc, mx_tar_vcs.TarVC))):
abort("In import for '{}': No version given and not a 'subdir' suite of the same repository".format(name), context=context)
if importer.isSourceSuite():
suite_dir = join(importer.vc_dir, name)
Expand Down Expand Up @@ -18406,7 +18409,7 @@ def main():
_opts.__dict__['very_verbose'] = '-V' in sys.argv
_opts.__dict__['warn'] = '--no-warning' not in sys.argv
global _vc_systems
_vc_systems = [HgConfig(), GitConfig(), BinaryVC()]
_vc_systems = [HgConfig(), GitConfig(), BinaryVC(), mx_tar_vcs.TarVC()]

global _mx_suite
_mx_suite = MXSuite()
Expand Down
31 changes: 31 additions & 0 deletions mx_tar_vcs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import time


class TarVC(object):
""" Proof of concept for building from a tarball. """

def check(self, abortOnError=True):
return self

def root(self, directory, abortOnError=True):
# TODO: figure out how to do this without hard coding. Some meta data?
if directory.endswith("/compiler"):
return directory[:-len("/compiler")]
if directory.endswith("/truffle"):
return directory[:-len("/truffle")]
if directory.endswith("/tools"):
return directory[:-len("/tools")]
if directory.endswith("/sdk"):
return directory[:-len("/sdk")]
if directory.endswith("/substratevm"):
return directory[:-len("/substratevm")]
if directory.endswith("/vm"):
return directory[:-len("/vm")]

return directory

def release_version_from_tags(self, vcdir, prefix, snapshotSuffix='dev', abortOnError=True):
return None

def parent(self, vcdir, abortOnError=True):
return 'unknown-{0}'.format(time.strftime('%Y-%m-%d_%H-%M-%S_%Z'))