From 87285f5e8f58211239862df1c5d7c73d9df6b7f6 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 15 Jun 2019 12:00:54 -0700 Subject: [PATCH] 1.38.36 ; Check if all downloads exist for the latest version (#278) This verifies all builders successfully uploaded builds for a new version that we tag here. This prevents a problem like happend on 1.38.35, where the mac and windows bots "skipped" the hash that we tagged - they built the one before, and I guess were too slow, so they skipped to the next commit after it? Which is expected I guess, but surprises me a little. Anyhow, with this fix we should avoid such problems in the future. Tags 1.38.36 to verify things work and get people a working version. Also check some other basic things: check the version built reports the right one in emcc -v, and that multiple emsdk updates still work. --- emscripten-releases-tags.txt | 3 ++- test.py | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/emscripten-releases-tags.txt b/emscripten-releases-tags.txt index 849c109..1560697 100644 --- a/emscripten-releases-tags.txt +++ b/emscripten-releases-tags.txt @@ -1,6 +1,7 @@ { - "latest": "1.38.35", + "latest": "1.38.36", "releases": { + "1.38.36": "d46be49c2aab975333423122239892bd46f52bba", "1.38.35": "98f49919f25e06fa557cbcb1321d4c10e60c87ca", "1.38.34": "048cf9424790cc525a7ea6da340820aae226f3b9", "1.38.33": "3b8cff670e9233a6623563add831647e8689a86b" diff --git a/test.py b/test.py index eed2ed1..2a20bf3 100644 --- a/test.py +++ b/test.py @@ -1,3 +1,4 @@ +import json import os import shutil import subprocess @@ -9,6 +10,12 @@ import tempfile def check_call(cmd): subprocess.check_call(cmd.split(' ')) +def checked_call_with_output(cmd, expected, stderr=None): + proc = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE, stderr=stderr) + stdout, stderr = proc.communicate() + assert not proc.returncode, 'call must have succeeded' + assert expected in (stdout + stderr), 'call did not have the right output: ' + stdout + stderr + def failing_call_with_output(cmd, expected): proc = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE) stdout, stderr = proc.communicate() @@ -27,6 +34,8 @@ def hack_emsdk(marker, replacement): open('hello_world.cpp', 'w').write('int main() {}') +TAGS = json.loads(open('emscripten-releases-tags.txt').read()) + # Tests print('update') @@ -44,6 +53,9 @@ assert open(os.path.expanduser('~/.emscripten')).read().count('LLVM_ROOT') == 1 assert 'upstream' in open(os.path.expanduser('~/.emscripten')).read() assert 'fastcomp' not in open(os.path.expanduser('~/.emscripten')).read() +print('verify version') +checked_call_with_output('upstream/emscripten/emcc -v', TAGS['latest'], stderr=subprocess.PIPE) + print('test tot-upstream') check_call('./emsdk install tot-upstream') check_call('./emsdk activate tot-upstream') @@ -89,5 +101,18 @@ for filename in os.listdir('.'): os.chdir(temp_dir) +check_call('python ./emsdk update') +print('second time') check_call('python ./emsdk update') +print('verify downloads exist for all OSes') +latest_hash = TAGS['releases'][TAGS['latest']] +for os, suffix in [ + ('linux', 'tbz2'), + ('mac', 'tbz2'), + ('win', 'zip') +]: + url = 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/%s/%s/wasm-binaries.%s' % (os, latest_hash, suffix) + print(' url: ' + url), + check_call('wget ' + url) +