From e4550b63118765c0affd653234749a92fc51961f Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 17 Aug 2024 18:48:33 +0530 Subject: evanix: --max-build -> --max-builds --- include/evanix.h | 2 +- nixos/tests/dsl.nix | 2 +- src/evanix.c | 8 ++++---- src/meson.build | 2 +- src/queue.c | 4 ++-- tests/dag.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/evanix.h b/include/evanix.h index 34d4918..5d512ae 100644 --- a/include/evanix.h +++ b/include/evanix.h @@ -14,7 +14,7 @@ struct evanix_opts_t { bool check_cache_status; bool break_evanix; char *system; - uint32_t max_build; + uint32_t max_builds; int (*solver)(struct job **, struct job_clist *, int32_t); }; diff --git a/nixos/tests/dsl.nix b/nixos/tests/dsl.nix index d2a4420..18d7ed4 100644 --- a/nixos/tests/dsl.nix +++ b/nixos/tests/dsl.nix @@ -237,7 +237,7 @@ in evanix_args = ["evanix", "${targets}", "--dry-run", "--close-unused-fd", "false"] if (allow_builds := config["constraints"]["builds"]) is not None: - evanix_args.extend(["--solver=highs", "--max-build", str(allow_builds)]) + evanix_args.extend(["--solver=highs", "--max-builds", str(allow_builds)]) expect_chosen_nodes = set(name for name, node in nodes.items() if node["test"]["chosen"]) expect_n_chosen_builds = config["test"]["constrained"]["builds"] diff --git a/src/evanix.c b/src/evanix.c index d46a366..2cf8469 100644 --- a/src/evanix.c +++ b/src/evanix.c @@ -19,7 +19,7 @@ static const char usage[] = " -d, --dry-run Show what derivations would be " "built.\n" " -s, --system System to build for.\n" - " -m, --max-build Max number of builds.\n" + " -m, --max-builds Max number of builds.\n" " -b, --break-evanix Enable experimental features.\n" " -r, --solver-report Print solver report.\n" " -p, --pipelined Use evanix build pipeline.\n" @@ -33,7 +33,7 @@ struct evanix_opts_t evanix_opts = { .isflake = false, .ispipelined = true, .isdryrun = false, - .max_build = 0, + .max_builds = 0, .system = NULL, .solver_report = false, .check_cache_status = true, @@ -139,8 +139,8 @@ int opts_read(struct evanix_opts_t *opts, char **expr, int argc, char *argv[]) {"solver", required_argument, NULL, 'k'}, {"system", required_argument, NULL, 's'}, {"solver-report", no_argument, NULL, 'r'}, - {"max-build", required_argument, NULL, 'm'}, {"pipelined", required_argument, NULL, 'p'}, + {"max-builds", required_argument, NULL, 'm'}, {"close-unused-fd", required_argument, NULL, 'c'}, {"check-cache-status", required_argument, NULL, 'l'}, {NULL, 0, NULL, 0}, @@ -197,7 +197,7 @@ int opts_read(struct evanix_opts_t *opts, char **expr, int argc, char *argv[]) return -EINVAL; } - opts->max_build = ret; + opts->max_builds = ret; break; case 'p': ret = atob(optarg); diff --git a/src/meson.build b/src/meson.build index 4217858..4894e1c 100644 --- a/src/meson.build +++ b/src/meson.build @@ -24,7 +24,7 @@ foreach solver : ['sjf', 'highs', 'conformity'] test(f'evanix-@solver@', e, args: [ '--dry-run', '--close-unused-fd=false', - '--max-build=3', + '--max-builds=3', '--solver-report', f'--solver=@solver@', '--flake', diff --git a/src/queue.c b/src/queue.c index b914d0f..dbccd66 100644 --- a/src/queue.c +++ b/src/queue.c @@ -102,7 +102,7 @@ int queue_pop(struct queue *queue, struct job **job) } pthread_mutex_lock(&queue->mutex); - if (evanix_opts.max_build) { + if (evanix_opts.max_builds) { ret = evanix_opts.solver(&j, &queue->jobs, queue->resources); if (ret < 0) goto out_mutex_unlock; @@ -242,7 +242,7 @@ int queue_thread_new(struct queue_thread **queue_thread, FILE *stream) goto out_free_qt; } qt->queue->htab = NULL; - qt->queue->resources = evanix_opts.max_build; + qt->queue->resources = evanix_opts.max_builds; qt->queue->jobid = NULL; qt->queue->state = Q_SEM_WAIT; ret = sem_init(&qt->queue->sem, 0, 0); diff --git a/tests/dag.c b/tests/dag.c index c49bf34..f7a1937 100644 --- a/tests/dag.c +++ b/tests/dag.c @@ -19,7 +19,7 @@ struct evanix_opts_t evanix_opts = { .isflake = false, .ispipelined = true, .isdryrun = false, - .max_build = 0, + .max_builds = 0, .system = NULL, .solver_report = false, .check_cache_status = false, -- cgit v1.2.3