Skip to content

Commit d689a4b

Browse files
committed
tools: workaround compilation regression of compile time checks in install_wabt.vsh; cleanup
1 parent 15deb59 commit d689a4b

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

cmd/tools/install_wabt.vsh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,46 @@
33
import os
44
import net.http
55

6-
const root = @VROOT
7-
86
fn main() {
9-
os.chdir(root)! // make sure that the workfolder is stable
10-
11-
tloc := os.join_path(root, 'thirdparty')
7+
os.chdir(@VROOT)! // make sure that the workfolder is stable
8+
tloc := os.join_path(@VROOT, 'thirdparty')
129
loc := os.join_path(tloc, 'wabt')
13-
1410
if os.exists(loc) {
1511
eprintln('thirdparty/wabt exists, will not overwrite')
1612
eprintln('delete the folder, and execute again')
1713
exit(1)
1814
}
1915
tag := '1.0.32'
2016
fname := 'wabt-${tag}'
21-
platform := $if windows {
22-
'windows'
17+
mut platform := ''
18+
$if windows {
19+
platform = 'windows'
2320
} $else $if macos {
24-
'macos-14'
21+
platform = 'macos-14'
2522
} $else $if linux {
26-
'ubuntu'
23+
platform = 'ubuntu'
2724
} $else {
2825
eprintln('A premade binary library is not available for your system.')
2926
eprintln('Build it from source, following the documentation here: https://github.com/WebAssembly/wabt/')
3027
exit(1)
3128
}
3229
url := 'https://github.com/WebAssembly/wabt/releases/download/${tag}/${fname}-${platform}.tar.gz'
3330
saveloc := os.join_path(tloc, '${fname}.tar.gz')
31+
println('>> Url: ${url}')
32+
println('>> Archive: ${saveloc}')
3433
if !os.exists(saveloc) {
3534
println('Downloading archive: ${saveloc}, from url: ${url} ...')
3635
http.download_file(url, saveloc)!
3736
// defer { os.rm(saveloc) or {}! }
3837
}
39-
4038
println('Extracting `${tloc}/${fname}` to `${tloc}/wabt` ...')
4139
cmd := 'tar -xvf ${saveloc} --directory ${tloc}'
4240
if os.system(cmd) != 0 {
4341
eprintln('`${cmd}` exited with a non zero exit code')
4442
exit(1)
4543
}
46-
4744
println(cmd)
4845
println('Moving `${tloc}/${fname}` to `${tloc}/wabt` ...')
49-
5046
os.rename_dir('${tloc}/${fname}', loc)!
5147
println('Done. You can now use `v test vlib/wasm` .')
5248
}

0 commit comments

Comments
 (0)