diff --git a/script/build_spec.py b/script/build_spec.py index 76b6d0d..5230edd 100644 --- a/script/build_spec.py +++ b/script/build_spec.py @@ -20,6 +20,8 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]: root = os.path.dirname(os.path.dirname(__file__)) os.chdir(root) +wast2json = f'{root}/res/wabt/bin/wast2json' + with cd('res'): if not os.path.exists('spec'): @@ -32,7 +34,7 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]: call('git checkout fffc6e12fa454e475455a7b58d3b5dc343980c10') with cd('res/spec/test/core'): for e in sorted(glob.glob('*.wast')): - call(f'{root}/res/wabt/bin/wast2json {e}') + call(f'{wast2json} {e}') with cd('res/spec/test/core/simd'): for e in sorted(glob.glob('*.wast')): - call(f'{root}/res/wabt/bin/wast2json {e}') + call(f'{wast2json} {e}') diff --git a/script/build_wabt.py b/script/build_wabt.py index 4a25949..375d71b 100644 --- a/script/build_wabt.py +++ b/script/build_wabt.py @@ -20,6 +20,9 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]: os.chdir(cwd) +root = os.path.dirname(os.path.dirname(__file__)) +os.chdir(root) + version = '1.0.37' url = '' match platform.system().lower(): diff --git a/script/build_wasi.py b/script/build_wasi.py index 5b53d0a..18fc44e 100644 --- a/script/build_wasi.py +++ b/script/build_wasi.py @@ -17,6 +17,9 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]: os.chdir(cwd) +root = os.path.dirname(os.path.dirname(__file__)) +os.chdir(root) + with cd('res'): if not os.path.exists('wasi-testsuite'): call('git clone --branch prod/testsuite-base https://github.com/WebAssembly/wasi-testsuite')