Skip to content

Commit

Permalink
Proof of concept: support compilation from tarball
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Jul 23, 2018
1 parent 47a182f commit 1c87385
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
8 changes: 5 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

Expand Down Expand Up @@ -4751,7 +4753,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 @@ -7667,7 +7669,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 @@ -17863,7 +17865,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
27 changes: 27 additions & 0 deletions mx_tar_vcs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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")]

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'))

0 comments on commit 1c87385

Please sign in to comment.