fix(cli): avoid Argparse default aliasing (Void/Library#62); record sanitizer run
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 4s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 10s

This commit is contained in:
faumaray committed 2026-12-05 08:02:31 +03:00
1 parent 4bd2999b49
commit 7756bd9f60
4 files changed
+30 -2

No files matched your search

+6 -2
View File
@@ -2886,11 +2886,15 @@ int main(int argc, char **argv) {
BridgeCmdOptions bridge_opts;
GcCmdOptions gc_opts;
gc_opts.build_arg = (std::filesystem::path{cwd} / "build").string();
// Separate copies: Argparse's option_default must not alias `default_value` with `out`
// (Void/Library reads the view after assigning to out).
const std::string gc_default_build = gc_opts.build_arg;
GenTestsCmdOptions gen_tests_opts;
InitCmdOptions init_opts;
init_opts.dir_arg = cwd;
CleanCmdOptions clean_opts;
clean_opts.build_arg = (std::filesystem::path{cwd} / "build").string();
const std::string clean_default_build = clean_opts.build_arg;
GraphCmdOptions graph_opts;
graph_opts.project_arg = cwd;
IdeCmdOptions ide_opts;
@@ -3210,7 +3214,7 @@ int main(int argc, char **argv) {
root.subcommand("gc", "Recover interrupted state and garbage-collect unreferenced blobs");
gc_cmd
.option_default("--build-dir", "-B", "Build directory", gc_opts.build_arg,
gc_opts.build_arg)
gc_default_build)
.option_default("--max-bytes", "",
"Target maximum retained CAS bytes (0=unreferenced only)",
gc_opts.max_bytes_arg, "0");
@@ -3238,7 +3242,7 @@ int main(int argc, char **argv) {
root.subcommand("clean", "Remove generated profile build artifacts (preserving cache)");
clean_cmd
.option_default("--build-dir", "-B", "Build directory", clean_opts.build_arg,
clean_opts.build_arg)
clean_default_build)
.flag("--all", "", "Also delete .vbs cache, snapshots, and state store",
clean_opts.clean_all);
add_log_flags(clean_cmd);