1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools: make fast_job.v more verbose and robust to compilation failures in fast.v, and to what compiler exactly was used to compile fast_job.v itself.

This commit is contained in:
Delyan Angelov 2022-11-02 13:22:34 +02:00
parent 82dc9ca434
commit 7bd00b7580
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 20 additions and 9 deletions

View File

@ -101,7 +101,7 @@ fn main() {
diff1 := measure('$vdir/vprod $voptions -o v.c cmd/v', 'v.c')
diff2 := measure('$vdir/vprod $voptions -cc $ccompiler_path -o v2 cmd/v', 'v2')
diff3 := 0 // measure('$vdir/vprod -native $vdir/cmd/tools/1mil.v', 'native 1mil')
diff4 := measure('$vdir/vprod $voptions -cc $ccompiler_path -usecache examples/hello_world.v',
diff4 := measure('$vdir/vprod $voptions -cc $ccompiler_path examples/hello_world.v',
'hello.v')
vc_size := os.file_size('v.c') / 1000
scan, parse, check, cgen, vlines := measure_steps_minimal(vdir)!

View File

@ -4,7 +4,11 @@
import os
import time
const vexe = @VEXE
const fast_dir = os.dir(@FILE)
const vdir = os.dir(os.dir(os.dir(fast_dir)))
const vexe = os.join_path(vdir, 'v')
const sleep_period = 120
@ -20,8 +24,11 @@ fn delay() {
// A job that runs in the background, checks for repo updates,
// runs fast.v, pushes the HTML result to the fast.vlang.io GH pages repo.
fn main() {
os.chdir(os.dir(@FILE))!
os.setenv('LANG', 'C', true)
elog('fast_job fast_dir: $fast_dir | vdir: $vdir | vexe: $vexe')
os.chdir(fast_dir)!
elog('fast_job start in os.getwd(): $os.getwd()')
defer {
elog('fast_job end')
@ -34,7 +41,7 @@ fn main() {
for {
elog('------------------- Checking for updates ... -------------------')
res_pull := os.execute('git pull --rebase')
elog('> res_pull.output:\n $res_pull.output')
elog('> res_pull.output: $res_pull.output')
if res_pull.exit_code != 0 {
elog('Git pull failed. You may have uncommitted changes?')
delay()
@ -54,14 +61,18 @@ fn main() {
os.system('ls -la ${os.quoted_path(vexe)}')
elog('recompiling ./fast')
os.execute('${os.quoted_path(vexe)} fast.v')
recompile_fast_v_code := os.system('${os.quoted_path(vexe)} fast.v')
if recompile_fast_v_code != 0 {
elog('WARNING: could not recompile fast.v')
delay()
continue
}
os.system('ls -la fast fast.v')
elog('running ./fast -upload')
resp := os.execute('./fast -upload')
if resp.exit_code != 0 {
println('resp.exit_code = $resp.exit_code != 0')
println(resp.output)
fast_exit_code := os.system('./fast -upload')
if fast_exit_code != 0 {
println('fast_exit_code = $fast_exit_code, != 0')
}
delay()