From 51d0702bb6c7eb7efd755d6a949d7e71dfbfbc2e Mon Sep 17 00:00:00 2001 From: Shen Jiamin Date: Thu, 25 Jun 2026 19:03:31 +0800 Subject: [PATCH] fix: exit on sourcing errors in safe_source Commit 4226a42 wrapped source $tcl_path in catch, intending to capture its return code, but catch also swallowed actual sourcing errors (e.g. syntax errors, undefined procs) instead of letting them propagate, so safe_source could silently continue past a broken script. Drop the catch and call source directly so errors are no longer caught and exiting still happens. Also log when sourcing finishes for clearer build output. Signed-off-by: Shen Jiamin --- linker/slashkit/resources/base/scripts/create_project.tcl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linker/slashkit/resources/base/scripts/create_project.tcl b/linker/slashkit/resources/base/scripts/create_project.tcl index 85474818..cdf137f3 100644 --- a/linker/slashkit/resources/base/scripts/create_project.tcl +++ b/linker/slashkit/resources/base/scripts/create_project.tcl @@ -97,7 +97,9 @@ puts "BUILD DIR: $cwd" proc safe_source {tcl_path} { puts "INFO: Sourcing $tcl_path ..." - catch {source $tcl_path} result + set result [ source $tcl_path ] + puts "INFO: Finished sourcing $tcl_path" + if {[string is integer -strict $result] && $result != 0} { puts "EXIT: '$tcl_path' returned $result" exit 1