Skip to content

Commit ebcfa7c

Browse files
committed
Optimizing build scripts
1 parent 2ac7992 commit ebcfa7c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

script/build_spec.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]:
2020

2121
root = os.path.dirname(os.path.dirname(__file__))
2222
os.chdir(root)
23+
wast2json = f'{root}/res/wabt/bin/wast2json'
24+
2325

2426
with cd('res'):
2527
if not os.path.exists('spec'):
@@ -32,7 +34,7 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]:
3234
call('git checkout fffc6e12fa454e475455a7b58d3b5dc343980c10')
3335
with cd('res/spec/test/core'):
3436
for e in sorted(glob.glob('*.wast')):
35-
call(f'{root}/res/wabt/bin/wast2json {e}')
37+
call(f'{wast2json} {e}')
3638
with cd('res/spec/test/core/simd'):
3739
for e in sorted(glob.glob('*.wast')):
38-
call(f'{root}/res/wabt/bin/wast2json {e}')
40+
call(f'{wast2json} {e}')

script/build_wabt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]:
2020
os.chdir(cwd)
2121

2222

23+
root = os.path.dirname(os.path.dirname(__file__))
24+
os.chdir(root)
25+
2326
version = '1.0.37'
2427
url = ''
2528
match platform.system().lower():

script/build_wasi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ def cd(dst: str) -> typing.Generator[None, typing.Any, None]:
1717
os.chdir(cwd)
1818

1919

20+
root = os.path.dirname(os.path.dirname(__file__))
21+
os.chdir(root)
22+
2023
with cd('res'):
2124
if not os.path.exists('wasi-testsuite'):
2225
call('git clone --branch prod/testsuite-base https://github.com/WebAssembly/wasi-testsuite')

0 commit comments

Comments
 (0)