dart-sdk/tools/download_abi_dills.py

51 lines
1.2 KiB
Python
Raw Normal View History

# Downloads dill files from CIPD for each supported ABI version.
import os
import subprocess
import sys
import utils
Reland "[vm] Allow running with the latest ABI dill files." This reverts commit 69ff056b51c7712268b00e48acaf0a394f3535ba. Reason for revert: Relanding with fix. Original change's description: > Revert "[vm] Allow running with the latest ABI dill files." > > This reverts commit 35c4af445b8d14c7192ba58e71e6437b4b9b7584. > > Reason for revert: Broke a bunch of tests, eg: > https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917088905682853152/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0 > > Original change's description: > > [vm] Allow running with the latest ABI dill files. > > > > To support this, we need to download the current version during gclient > > sync, and change the way the --use-abi-version flag is processed so that > > there's a distinction between the current version and the flag being > > unset (-1). Also bump the oldest supported ABI version. > > > > Bug: https://github.com/dart-lang/sdk/issues/36047 > > Change-Id: If3fb5e1ba1ebddf11e9f0a9a7c42b7bb0b820ad8 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98609 > > Commit-Queue: Liam Appelbe <liama@google.com> > > Reviewed-by: Siva Annamalai <asiva@google.com> > > TBR=asiva@google.com,liama@google.com > > Change-Id: I40f83fcc7f9d785353fb05d4296376ec04af8309 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: https://github.com/dart-lang/sdk/issues/36047 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98700 > Reviewed-by: Liam Appelbe <liama@google.com> > Commit-Queue: Liam Appelbe <liama@google.com> TBR=asiva@google.com,liama@google.com Change-Id: I909fd649eb41911a7b15e682b669708ebe083c8e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: https://github.com/dart-lang/sdk/issues/36047 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98690 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Liam Appelbe <liama@google.com>
2019-04-04 22:45:25 +00:00
def procWait(p):
while p.returncode is None:
p.communicate()
p.poll()
return p.returncode
Reland "[vm] Allow running with the latest ABI dill files." This reverts commit 69ff056b51c7712268b00e48acaf0a394f3535ba. Reason for revert: Relanding with fix. Original change's description: > Revert "[vm] Allow running with the latest ABI dill files." > > This reverts commit 35c4af445b8d14c7192ba58e71e6437b4b9b7584. > > Reason for revert: Broke a bunch of tests, eg: > https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917088905682853152/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0 > > Original change's description: > > [vm] Allow running with the latest ABI dill files. > > > > To support this, we need to download the current version during gclient > > sync, and change the way the --use-abi-version flag is processed so that > > there's a distinction between the current version and the flag being > > unset (-1). Also bump the oldest supported ABI version. > > > > Bug: https://github.com/dart-lang/sdk/issues/36047 > > Change-Id: If3fb5e1ba1ebddf11e9f0a9a7c42b7bb0b820ad8 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98609 > > Commit-Queue: Liam Appelbe <liama@google.com> > > Reviewed-by: Siva Annamalai <asiva@google.com> > > TBR=asiva@google.com,liama@google.com > > Change-Id: I40f83fcc7f9d785353fb05d4296376ec04af8309 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: https://github.com/dart-lang/sdk/issues/36047 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98700 > Reviewed-by: Liam Appelbe <liama@google.com> > Commit-Queue: Liam Appelbe <liama@google.com> TBR=asiva@google.com,liama@google.com Change-Id: I909fd649eb41911a7b15e682b669708ebe083c8e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: https://github.com/dart-lang/sdk/issues/36047 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98690 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Liam Appelbe <liama@google.com>
2019-04-04 22:45:25 +00:00
def findAbiVersion(version):
cmd = ['cipd', 'instances', 'dart/abiversions/%d' % version]
p = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=utils.IsWindows(),
cwd=utils.DART_DIR)
return procWait(p) == 0
Reland "[vm] Allow running with the latest ABI dill files." This reverts commit 69ff056b51c7712268b00e48acaf0a394f3535ba. Reason for revert: Relanding with fix. Original change's description: > Revert "[vm] Allow running with the latest ABI dill files." > > This reverts commit 35c4af445b8d14c7192ba58e71e6437b4b9b7584. > > Reason for revert: Broke a bunch of tests, eg: > https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917088905682853152/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0 > > Original change's description: > > [vm] Allow running with the latest ABI dill files. > > > > To support this, we need to download the current version during gclient > > sync, and change the way the --use-abi-version flag is processed so that > > there's a distinction between the current version and the flag being > > unset (-1). Also bump the oldest supported ABI version. > > > > Bug: https://github.com/dart-lang/sdk/issues/36047 > > Change-Id: If3fb5e1ba1ebddf11e9f0a9a7c42b7bb0b820ad8 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98609 > > Commit-Queue: Liam Appelbe <liama@google.com> > > Reviewed-by: Siva Annamalai <asiva@google.com> > > TBR=asiva@google.com,liama@google.com > > Change-Id: I40f83fcc7f9d785353fb05d4296376ec04af8309 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: https://github.com/dart-lang/sdk/issues/36047 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98700 > Reviewed-by: Liam Appelbe <liama@google.com> > Commit-Queue: Liam Appelbe <liama@google.com> TBR=asiva@google.com,liama@google.com Change-Id: I909fd649eb41911a7b15e682b669708ebe083c8e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: https://github.com/dart-lang/sdk/issues/36047 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98690 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Liam Appelbe <liama@google.com>
2019-04-04 22:45:25 +00:00
def main():
abi_version = int(utils.GetAbiVersion())
oldest_abi_version = int(utils.GetOldestSupportedAbiVersion())
cmd = ['cipd', 'ensure', '-root', 'tools/abiversions', '-ensure-file', '-']
ensure_file = ''
for i in range(oldest_abi_version, abi_version + 1):
if findAbiVersion(i):
ensure_file += '@Subdir %d\ndart/abiversions/%d latest\n\n' % (i, i)
if not ensure_file:
return 0
p = subprocess.Popen(
cmd,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=utils.IsWindows(),
cwd=utils.DART_DIR)
p.communicate(ensure_file)
p.stdin.close()
return procWait(p)
Reland "[vm] Allow running with the latest ABI dill files." This reverts commit 69ff056b51c7712268b00e48acaf0a394f3535ba. Reason for revert: Relanding with fix. Original change's description: > Revert "[vm] Allow running with the latest ABI dill files." > > This reverts commit 35c4af445b8d14c7192ba58e71e6437b4b9b7584. > > Reason for revert: Broke a bunch of tests, eg: > https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917088905682853152/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0 > > Original change's description: > > [vm] Allow running with the latest ABI dill files. > > > > To support this, we need to download the current version during gclient > > sync, and change the way the --use-abi-version flag is processed so that > > there's a distinction between the current version and the flag being > > unset (-1). Also bump the oldest supported ABI version. > > > > Bug: https://github.com/dart-lang/sdk/issues/36047 > > Change-Id: If3fb5e1ba1ebddf11e9f0a9a7c42b7bb0b820ad8 > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98609 > > Commit-Queue: Liam Appelbe <liama@google.com> > > Reviewed-by: Siva Annamalai <asiva@google.com> > > TBR=asiva@google.com,liama@google.com > > Change-Id: I40f83fcc7f9d785353fb05d4296376ec04af8309 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: https://github.com/dart-lang/sdk/issues/36047 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98700 > Reviewed-by: Liam Appelbe <liama@google.com> > Commit-Queue: Liam Appelbe <liama@google.com> TBR=asiva@google.com,liama@google.com Change-Id: I909fd649eb41911a7b15e682b669708ebe083c8e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: https://github.com/dart-lang/sdk/issues/36047 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98690 Commit-Queue: Liam Appelbe <liama@google.com> Reviewed-by: Liam Appelbe <liama@google.com>
2019-04-04 22:45:25 +00:00
if __name__ == '__main__':
sys.exit(main())