This issue is a result of a Codex global repository scan.
install_abacus_toolchain_new.sh checks config_init and exits 0 on failure after printing help. Inside the config layer, argument parsing can return 1 for invalid options or malformed --package-version values, but these failures must propagate all the way back to the top-level script to stop installation and return a nonzero status.
Top-level failure path exits success:
|
main() { |
|
local args=("$@") |
|
|
|
# Initialize configuration with command line arguments |
|
if ! config_init "${args[@]}"; then |
|
show_help |
|
exit 0 |
|
fi |
Argument parser error examples:
|
# Validate we have at least one argument |
|
if [[ -z "$package_version_args" ]]; then |
|
report_error $LINENO "--package-version requires at least one package:version argument" |
|
return 1 |
|
fi |
|
|
|
# Process each package:version pair |
|
local pair_count=0 |
|
for pair in $package_version_args; do |
|
if [[ "$pair" =~ ^([a-zA-Z0-9_]+):(main|alt)$ ]]; then |
|
local pkg="${BASH_REMATCH[1]}" |
|
local ver="${BASH_REMATCH[2]}" |
|
CONFIG_CACHE["PACKAGE_VERSION_${pkg^^}"]="$ver" |
|
((pair_count++)) |
|
else |
|
report_error $LINENO "Invalid package version format: '$pair'. Use format 'package:version' (e.g., openmpi:alt, openblas:main)" |
|
return 1 |
Impact:
Invalid CLI input can be reported but still produce a successful command status, which is unsafe for CI and wrapper scripts.
Suggested fix:
Make config_init return nonzero whenever parsing or validation fails, and make the top-level script exit nonzero on that path. For example, use config_parse_arguments "$@" || return 1 and exit 1 after showing help for invalid input.
This issue is a result of a Codex global repository scan.
install_abacus_toolchain_new.shchecksconfig_initand exits0on failure after printing help. Inside the config layer, argument parsing can return1for invalid options or malformed--package-versionvalues, but these failures must propagate all the way back to the top-level script to stop installation and return a nonzero status.Top-level failure path exits success:
abacus-develop/toolchain/install_abacus_toolchain_new.sh
Lines 47 to 54 in 84ca04b
Argument parser error examples:
abacus-develop/toolchain/scripts/lib/config_manager.sh
Lines 763 to 779 in 84ca04b
Impact:
Invalid CLI input can be reported but still produce a successful command status, which is unsafe for CI and wrapper scripts.
Suggested fix:
Make
config_initreturn nonzero whenever parsing or validation fails, and make the top-level script exit nonzero on that path. For example, useconfig_parse_arguments "$@" || return 1andexit 1after showing help for invalid input.