Skip to content

Commit

Permalink
fixup! load goarc files with safe slave interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlatow committed Sep 10, 2024
1 parent 18258b3 commit bb74546
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion share/goa/lib/actions/build.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ namespace eval goa {
global config::cross_dev_prefix config::depot_dir config::rebuild
global config::arch config::olevel config::cc_march config::debug
global config::cc_cxx_opt_std config::ld_march config::abi_dir
global config::build_dir config::api_dirs
global config::build_dir api_dirs

#
# Check for availability of the Genode tool chain
Expand Down
2 changes: 1 addition & 1 deletion share/goa/lib/build/cmake.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ proc create_or_update_build_dir { } {
global ldlibs_so env cmake_quirk_args
global config::build_dir config::project_dir config::abi_dir
global config::cross_dev_prefix config::include_dirs config::project_name
global config::api_dirs
global api_dirs

if {![file exists $build_dir]} {
file mkdir $build_dir }
Expand Down
15 changes: 14 additions & 1 deletion share/goa/lib/command_line.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
proc const_var { n1 n2 op } {
exit_with_error "Write access to const variable $n1" }

#
# Trace callback for sanitizing version information
#
proc version_var { n1 n2 op } {
global config::version
set value [string trim $version($n2)]
set version($n2) $value
if {[string first / $value] >= 0} {
exit_with_error "Value of 'version($n2)' must not contain slashes" }
}

#
# Determine verbosity level as evaluated by 'diag'
#
Expand Down Expand Up @@ -292,7 +303,9 @@ unset original_dir

# make all variables (except version array) in config namespace immutable
foreach var [info vars ::config::*] {
if {$var != "::config::version"} {
if {$var == "::config::version"} {
trace add variable $var write version_var
} else {
trace add variable $var write const_var
}
}
Expand Down
2 changes: 1 addition & 1 deletion share/goa/lib/config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace eval ::config {
if {$nargs == 1} {
return [set ::config::$name] }

set value [lindex $args 1]
set value [string trim [lindex $args 1]]

if {[llength $value] > 1} {
exit_with_error "$rcfile contains malformed definition of $name" }
Expand Down

0 comments on commit bb74546

Please sign in to comment.