Update default emscripten cache directory (#501)

See: https://github.com/WebAssembly/waterfall/pull/644

For the sake of older versions of emscripten explicitly set
EM_CACHE environment variable to point to the in-tree cache
directory.
This commit is contained in:
Sam Clegg
2020-05-13 19:28:49 -04:00
committed by GitHub
parent 7e22ab8ae0
commit 14c0a9ec21
3 changed files with 31 additions and 23 deletions

View File

@@ -80,8 +80,7 @@ int main() {
TAGS = json.loads(open('emscripten-releases-tags.txt').read())
DEFAULT_CACHE = os.path.expanduser('~/.emscripten_cache')
LIBC = os.environ.get('EM_CACHE', DEFAULT_CACHE) + '/wasm/libc.a'
LIBC = os.environ['EM_CACHE'] + '/wasm/libc.a'
# Tests
@@ -158,12 +157,10 @@ checked_call_with_output(emsdk + ' install node-12.9.1-64bit', unexpected='Downl
print('test tot-upstream')
run_emsdk('install tot-upstream')
assert not os.path.exists(LIBC)
old_config = open(emconfig).read()
run_emsdk('activate tot-upstream')
assert old_config == open(emconfig + '.old').read()
# TODO; test on latest as well
assert os.path.exists(LIBC), 'activation supplies prebuilt libc'
check_call(upstream_emcc + ' hello_world.c')
print('test tot-fastcomp')