Skip to content

Commit 1c87385

Browse files
committed
Proof of concept: support compilation from tarball
Signed-off-by: Stefan Marr <[email protected]>
1 parent 47a182f commit 1c87385

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

mx.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def no_suite_discovery(func):
132132
import mx_benchplot
133133
import mx_downstream
134134
import mx_subst
135+
import mx_tar_vcs
136+
135137

136138
from mx_javamodules import JavaModuleDescriptor, make_java_module, get_java_module_info, lookup_package
137139

@@ -4751,7 +4753,7 @@ def cleanForbidden(self):
47514753
class VC(object):
47524754
__metaclass__ = ABCMeta
47534755
"""
4754-
base class for all supported Distriuted Version Constrol abstractions
4756+
base class for all supported Distributed Version Control abstractions
47554757

47564758
:ivar str kind: the VC type identifier
47574759
:ivar str proper_name: the long name descriptor of the VCS
@@ -7667,7 +7669,7 @@ def parse_specification(import_dict, context, importer, dynamicImport=False):
76677669
if version_from and version:
76687670
abort("In import for '{}': 'version' and 'versionFrom' can not be both set".format(name), context=context)
76697671
if version is None and version_from is None:
7670-
if not (in_subdir and (importer.vc_dir != importer.dir or isinstance(importer, BinarySuite))):
7672+
if not (in_subdir and (importer.vc_dir != importer.dir or isinstance(importer, BinarySuite) or isinstance(importer.vc, mx_tar_vcs.TarVC))):
76717673
abort("In import for '{}': No version given and not a 'subdir' suite of the same repository".format(name), context=context)
76727674
if importer.isSourceSuite():
76737675
suite_dir = join(importer.vc_dir, name)
@@ -17863,7 +17865,7 @@ def main():
1786317865
_opts.__dict__['very_verbose'] = '-V' in sys.argv
1786417866
_opts.__dict__['warn'] = '--no-warning' not in sys.argv
1786517867
global _vc_systems
17866-
_vc_systems = [HgConfig(), GitConfig(), BinaryVC()]
17868+
_vc_systems = [HgConfig(), GitConfig(), BinaryVC(), mx_tar_vcs.TarVC()]
1786717869

1786817870
global _mx_suite
1786917871
_mx_suite = MXSuite()

mx_tar_vcs.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import time
2+
3+
4+
class TarVC(object):
5+
""" Proof of concept for building from a tarball. """
6+
7+
def check(self, abortOnError=True):
8+
return self
9+
10+
def root(self, directory, abortOnError=True):
11+
# TODO: figure out how to do this without hard coding. Some meta data?
12+
if directory.endswith("/compiler"):
13+
return directory[:-len("/compiler")]
14+
if directory.endswith("/truffle"):
15+
return directory[:-len("/truffle")]
16+
if directory.endswith("/tools"):
17+
return directory[:-len("/tools")]
18+
if directory.endswith("/sdk"):
19+
return directory[:-len("/sdk")]
20+
21+
return directory
22+
23+
def release_version_from_tags(self, vcdir, prefix, snapshotSuffix='dev', abortOnError=True):
24+
return None
25+
26+
def parent(self, vcdir, abortOnError=True):
27+
return 'unknown-{0}'.format(time.strftime('%Y-%m-%d_%H-%M-%S_%Z'))

0 commit comments

Comments
 (0)