builder: remove panics, when cleaning up tmp files after tests (#11525)

pull/11529/head
yuyi 2021-09-18 01:56:33 +08:00 committed by GitHub
parent 816c6c62b5
commit fb75d528eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -92,7 +92,7 @@ fn (mut v Builder) post_process_c_compiler_output(res os.Result) {
if v.pref.is_verbose { if v.pref.is_verbose {
eprintln('>> remove tmp file: $tmpfile') eprintln('>> remove tmp file: $tmpfile')
} }
os.rm(tmpfile) or { panic(err) } os.rm(tmpfile) or {}
} }
} }
return return

View File

@ -149,7 +149,7 @@ fn (mut v Builder) cleanup_run_executable_after_exit(exefile string) {
return return
} }
v.pref.vrun_elog('remove run executable: $exefile') v.pref.vrun_elog('remove run executable: $exefile')
os.rm(exefile) or { panic(err) } os.rm(exefile) or {}
} }
// 'strings' => 'VROOT/vlib/strings' // 'strings' => 'VROOT/vlib/strings'

View File

@ -387,7 +387,7 @@ pub fn (mut v Builder) cc_msvc() {
// println(res) // println(res)
// println('C OUTPUT:') // println('C OUTPUT:')
// Always remove the object file - it is completely unnecessary // Always remove the object file - it is completely unnecessary
os.rm(out_name_obj) or { panic(err) } os.rm(out_name_obj) or {}
} }
fn (mut v Builder) build_thirdparty_obj_file_with_msvc(path string, moduleflags []cflag.CFlag) { fn (mut v Builder) build_thirdparty_obj_file_with_msvc(path string, moduleflags []cflag.CFlag) {

View File

@ -674,7 +674,7 @@ pub fn parse_args(known_external_commands []string, args []string) (&Preferences
os.rm(tmp_exe_file_path) or {} os.rm(tmp_exe_file_path) or {}
} }
res.vrun_elog('remove tmp v file: $tmp_v_file_path') res.vrun_elog('remove tmp v file: $tmp_v_file_path')
os.rm(tmp_v_file_path) or { panic(err) } os.rm(tmp_v_file_path) or {}
exit(tmp_result) exit(tmp_result)
} }
must_exist(res.path) must_exist(res.path)

View File

@ -52,10 +52,10 @@ pub fn run_repl_file(wd string, vexec string, file string) ?string {
rcmd := '"$vexec" repl -replfolder "$wd" -replprefix "${fname}." < $input_temporary_filename' rcmd := '"$vexec" repl -replfolder "$wd" -replprefix "${fname}." < $input_temporary_filename'
r := os.execute(rcmd) r := os.execute(rcmd)
if r.exit_code < 0 { if r.exit_code < 0 {
os.rm(input_temporary_filename) or { panic(err) } os.rm(input_temporary_filename) ?
return error('Could not execute: $rcmd') return error('Could not execute: $rcmd')
} }
os.rm(input_temporary_filename) or { panic(err) } os.rm(input_temporary_filename) ?
result := r.output.replace('\r', '').replace('>>> ', '').replace('>>>', '').replace('... ', result := r.output.replace('\r', '').replace('>>> ', '').replace('>>>', '').replace('... ',
'').replace(wd + os.path_separator, '').replace(vexec_folder, '').replace('\\', '').replace(wd + os.path_separator, '').replace(vexec_folder, '').replace('\\',
'/').trim_right('\n\r') '/').trim_right('\n\r')