examples: make a process example compile with -prod
parent
2d875260e8
commit
f589a70874
|
@ -12,15 +12,14 @@ fn main() {
|
||||||
println('fast.html generator needs to be located in `v/cmd/tools/fast`')
|
println('fast.html generator needs to be located in `v/cmd/tools/fast`')
|
||||||
}
|
}
|
||||||
println('fast.html generator\n')
|
println('fast.html generator\n')
|
||||||
// Fetch the last commit's hash
|
|
||||||
println('Fetching updates...')
|
println('Fetching updates...')
|
||||||
ret := os.system('$vdir/v up')
|
ret := os.system('$vdir/v up')
|
||||||
if ret != 0 {
|
if ret != 0 {
|
||||||
println('failed to update V')
|
println('failed to update V')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Fetch the last commit's hash
|
||||||
commit := exec('git rev-parse HEAD')[..8]
|
commit := exec('git rev-parse HEAD')[..8]
|
||||||
// commit_hash = commit_hash[..8]
|
|
||||||
if !os.exists('table.html') {
|
if !os.exists('table.html') {
|
||||||
os.create('table.html') ?
|
os.create('table.html') ?
|
||||||
}
|
}
|
||||||
|
@ -113,8 +112,6 @@ fn measure(cmd string, description string) int {
|
||||||
|
|
||||||
fn measure_steps(vdir string) (int, int, int) {
|
fn measure_steps(vdir string) (int, int, int) {
|
||||||
resp := os.exec('$vdir/vprod -o v.c -show-timings $vdir/cmd/v') or { panic(err) }
|
resp := os.exec('$vdir/vprod -o v.c -show-timings $vdir/cmd/v') or { panic(err) }
|
||||||
println('=======')
|
|
||||||
println(resp.output)
|
|
||||||
lines := resp.output.split_into_lines()
|
lines := resp.output.split_into_lines()
|
||||||
if lines.len != 3 {
|
if lines.len != 3 {
|
||||||
return 0, 0, 0
|
return 0, 0, 0
|
||||||
|
|
|
@ -3,10 +3,6 @@ module main
|
||||||
import os
|
import os
|
||||||
|
|
||||||
fn exec(args []string) {
|
fn exec(args []string) {
|
||||||
mut out := ''
|
|
||||||
mut line := ''
|
|
||||||
mut line_err := ''
|
|
||||||
|
|
||||||
os.execve('/bin/bash', args, []) or {
|
os.execve('/bin/bash', args, []) or {
|
||||||
// eprintln(err)
|
// eprintln(err)
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue