graalvm8: 19.1.1 -> 19.2.1

- - nixpkgs now with full darwin support
This commit is contained in:
hlolli
2020-01-18 16:43:03 +01:00
parent ba889bdcbe
commit 78b34b5e5b
14 changed files with 612 additions and 214 deletions
+154 -120
View File
@@ -1,57 +1,31 @@
diff --git a/mx.py b/mx.py
index af7a9c2..08c0ea8 100755
index a0b9315..b7d67a0 100755
--- a/mx.py
+++ b/mx.py
@@ -4976,30 +4976,6 @@ class PackedResourceLibrary(ResourceLibrary):
@@ -238,21 +238,7 @@ def _check_file_with_sha1(path, sha1, sha1path, mustExist=True, newFile=False, l
f.write(value or sha1OfFile(path))
def get_path(self, resolve):
extract_path = _make_absolute(self.extract_path, self.suite.dir)
- download_path = super(PackedResourceLibrary, self).get_path(resolve)
- if resolve and self._check_extract_needed(extract_path, download_path):
- extract_path_tmp = tempfile.mkdtemp(suffix=basename(extract_path), dir=dirname(extract_path))
- try:
- # extract archive
- Extractor.create(download_path).extract(extract_path_tmp)
- # ensure modification time is up to date
- os.utime(extract_path_tmp, None)
- logv("Moving temporary directory {} to {}".format(extract_path_tmp, extract_path))
- try:
- # attempt atomic overwrite
- os.rename(extract_path_tmp, extract_path)
- except OSError:
- # clean destination & re-try for cases where atomic overwrite doesn't work
- rmtree(extract_path, ignore_errors=True)
- os.rename(extract_path_tmp, extract_path)
- except OSError as ose:
- # Rename failed. Race with other process?
- if self._check_extract_needed(extract_path, download_path):
- # ok something really went wrong
- abort("Extracting {} failed!".format(download_path), context=ose)
- finally:
- rmtree(extract_path_tmp, ignore_errors=True)
if exists(path):
- if sha1Check and sha1:
- if not _sha1CachedValid() or (newFile and sha1 != _sha1Cached()):
- logv('Create/update SHA1 cache file ' + sha1path)
- _writeSha1Cached()
-
return extract_path
def _check_download_needed(self):
@@ -5900,7 +5876,7 @@ class HgConfig(VC):
def update_to_branch(self, vcdir, branch, abortOnError=True):
cmd = ['update', branch]
- self.hg_command(vcdir, cmd, abortOnError=abortOnError)
+ self.run(['hg', vcdir] + cmd)
def add(self, vcdir, path, abortOnError=True):
return self.run(['hg', '-q', '-R', vcdir, 'add', path]) == 0
@@ -5937,7 +5913,7 @@ class HgConfig(VC):
return None
def parent_info(self, vcdir, abortOnError=True):
- out = self.hg_command(vcdir, ["log", "-r", ".", "--template", "{author}|||{date|hgdate}"], abortOnError=abortOnError)
+ out = _check_output_str(["hg", '-R', vcdir, "log", "-r", ".", "--template", "{author}|||{date|hgdate}"])
author, date = out.split("|||")
ts, _ = date.split(" ")
return self._sanitize_parent_info({
@@ -8301,46 +8277,8 @@ class SuiteImport:
- if sha1 != _sha1Cached():
- computedSha1 = sha1OfFile(path)
- if sha1 == computedSha1:
- warn('Fixing corrupt SHA1 cache file ' + sha1path)
- _writeSha1Cached(computedSha1)
- return True
- if logErrors:
- size = os.path.getsize(path)
- log_error('SHA1 of {} [size: {}] ({}) does not match expected value ({})'.format(TimeStampFile(path), size, computedSha1, sha1))
- return False
+ return True
elif mustExist:
if logErrors:
log_error("'{}' does not exist".format(path))
@@ -1057,46 +1043,8 @@ class SuiteImport:
version = import_dict.get("version")
suite_dir = None
version_from = import_dict.get("versionFrom")
@@ -100,7 +74,7 @@ index af7a9c2..08c0ea8 100755
@staticmethod
def get_source_urls(source, kind=None):
@@ -8381,8 +8319,6 @@ class Suite(object):
@@ -1467,8 +1415,6 @@ class Suite(object):
:type dists: list[Distribution]
"""
def __init__(self, mxDir, primary, internal, importing_suite, load, vc, vc_dir, dynamicallyImported=False):
@@ -109,7 +83,7 @@ index af7a9c2..08c0ea8 100755
self.imported_by = [] if primary else [importing_suite]
self.mxDir = mxDir
self.dir = dirname(mxDir)
@@ -8410,7 +8346,7 @@ class Suite(object):
@@ -1496,7 +1442,7 @@ class Suite(object):
self._outputRoot = None
self._preloaded_suite_dict = None
self.vc = vc
@@ -118,7 +92,7 @@ index af7a9c2..08c0ea8 100755
self._preload_suite_dict()
self._init_imports()
if load:
@@ -9310,7 +9246,9 @@ def get_dynamic_imports():
@@ -2405,7 +2351,9 @@ class Repository(SuiteConstituent):
class SourceSuite(Suite):
"""A source suite"""
def __init__(self, mxDir, primary=False, load=True, internal=False, importing_suite=None, dynamicallyImported=False):
@@ -129,7 +103,7 @@ index af7a9c2..08c0ea8 100755
Suite.__init__(self, mxDir, primary, internal, importing_suite, load, vc, vc_dir, dynamicallyImported=dynamicallyImported)
logvv("SourceSuite.__init__({}), got vc={}, vc_dir={}".format(mxDir, self.vc, self.vc_dir))
self.projects = []
@@ -9359,17 +9297,7 @@ class SourceSuite(Suite):
@@ -2454,17 +2402,7 @@ class SourceSuite(Suite):
"""
Gets the release tag from VC or create a time based once if VC is unavailable
"""
@@ -148,73 +122,7 @@ index af7a9c2..08c0ea8 100755
def scm_metadata(self, abortOnError=False):
scm = self.scm
@@ -12541,55 +12469,8 @@ def _attempt_download(url, path, jarEntryName=None):
return False
def download(path, urls, verbose=False, abortOnError=True, verifyOnly=False):
- """
- Attempts to downloads content for each URL in a list, stopping after the first successful download.
- If the content cannot be retrieved from any URL, the program is aborted, unless abortOnError=False.
- The downloaded content is written to the file indicated by `path`.
- """
- if not verifyOnly:
- ensure_dirname_exists(path)
- assert not path.endswith(os.sep)
-
- # https://docs.oracle.com/javase/7/docs/api/java/net/JarURLConnection.html
- jarURLPattern = re.compile('jar:(.*)!/(.*)')
- verify_errors = {}
- for url in urls:
- if not verifyOnly or verbose:
- log('Downloading ' + url + ' to ' + path)
- m = jarURLPattern.match(url)
- jarEntryName = None
- if m:
- url = m.group(1)
- jarEntryName = m.group(2)
-
- if verifyOnly:
- try:
- conn = _urlopen(url, timeout=10)
- conn.close()
- return True
- except (IOError, socket.timeout) as e:
- _suggest_tlsv1_error(e)
- verify_errors[url] = e
- continue
-
- for i in range(4):
- if i != 0:
- time.sleep(1)
- warn('Retry {} to download from {}'.format(i, url))
- res = _attempt_download(url, path, jarEntryName)
- if res is True:
- return True
- if res is False:
- break
-
- if abortOnError:
- msg = 'Could not download to ' + path + ' from any of the following URLs: ' + ', '.join(urls)
- if verifyOnly:
- for url, e in verify_errors.items():
- msg += '\n ' + url + ': ' + str(e)
- abort(msg)
- else:
- return False
+ print("FAKE download(path={} urls={} verbose={} abortOnError={} verifyOnly={})".format(path, urls, verbose, abortOnError, verifyOnly))
+ return True
def update_file(path, content, showDiff=False):
"""
@@ -13393,6 +13274,7 @@ class Archiver(SafeFileCreation):
def _add_zip(self, filename, archive_name, provenance):
self._add_provenance(archive_name, provenance)
+ os.utime(filename, (315532800, 315532800))
self.zf.write(filename, archive_name)
def _add_str_zip(self, data, archive_name, provenance):
@@ -18541,12 +18423,35 @@ def _find_suite_import(importing_suite, suite_import, fatalIfMissing=True, load=
@@ -2993,12 +2931,35 @@ def _find_suite_import(importing_suite, suite_import, fatalIfMissing=True, load=
Attempts to locate an existing suite in the local context
Returns the path to the mx.name dir if found else None
"""
@@ -255,3 +163,129 @@ index af7a9c2..08c0ea8 100755
def _get_import_dir(url, mode):
"""Return directory where the suite will be cloned to"""
@@ -3816,7 +3777,7 @@ def getmtime(name):
"""
Wrapper for builtin open function that handles long path names on Windows.
"""
- return os.path.getmtime(_safe_path(name))
+ return 315532800
def stat(name):
@@ -4062,57 +4023,8 @@ def _attempt_download(url, path, jarEntryName=None):
return False
def download(path, urls, verbose=False, abortOnError=True, verifyOnly=False):
- """
- Attempts to downloads content for each URL in a list, stopping after the first successful download.
- If the content cannot be retrieved from any URL, the program is aborted, unless abortOnError=False.
- The downloaded content is written to the file indicated by `path`.
- """
- if not verifyOnly:
- ensure_dirname_exists(path)
- assert not path.endswith(os.sep)
-
- # https://docs.oracle.com/javase/7/docs/api/java/net/JarURLConnection.html
- jarURLPattern = re.compile('jar:(.*)!/(.*)')
- verify_errors = {}
- for url in urls:
- if not verifyOnly or verbose:
- log('Downloading ' + url + ' to ' + path)
- m = jarURLPattern.match(url)
- jarEntryName = None
- if m:
- url = m.group(1)
- jarEntryName = m.group(2)
-
- if not _opts.trust_http and (url.lower().startswith('http://') or url.lower().startswith('ftp://')):
- warn('Downloading from non-https URL {}. Use --trust-http mx option to suppress this warning.'.format(url))
-
- if verifyOnly:
- try:
- conn = _urlopen(url, timeout=10)
- conn.close()
- except (IOError, socket.timeout) as e:
- _suggest_tlsv1_error(e)
- verify_errors[url] = e
- else:
- for i in range(4):
- if i != 0:
- time.sleep(1)
- warn('Retry {} to download from {}'.format(i, url))
- if _attempt_download(url, path, jarEntryName):
- return True # Download was successful
-
- if verifyOnly and len(verify_errors) < len(urls): # verify-mode at least one success -> success
- return True
- else: # Either verification error or no download was successful
- msg = 'Could not download to ' + path + ' from any of the following URLs: ' + ', '.join(urls)
- if verifyOnly: # verify-mode -> print error details
- for url, e in verify_errors.items():
- msg += '\n ' + url + ': ' + str(e)
- if abortOnError:
- abort(msg)
- else:
- warn(msg)
- return False
+ print("FAKE download(path={} urls={} verbose={} abortOnError={} verifyOnly={})".format(path, urls, verbose, abortOnError, verifyOnly))
+ return True
def update_file(path, content, showDiff=False):
"""
@@ -7887,30 +7799,6 @@ class PackedResourceLibrary(ResourceLibrary):
def get_path(self, resolve):
extract_path = _make_absolute(self.extract_path, self.suite.dir)
- download_path = super(PackedResourceLibrary, self).get_path(resolve)
- if resolve and self._check_extract_needed(extract_path, download_path):
- extract_path_tmp = tempfile.mkdtemp(suffix=basename(extract_path), dir=dirname(extract_path))
- try:
- # extract archive
- Extractor.create(download_path).extract(extract_path_tmp)
- # ensure modification time is up to date
- os.utime(extract_path_tmp, None)
- logv("Moving temporary directory {} to {}".format(extract_path_tmp, extract_path))
- try:
- # attempt atomic overwrite
- os.rename(extract_path_tmp, extract_path)
- except OSError:
- # clean destination & re-try for cases where atomic overwrite doesn't work
- rmtree(extract_path, ignore_errors=True)
- os.rename(extract_path_tmp, extract_path)
- except OSError as ose:
- # Rename failed. Race with other process?
- if self._check_extract_needed(extract_path, download_path):
- # ok something really went wrong
- abort("Extracting {} failed!".format(download_path), context=ose)
- finally:
- rmtree(extract_path_tmp, ignore_errors=True)
-
return extract_path
def _check_download_needed(self):
@@ -8430,7 +8318,7 @@ class VC(_with_metaclass(ABCMeta, object)):
:param str branch: a branch name
:param bool abortOnError: if True abort on error
"""
- abort(self.kind + " update_to_branch is not implemented")
+ self.run(['hg', vcdir] + cmd)
def is_release_from_tags(self, vcdir, prefix):
"""
@@ -8831,7 +8719,7 @@ class HgConfig(VC):
return None
def parent_info(self, vcdir, abortOnError=True):
- out = self.hg_command(vcdir, ["log", "-r", ".", "--template", "{author}|||{date|hgdate}"], abortOnError=abortOnError)
+ out = _check_output_str(["hg", '-R', vcdir, "log", "-r", ".", "--template", "{author}|||{date|hgdate}"])
author, date = out.split("|||")
ts, _ = date.split(" ")
return self._sanitize_parent_info({
@@ -14069,6 +13957,7 @@ class Archiver(SafeFileCreation):
def _add_zip(self, filename, archive_name, provenance):
self._add_provenance(archive_name, provenance)
+ os.utime(filename, (315532800, 315532800))
self.zf.write(filename, archive_name)
def _add_str_zip(self, data, archive_name, provenance):