From 58be64a9b1f00d399383852a858df7e514d7b535 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 14:14:24 -0800 Subject: print check.py warnings at the end, where they have a chance to be noticed --- check.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index 15804b53e..acc4c926e 100755 --- a/check.py +++ b/check.py @@ -75,14 +75,16 @@ if len(requested) == 0: else: tests = requested[:] +warnings = [] + if not interpreter: - print 'warning: no interpreter provided (not testing spec interpreter validation)' + warnings.append('warning: no interpreter provided (not testing spec interpreter validation)') if not has_node: - print 'warning: no node found (not checking proper js form)' + warnings.append( 'warning: no node found (not checking proper js form)') if not has_mozjs: - print 'warning: no mozjs found (not checking asm.js validation)' + warnings.append( 'warning: no mozjs found (not checking asm.js validation)') if not has_emcc: - print 'warning: no emcc found (not checking emscripten/binaryen integration)' + warnings.append('warning: no emcc found (not checking emscripten/binaryen integration)') print '[ checking asm2wasm testcases... ]\n' @@ -432,3 +434,6 @@ if has_emcc: fail(out, expected) print '\n[ success! ]' + +if warnings: + print warnings -- cgit v1.2.3 From 0d9a88446723b5558ce0328e5fc6a8351c4ce457 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 14:35:22 -0800 Subject: wip waterfall build fetching --- check.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index acc4c926e..8e22453d4 100755 --- a/check.py +++ b/check.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, shutil, sys, subprocess, difflib, json, time +import os, shutil, sys, subprocess, difflib, json, time, urllib2 interpreter = None requested = [] @@ -86,6 +86,35 @@ if not has_mozjs: if not has_emcc: warnings.append('warning: no emcc found (not checking emscripten/binaryen integration)') +# setup + +WATERFALL_BUILD = os.path.join('test', 'waterfall_build') + +def fetch_waterfall(): + rev = open(os.path.join('test', 'revision')).read() + try: + local_rev = open(os.path.join('test', 'local-revision')).read() + except: + local_rev = None + if local_rev == rev: return + # fetch it + print '(downloading waterfall ' + rev + ')' + basename = 'wasm-binaries-' + rev + '.tbz2' + downloaded = urllib2.urlopen('https://storage.googleapis.com/wasm-llvm/builds/git/' + basename).read().strip() + fullname = os.path.join('test', basename) + open(fullname, 'wb').write(downloaded) + print '(unpacking)' + if os.path.exists(WATERFALL_BUILD): + shutil.rmtree(WATERFALL_BUILD) + os.mkdir(WATERFALL_BUILD) + subprocess.check_call(['tar', '-xvf', os.path.abspath(fullname)], cwd=WATERFALL_BUILD) + print '(noting local revision)' + open(os.path.join('test', 'local-revision'), 'w').write(rev) + +fetch_waterfall() + +# tests + print '[ checking asm2wasm testcases... ]\n' for asm in tests: -- cgit v1.2.3 From 0284de4884e77a63eeb23fcde5174d173dab9101 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 17:08:39 -0800 Subject: move wasm-backend tests to use emcc from emscripten submodule --- check.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index 8e22453d4..ab72aa980 100755 --- a/check.py +++ b/check.py @@ -348,6 +348,23 @@ for wast in tests: if actual != expected: fail(actual, expected) +print '\n[ checking emcc WASM_BACKEND testcases... ]\n' + +for c in sorted(os.listdir(os.path.join('test', 'wasm_backend'))): + if not c.endswith('cpp'): continue + print '..', c + base = c.replace('.cpp', '').replace('.c', '') + expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read() + command = [os.path.join('test', 'emscripten', 'emcc'), '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'WASM_BACKEND=1', '-s', 'ONLY_MY_CODE=1'] + print '....' + ' '.join(command) + subprocess.check_call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if has_node: + proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE) + out, err = proc.communicate() + assert proc.returncode == 0 + if out.strip() != expected.strip(): + fail(out, expected) + print '\n[ checking example testcases... ]\n' cmd = [os.environ.get('CXX') or 'g++', '-std=c++11', os.path.join('test', 'example', 'find_div0s.cpp'), '-Isrc', '-g', '-lsupport', '-Llib/.'] @@ -404,23 +421,6 @@ if has_emcc: assert proc.returncode != 0 assert 'hello, world!' not in out - print '\n[ checking emcc WASM_BACKEND testcases... ]\n' - - for c in sorted(os.listdir(os.path.join('test', 'wasm_backend'))): - if not c.endswith('cpp'): continue - print '..', c - base = c.replace('.cpp', '').replace('.c', '') - expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read() - command = ['emcc', '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'WASM_BACKEND=1', '-s', 'ONLY_MY_CODE=1'] - print '....' + ' '.join(command) - subprocess.check_call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - if has_node: - proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE) - out, err = proc.communicate() - assert proc.returncode == 0 - if out.strip() != expected.strip(): - fail(out, expected) - print '\n[ checking wasm.js testcases... ]\n' for c in tests: -- cgit v1.2.3 From d0876f3fef94b59ae1bc3803c3c500529a846e56 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 17:12:27 -0800 Subject: set LLVM env var, so emcc can find the waterfall llvm build --- check.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index ab72aa980..0867c2fa7 100755 --- a/check.py +++ b/check.py @@ -111,7 +111,11 @@ def fetch_waterfall(): print '(noting local revision)' open(os.path.join('test', 'local-revision'), 'w').write(rev) +def setup_waterfall(): + os.environ['LLVM'] = os.path.abspath(os.path.join(WATERFALL_BUILD, 'llvm-install', 'bin')) + fetch_waterfall() +setup_waterfall() # tests @@ -357,7 +361,7 @@ for c in sorted(os.listdir(os.path.join('test', 'wasm_backend'))): expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read() command = [os.path.join('test', 'emscripten', 'emcc'), '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'WASM_BACKEND=1', '-s', 'ONLY_MY_CODE=1'] print '....' + ' '.join(command) - subprocess.check_call(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + subprocess.check_call(command) if has_node: proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE) out, err = proc.communicate() -- cgit v1.2.3 From 106dad088baedf7847c4d2f4cfec9a3afd24032c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 17:13:02 -0800 Subject: improve check.py warnings --- check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index 0867c2fa7..b5c6e888e 100755 --- a/check.py +++ b/check.py @@ -469,4 +469,4 @@ if has_emcc: print '\n[ success! ]' if warnings: - print warnings + print '\n' + '\n'.join(warnings) -- cgit v1.2.3 From f0199de2037543538441b2ea532f7329b6b8a6e0 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 17:20:43 -0800 Subject: if we can't use the waterfall llvm, avoid it, but warn --- check.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index b5c6e888e..9e2f60863 100755 --- a/check.py +++ b/check.py @@ -112,7 +112,13 @@ def fetch_waterfall(): open(os.path.join('test', 'local-revision'), 'w').write(rev) def setup_waterfall(): - os.environ['LLVM'] = os.path.abspath(os.path.join(WATERFALL_BUILD, 'llvm-install', 'bin')) + # if we can use the waterfall llvm, do so + LLVM_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD, 'llvm-install', 'bin')) + try: + subprocess.check_call([os.path.join(LLVM_DIR, 'clang'), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + os.environ['LLVM'] = LLVM_DIR + except: + warnings.append('could not run LLVM from waterfall, using emcc default') fetch_waterfall() setup_waterfall() -- cgit v1.2.3 From 4da9d3c3a4494f588d174a6f988fd67bf6334ed2 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 17:21:31 -0800 Subject: improve warning text --- check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index 9e2f60863..919324a49 100755 --- a/check.py +++ b/check.py @@ -84,7 +84,7 @@ if not has_node: if not has_mozjs: warnings.append( 'warning: no mozjs found (not checking asm.js validation)') if not has_emcc: - warnings.append('warning: no emcc found (not checking emscripten/binaryen integration)') + warnings.append('warning: no emcc found (not checking non-vanilla emscripten/binaryen integration)') # setup -- cgit v1.2.3 From 268175dc4bbeeb682e015ff6330b08e1ddfb405c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 17:22:10 -0800 Subject: english grammar fixes --- check.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index 919324a49..d5fb672ba 100755 --- a/check.py +++ b/check.py @@ -78,13 +78,13 @@ else: warnings = [] if not interpreter: - warnings.append('warning: no interpreter provided (not testing spec interpreter validation)') + warnings.append('warning: no interpreter provided (did not test spec interpreter validation)') if not has_node: - warnings.append( 'warning: no node found (not checking proper js form)') + warnings.append( 'warning: no node found (did not check proper js form)') if not has_mozjs: - warnings.append( 'warning: no mozjs found (not checking asm.js validation)') + warnings.append( 'warning: no mozjs found (did not check asm.js validation)') if not has_emcc: - warnings.append('warning: no emcc found (not checking non-vanilla emscripten/binaryen integration)') + warnings.append('warning: no emcc found (did not check non-vanilla emscripten/binaryen integration)') # setup -- cgit v1.2.3 From 3b4af6bab9b92c6639e56c0e3ad88afef0575517 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 19:39:58 -0800 Subject: use WASM_BACKEND in the env now, per new emscripten --- check.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index d5fb672ba..a7447fae1 100755 --- a/check.py +++ b/check.py @@ -360,20 +360,24 @@ for wast in tests: print '\n[ checking emcc WASM_BACKEND testcases... ]\n' -for c in sorted(os.listdir(os.path.join('test', 'wasm_backend'))): - if not c.endswith('cpp'): continue - print '..', c - base = c.replace('.cpp', '').replace('.c', '') - expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read() - command = [os.path.join('test', 'emscripten', 'emcc'), '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'WASM_BACKEND=1', '-s', 'ONLY_MY_CODE=1'] - print '....' + ' '.join(command) - subprocess.check_call(command) - if has_node: - proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE) - out, err = proc.communicate() - assert proc.returncode == 0 - if out.strip() != expected.strip(): - fail(out, expected) +os.environ['WASM_BACKEND'] = '1' +try: + for c in sorted(os.listdir(os.path.join('test', 'wasm_backend'))): + if not c.endswith('cpp'): continue + print '..', c + base = c.replace('.cpp', '').replace('.c', '') + expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read() + command = [os.path.join('test', 'emscripten', 'emcc'), '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'ONLY_MY_CODE=1'] + print '....' + ' '.join(command) + subprocess.check_call(command) + if has_node: + proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE) + out, err = proc.communicate() + assert proc.returncode == 0 + if out.strip() != expected.strip(): + fail(out, expected) +finally: + del os.environ['WASM_BACKEND'] print '\n[ checking example testcases... ]\n' -- cgit v1.2.3 From 455eff4d01b5b9502ef66a220bacb58e77ed1fe0 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 19:45:10 -0800 Subject: mention checking in node --- check.py | 1 + 1 file changed, 1 insertion(+) (limited to 'check.py') diff --git a/check.py b/check.py index a7447fae1..c87b94651 100755 --- a/check.py +++ b/check.py @@ -371,6 +371,7 @@ try: print '....' + ' '.join(command) subprocess.check_call(command) if has_node: + print ' (check in node)' proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE) out, err = proc.communicate() assert proc.returncode == 0 -- cgit v1.2.3 From 19fa7c8e14844f7a25c2ef143cb89464d639c8a9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 19:45:55 -0800 Subject: make sure a.wasm.js is emitted by the backend tests --- check.py | 1 + 1 file changed, 1 insertion(+) (limited to 'check.py') diff --git a/check.py b/check.py index c87b94651..eb75b4585 100755 --- a/check.py +++ b/check.py @@ -369,6 +369,7 @@ try: expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read() command = [os.path.join('test', 'emscripten', 'emcc'), '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'ONLY_MY_CODE=1'] print '....' + ' '.join(command) + if os.path.exists('a.wasm.js'): os.unlink('a.wasm.js') subprocess.check_call(command) if has_node: print ' (check in node)' -- cgit v1.2.3 From 4de7679d71fe4ed87bff14eebf5b1dcc9b0f76ec Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 19:47:45 -0800 Subject: run vanilla emcc to make sure it's set up properly, if it was never run before --- check.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index eb75b4585..f0bd6cf61 100755 --- a/check.py +++ b/check.py @@ -362,12 +362,18 @@ print '\n[ checking emcc WASM_BACKEND testcases... ]\n' os.environ['WASM_BACKEND'] = '1' try: + VANILLA_EMCC = os.path.join('test', 'emscripten', 'emcc') + # run emcc to make sure it sets itself up properly, if it was never run before + command = [VANILLA_EMCC, '-v'] + print '____' + ' '.join(command) + subprocess.check_call(command) + for c in sorted(os.listdir(os.path.join('test', 'wasm_backend'))): if not c.endswith('cpp'): continue print '..', c base = c.replace('.cpp', '').replace('.c', '') expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read() - command = [os.path.join('test', 'emscripten', 'emcc'), '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'ONLY_MY_CODE=1'] + command = [VANILLA_EMCC, '-o', 'a.wasm.js', '-s', 'BINARYEN="' + os.getcwd() + '"', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'ONLY_MY_CODE=1'] print '....' + ' '.join(command) if os.path.exists('a.wasm.js'): os.unlink('a.wasm.js') subprocess.check_call(command) -- cgit v1.2.3 From 0f72c9053c64188ad8c5b0500f5fb8918f5b08af Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 19:49:42 -0800 Subject: print contents of LLVM env var --- check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index f0bd6cf61..dd209c2e0 100755 --- a/check.py +++ b/check.py @@ -358,7 +358,7 @@ for wast in tests: if actual != expected: fail(actual, expected) -print '\n[ checking emcc WASM_BACKEND testcases... ]\n' +print '\n[ checking emcc WASM_BACKEND testcases... (llvm: %s)]\n' % (os.environ.get('LLVM') or 'NULL') os.environ['WASM_BACKEND'] = '1' try: -- cgit v1.2.3 From 3a51b0a4553b1d98ecec232593dc02d5db8e7259 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 20:20:56 -0800 Subject: look for node as either nodejs or node --- check.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index dd209c2e0..d3845d04a 100755 --- a/check.py +++ b/check.py @@ -37,9 +37,13 @@ for arg in sys.argv[1:]: has_node = False try: subprocess.check_call(['nodejs', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - has_node = True + has_node = 'nodejs' except: - pass + try: + subprocess.check_call(['node', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + has_node = 'node' + except: + pass has_mozjs = False try: @@ -259,7 +263,7 @@ for wasm in tests + [os.path.join('spec', name) for name in ['address.wast']]:#s if has_node: # verify asm.js is valid js - proc = subprocess.Popen(['nodejs', 'a.2asm.js'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen([has_node, 'a.2asm.js'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = proc.communicate() assert proc.returncode == 0 assert not out and not err, [out, err] @@ -379,7 +383,7 @@ try: subprocess.check_call(command) if has_node: print ' (check in node)' - proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE) + proc = subprocess.Popen([has_node, 'a.wasm.js'], stdout=subprocess.PIPE) out, err = proc.communicate() assert proc.returncode == 0 if out.strip() != expected.strip(): @@ -434,7 +438,7 @@ if has_emcc: else: 1/0 if has_node: - proc = subprocess.Popen(['nodejs', 'a.wasm.js'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen([has_node, 'a.wasm.js'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = proc.communicate() if success: assert proc.returncode == 0 @@ -478,7 +482,7 @@ if has_emcc: args = [] print ' (no args)' if has_node: - proc = subprocess.Popen(['nodejs', 'a.' + which + '.js'] + args, stdout=subprocess.PIPE) + proc = subprocess.Popen([has_node, 'a.' + which + '.js'] + args, stdout=subprocess.PIPE) out, err = proc.communicate() assert proc.returncode == 0 if out.strip() != expected.strip(): -- cgit v1.2.3 From 6f693f31c1e4f2f15ca5bb93ca426ca8c340f460 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 16 Jan 2016 10:47:19 -0800 Subject: no need to set env var for emcc if using vanilla llvm --- check.py | 9 +++++++-- test/emscripten | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index d3845d04a..87aa484f7 100755 --- a/check.py +++ b/check.py @@ -364,7 +364,11 @@ for wast in tests: print '\n[ checking emcc WASM_BACKEND testcases... (llvm: %s)]\n' % (os.environ.get('LLVM') or 'NULL') -os.environ['WASM_BACKEND'] = '1' +# if we did not set vanilla llvm, then we must set this env var to make emcc use the wasm backend. +# or, if we are using vanilla llvm, things should just work. +if not os.environ.get('LLVM'): + print '(not using vanilla llvm, so settng env var to tell emcc to use wasm backend)' + os.environ['EMCC_WASM_BACKEND'] = '1' try: VANILLA_EMCC = os.path.join('test', 'emscripten', 'emcc') # run emcc to make sure it sets itself up properly, if it was never run before @@ -389,7 +393,8 @@ try: if out.strip() != expected.strip(): fail(out, expected) finally: - del os.environ['WASM_BACKEND'] + if not os.environ.get('LLVM'): + del os.environ['EMCC_WASM_BACKEND'] print '\n[ checking example testcases... ]\n' diff --git a/test/emscripten b/test/emscripten index 6cd62f4b1..7aa4b801d 160000 --- a/test/emscripten +++ b/test/emscripten @@ -1 +1 @@ -Subproject commit 6cd62f4b12ffaf6b06b5c30cf1d273d5c686a0af +Subproject commit 7aa4b801d7462a07f523bd0c30f71c45044944ad -- cgit v1.2.3 From 1c4f49e8e94d888feceeac9e920386914c0fd1d5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 16 Jan 2016 16:28:26 -0800 Subject: refactor code to use #117 --- check.py | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index 87aa484f7..49434865c 100755 --- a/check.py +++ b/check.py @@ -16,6 +16,9 @@ import os, shutil, sys, subprocess, difflib, json, time, urllib2 +import scripts.storage +import scripts.support + interpreter = None requested = [] torture = True @@ -92,35 +95,24 @@ if not has_emcc: # setup -WATERFALL_BUILD = os.path.join('test', 'waterfall_build') +BASE_DIR = os.path.abspath('test') +WATERFALL_BUILD_DIR = os.path.join(BASE_DIR, 'wasm-install') +BIN_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD_DIR, 'bin')) def fetch_waterfall(): rev = open(os.path.join('test', 'revision')).read() - try: - local_rev = open(os.path.join('test', 'local-revision')).read() - except: - local_rev = None - if local_rev == rev: return + if os.path.exists(os.path.join(BASE_DIR, 'wasm-binaries-%s.tbz2' % rev)): return # fetch it print '(downloading waterfall ' + rev + ')' - basename = 'wasm-binaries-' + rev + '.tbz2' - downloaded = urllib2.urlopen('https://storage.googleapis.com/wasm-llvm/builds/git/' + basename).read().strip() - fullname = os.path.join('test', basename) - open(fullname, 'wb').write(downloaded) - print '(unpacking)' - if os.path.exists(WATERFALL_BUILD): - shutil.rmtree(WATERFALL_BUILD) - os.mkdir(WATERFALL_BUILD) - subprocess.check_call(['tar', '-xvf', os.path.abspath(fullname)], cwd=WATERFALL_BUILD) - print '(noting local revision)' - open(os.path.join('test', 'local-revision'), 'w').write(rev) + basename = 'wasm-binaries-%s.tbz2' + downloaded = scripts.storage.download_tar(basename, BASE_DIR, rev) + scripts.support.untar(downloaded, WATERFALL_BUILD_DIR) def setup_waterfall(): # if we can use the waterfall llvm, do so - LLVM_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD, 'llvm-install', 'bin')) try: - subprocess.check_call([os.path.join(LLVM_DIR, 'clang'), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - os.environ['LLVM'] = LLVM_DIR + subprocess.check_call([os.path.join(BIN_DIR, 'clang'), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + os.environ['LLVM'] = BIN_DIR except: warnings.append('could not run LLVM from waterfall, using emcc default') -- cgit v1.2.3 From c2b77f33023d7946c8024cdc81428b4880c4b44c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 16 Jan 2016 19:36:41 -0800 Subject: improve warnings in check.py --- check.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index 49434865c..482556647 100755 --- a/check.py +++ b/check.py @@ -84,14 +84,19 @@ else: warnings = [] +def warn(text): + global warnings + warnings.append(text) + print 'warning:', text + if not interpreter: - warnings.append('warning: no interpreter provided (did not test spec interpreter validation)') + warn('no interpreter provided (did not test spec interpreter validation)') if not has_node: - warnings.append( 'warning: no node found (did not check proper js form)') + warn('no node found (did not check proper js form)') if not has_mozjs: - warnings.append( 'warning: no mozjs found (did not check asm.js validation)') + warn('no mozjs found (did not check asm.js validation)') if not has_emcc: - warnings.append('warning: no emcc found (did not check non-vanilla emscripten/binaryen integration)') + warn('no emcc found (did not check non-vanilla emscripten/binaryen integration)') # setup @@ -114,7 +119,7 @@ def setup_waterfall(): subprocess.check_call([os.path.join(BIN_DIR, 'clang'), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) os.environ['LLVM'] = BIN_DIR except: - warnings.append('could not run LLVM from waterfall, using emcc default') + warn('could not run vanilla LLVM from waterfall') fetch_waterfall() setup_waterfall() -- cgit v1.2.3 From 8d2e027a90399020f20e15076f911ee27767da9a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 16 Jan 2016 19:46:07 -0800 Subject: update waterfall build dir --- check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index 482556647..a96910f7e 100755 --- a/check.py +++ b/check.py @@ -102,7 +102,7 @@ if not has_emcc: BASE_DIR = os.path.abspath('test') WATERFALL_BUILD_DIR = os.path.join(BASE_DIR, 'wasm-install') -BIN_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD_DIR, 'bin')) +BIN_DIR = os.path.abspath(os.path.join(BASE_DIR, 'waterfall_build', 'llvm-install', 'bin')) def fetch_waterfall(): rev = open(os.path.join('test', 'revision')).read() @@ -118,8 +118,8 @@ def setup_waterfall(): try: subprocess.check_call([os.path.join(BIN_DIR, 'clang'), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) os.environ['LLVM'] = BIN_DIR - except: - warn('could not run vanilla LLVM from waterfall') + except Exception, e: + warn('could not run vanilla LLVM from waterfall: ' + str(e)) fetch_waterfall() setup_waterfall() -- cgit v1.2.3 From e324eeb799d94645baa497731d82b46624494599 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 16 Jan 2016 20:04:15 -0800 Subject: improve clang checking reporting --- check.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index a96910f7e..44e6c9a50 100755 --- a/check.py +++ b/check.py @@ -102,7 +102,7 @@ if not has_emcc: BASE_DIR = os.path.abspath('test') WATERFALL_BUILD_DIR = os.path.join(BASE_DIR, 'wasm-install') -BIN_DIR = os.path.abspath(os.path.join(BASE_DIR, 'waterfall_build', 'llvm-install', 'bin')) +BIN_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD_DIR, 'bin')) def fetch_waterfall(): rev = open(os.path.join('test', 'revision')).read() @@ -115,11 +115,12 @@ def fetch_waterfall(): def setup_waterfall(): # if we can use the waterfall llvm, do so + CLANG = os.path.join(BIN_DIR, 'clang') try: - subprocess.check_call([os.path.join(BIN_DIR, 'clang'), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + subprocess.check_call([CLANG, '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) os.environ['LLVM'] = BIN_DIR except Exception, e: - warn('could not run vanilla LLVM from waterfall: ' + str(e)) + warn('could not run vanilla LLVM from waterfall: ' + str(e) + ', looked for clang at ' + CLANG) fetch_waterfall() setup_waterfall() -- cgit v1.2.3 From eb9d676d358ce154d56aca5162e9f8f5c4d04ad6 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 17 Jan 2016 10:40:14 -0800 Subject: try untar() on the base dir, because it doesn't like the full target dir --- check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index 44e6c9a50..77080f869 100755 --- a/check.py +++ b/check.py @@ -111,7 +111,7 @@ def fetch_waterfall(): print '(downloading waterfall ' + rev + ')' basename = 'wasm-binaries-%s.tbz2' downloaded = scripts.storage.download_tar(basename, BASE_DIR, rev) - scripts.support.untar(downloaded, WATERFALL_BUILD_DIR) + scripts.support.untar(downloaded, BASE_DIR) def setup_waterfall(): # if we can use the waterfall llvm, do so -- cgit v1.2.3 From a2acebabb40b09ae2d0c2dc3c49a2d445754fe61 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Sun, 17 Jan 2016 11:42:01 -0800 Subject: Fix untar usage --- .gitignore | 2 ++ check.py | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'check.py') diff --git a/.gitignore b/.gitignore index 7b59d4c76..38319bc5e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,6 @@ cmake_install.cmake *.ninja .ninja_deps .ninja_log +test/wasm-binaries-*.tbz2 test/wasm-torture-s-*.tbz2 +test/wasm-install/ diff --git a/check.py b/check.py index 77080f869..5e193b15d 100755 --- a/check.py +++ b/check.py @@ -103,15 +103,15 @@ if not has_emcc: BASE_DIR = os.path.abspath('test') WATERFALL_BUILD_DIR = os.path.join(BASE_DIR, 'wasm-install') BIN_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD_DIR, 'bin')) +WASM_BINARIES = 'wasm-binaries-%s.tbz2' def fetch_waterfall(): + """Returns True if new binaries were installed.""" rev = open(os.path.join('test', 'revision')).read() - if os.path.exists(os.path.join(BASE_DIR, 'wasm-binaries-%s.tbz2' % rev)): return - # fetch it - print '(downloading waterfall ' + rev + ')' - basename = 'wasm-binaries-%s.tbz2' - downloaded = scripts.storage.download_tar(basename, BASE_DIR, rev) - scripts.support.untar(downloaded, BASE_DIR) + downloaded = scripts.storage.download_tar(WASM_BINARIES, BASE_DIR, rev) + if not os.path.isdir(WATERFALL_BUILD_DIR): + os.mkdir(WATERFALL_BUILD_DIR) + return scripts.support.untar(downloaded, BASE_DIR) def setup_waterfall(): # if we can use the waterfall llvm, do so -- cgit v1.2.3 From 9877cd7629d9346b6e4e4c74eeada7baa161c692 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 17 Jan 2016 17:00:54 -0800 Subject: go back to simpler method of getting waterfall in check.py, we'll refactor later once the shared api stabilizes --- check.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index 5e193b15d..19b4c23b0 100755 --- a/check.py +++ b/check.py @@ -102,16 +102,28 @@ if not has_emcc: BASE_DIR = os.path.abspath('test') WATERFALL_BUILD_DIR = os.path.join(BASE_DIR, 'wasm-install') -BIN_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD_DIR, 'bin')) -WASM_BINARIES = 'wasm-binaries-%s.tbz2' +BIN_DIR = os.path.abspath(os.path.join(WATERFALL_BUILD_DIR, 'wasm-install', 'bin')) def fetch_waterfall(): - """Returns True if new binaries were installed.""" rev = open(os.path.join('test', 'revision')).read() - downloaded = scripts.storage.download_tar(WASM_BINARIES, BASE_DIR, rev) - if not os.path.isdir(WATERFALL_BUILD_DIR): - os.mkdir(WATERFALL_BUILD_DIR) - return scripts.support.untar(downloaded, BASE_DIR) + try: + local_rev = open(os.path.join('test', 'local-revision')).read() + except: + local_rev = None + if local_rev == rev: return + # fetch it + print '(downloading waterfall ' + rev + ')' + basename = 'wasm-binaries-' + rev + '.tbz2' + downloaded = urllib2.urlopen('https://storage.googleapis.com/wasm-llvm/builds/git/' + basename).read().strip() + fullname = os.path.join('test', basename) + open(fullname, 'wb').write(downloaded) + print '(unpacking)' + if os.path.exists(WATERFALL_BUILD_DIR): + shutil.rmtree(WATERFALL_BUILD_DIR) + os.mkdir(WATERFALL_BUILD_DIR) + subprocess.check_call(['tar', '-xvf', os.path.abspath(fullname)], cwd=WATERFALL_BUILD_DIR) + print '(noting local revision)' + open(os.path.join('test', 'local-revision'), 'w').write(rev) def setup_waterfall(): # if we can use the waterfall llvm, do so -- cgit v1.2.3