From 039c1c3e231b975d57fdc2e24105dbbbe54a513c Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 12:38:32 -0500 Subject: Add wheel_builder CLI arguments --- src/cli/stasis/args.c | 4 ++++ src/cli/stasis/include/args.h | 2 ++ src/cli/stasis/stasis_main.c | 6 ++++++ 3 files changed, 12 insertions(+) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/args.c b/src/cli/stasis/args.c index 172981a..dbc9c2f 100644 --- a/src/cli/stasis/args.c +++ b/src/cli/stasis/args.c @@ -15,6 +15,8 @@ struct option long_options[] = { {"fail-fast", no_argument, 0, OPT_FAIL_FAST}, {"task-timeout", required_argument, 0, OPT_TASK_TIMEOUT}, {"overwrite", no_argument, 0, OPT_OVERWRITE}, + {"wheel-builder", required_argument, 0, OPT_WHEEL_BUILDER}, + {"wheel-builder-manylinux-image", required_argument, 0, OPT_WHEEL_BUILDER_MANYLINUX_IMAGE}, {"no-docker", no_argument, 0, OPT_NO_DOCKER}, {"no-artifactory", no_argument, 0, OPT_NO_ARTIFACTORY}, {"no-artifactory-build-info", no_argument, 0, OPT_NO_ARTIFACTORY_BUILD_INFO}, @@ -40,6 +42,8 @@ const char *long_options_help[] = { "On error, immediately terminate all tasks", "Terminate task after timeout is reached (#s, #m, #h)", "Overwrite an existing release", + "Wheel building backend (build, cibuildwheel, manylinux)", + "Manylinux image name", "Do not build docker images", "Do not upload artifacts to Artifactory", "Do not upload build info objects to Artifactory", diff --git a/src/cli/stasis/include/args.h b/src/cli/stasis/include/args.h index 5536735..e789261 100644 --- a/src/cli/stasis/include/args.h +++ b/src/cli/stasis/include/args.h @@ -19,6 +19,8 @@ #define OPT_POOL_STATUS_INTERVAL 1011 #define OPT_NO_TASK_LOGGING 1012 #define OPT_TASK_TIMEOUT 1013 +#define OPT_WHEEL_BUILDER 1014 +#define OPT_WHEEL_BUILDER_MANYLINUX_IMAGE 1015 extern struct option long_options[]; void usage(char *progname); diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 633d014..48504b9 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -605,6 +605,12 @@ int main(int argc, char *argv[]) { case OPT_NO_TASK_LOGGING: globals.enable_task_logging = false; break; + case OPT_WHEEL_BUILDER: + globals.wheel_builder = strdup(optarg); + break; + case OPT_WHEEL_BUILDER_MANYLINUX_IMAGE: + globals.wheel_builder_manylinux_image = strdup(optarg); + break; case '?': default: exit(1); -- cgit From 106e8ca151455819696a022a336a118a9f5061c8 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 13:35:06 -0500 Subject: Initialize sysconfdir early --- src/cli/stasis/stasis_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 48504b9..90c2219 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -512,6 +512,8 @@ int main(int argc, char *argv[]) { memset(&proc, 0, sizeof(proc)); memset(&ctx, 0, sizeof(ctx)); + setup_sysconfdir(); + int c; int option_index = 0; while ((c = getopt_long(argc, argv, "hVCc:p:vU", long_options, &option_index)) != -1) { @@ -640,7 +642,6 @@ int main(int argc, char *argv[]) { tpl_setup_vars(&ctx); tpl_setup_funcs(&ctx); - setup_sysconfdir(); setup_python_version_override(&ctx, python_override_version); configure_stasis_ini(&ctx, &config_input); -- cgit From a9b211aa92ac1a0edd2659637b367ea7ec1aecc5 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 13:36:41 -0500 Subject: Initialize the python version override before the template engine --- src/cli/stasis/stasis_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 90c2219..42d79ff 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -635,6 +635,8 @@ int main(int argc, char *argv[]) { printf(BANNER, VERSION, AUTHOR); + setup_python_version_override(&ctx, python_override_version); + configure_stasis_ini(&ctx, &config_input); check_system_path(); msg(STASIS_MSG_L1, "Setup\n"); @@ -642,13 +644,9 @@ int main(int argc, char *argv[]) { tpl_setup_vars(&ctx); tpl_setup_funcs(&ctx); - setup_python_version_override(&ctx, python_override_version); - - configure_stasis_ini(&ctx, &config_input); configure_delivery_ini(&ctx, &delivery_input); configure_delivery_context(&ctx); - check_requirements(&ctx); configure_jfrog_cli(&ctx); runtime_apply(ctx.runtime.environ); -- cgit From 28965f64271ff7e1209dc20af96b4a34078d0888 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 13:37:48 -0500 Subject: Check system requirements before setup --- src/cli/stasis/stasis_main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 42d79ff..e1361c0 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -638,6 +638,7 @@ int main(int argc, char *argv[]) { setup_python_version_override(&ctx, python_override_version); configure_stasis_ini(&ctx, &config_input); check_system_path(); + check_requirements(&ctx); msg(STASIS_MSG_L1, "Setup\n"); -- cgit From 92b20da9c686afdca3a262af1292604f2afe5a04 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 16:07:07 -0500 Subject: Rename function to better express its purpose --- src/cli/stasis/stasis_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index e1361c0..44c8aae 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -304,7 +304,8 @@ static void configure_tool_versions(struct Delivery *ctx) { } } -static void install_build_package() { +static void install_packaging_tools() { + msg(STASIS_MSG_L1, "Installing packaging tool(s)\n"); if (pip_exec("install build")) { msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "'build' tool installation failed\n"); exit(1); @@ -671,7 +672,7 @@ int main(int argc, char *argv[]) { setup_activate_test_env(&ctx, env_name_testing); configure_tool_versions(&ctx); - install_build_package(); + install_packaging_tools(); configure_package_overlay(&ctx, env_name); configure_deferred_packages(&ctx); -- cgit From a167ca14b7d994f9a5fec4e0642b6fffce17e002 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 16:08:59 -0500 Subject: No need to print these every time --- src/cli/stasis/stasis_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 44c8aae..1db2a1b 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -54,7 +54,7 @@ static void configure_stasis_ini(struct Delivery *ctx, char **config_input) { } } - msg(STASIS_MSG_L2, "Reading STASIS global configuration: %s\n", *config_input); + SYSDEBUG("Reading STASIS global configuration: %s\n", *config_input); ctx->_stasis_ini_fp.cfg = ini_open(*config_input); if (!ctx->_stasis_ini_fp.cfg) { msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "Failed to read config file: %s, %s\n", *config_input, strerror(errno)); -- cgit From bc3734f26a4a133c9a41dcd238652f9bca15ab9b Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 16:09:29 -0500 Subject: overview, not overiew --- src/cli/stasis/stasis_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 1db2a1b..ac35e01 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -332,8 +332,7 @@ static void configure_deferred_packages(struct Delivery *ctx) { delivery_defer_packages(ctx, DEFER_PIP); } -static void show_overiew(struct Delivery *ctx) { - +static void show_overview(struct Delivery *ctx) { msg(STASIS_MSG_L1, "Overview\n"); delivery_meta_show(ctx); delivery_conda_show(ctx); @@ -676,7 +675,7 @@ int main(int argc, char *argv[]) { configure_package_overlay(&ctx, env_name); configure_deferred_packages(&ctx); - show_overiew(&ctx); + show_overview(&ctx); run_tests(&ctx); build_conda_recipes(&ctx); build_wheel_packages(&ctx); -- cgit From fbb550ef98302d63b7dde036b4d97808c067de22 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 16:09:55 -0500 Subject: add missing short options --- src/cli/stasis/stasis_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index ac35e01..e5e800f 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -516,7 +516,7 @@ int main(int argc, char *argv[]) { int c; int option_index = 0; - while ((c = getopt_long(argc, argv, "hVCc:p:vU", long_options, &option_index)) != -1) { + while ((c = getopt_long(argc, argv, "hVCc:p:vUl:", long_options, &option_index)) != -1) { switch (c) { case 'h': usage(path_basename(argv[0])); -- cgit From 30e45696a357b8f2d7aa05032d757749d4eea13d Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 16:10:16 -0500 Subject: Clean up messages --- src/cli/stasis/stasis_main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index e5e800f..44efc4a 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -57,12 +57,13 @@ static void configure_stasis_ini(struct Delivery *ctx, char **config_input) { SYSDEBUG("Reading STASIS global configuration: %s\n", *config_input); ctx->_stasis_ini_fp.cfg = ini_open(*config_input); if (!ctx->_stasis_ini_fp.cfg) { - msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "Failed to read config file: %s, %s\n", *config_input, strerror(errno)); + msg(STASIS_MSG_ERROR, "Failed to read global config file: %s, %s\n", *config_input, strerror(errno)); + SYSERROR("Failed to read global config file: %s\n", *config_input); exit(1); } ctx->_stasis_ini_fp.cfg_path = strdup(*config_input); if (!ctx->_stasis_ini_fp.cfg_path) { - SYSERROR("%s", "Failed to allocate memory for config file name"); + SYSERROR("%s", "Failed to allocate memory delivery context global config file name"); exit(1); } guard_free(*config_input); @@ -102,9 +103,9 @@ static void configure_jfrog_cli(struct Delivery *ctx) { static void check_release_history(struct Delivery *ctx) { // Safety gate: Avoid clobbering a delivered release unless the user wants that behavior - msg(STASIS_MSG_L1, "Checking release history\n"); + msg(STASIS_MSG_L2, "Checking release history\n"); if (!globals.enable_overwrite && delivery_exists(ctx) == DELIVERY_FOUND) { - msg(STASIS_MSG_ERROR | STASIS_MSG_L1, "Refusing to overwrite release: %s\nUse --overwrite to enable release clobbering.\n", ctx->info.release_name); + msg(STASIS_MSG_ERROR, "Refusing to overwrite release: %s\nUse --overwrite to enable release clobbering.\n", ctx->info.release_name); exit(1); } @@ -147,14 +148,14 @@ static void check_conda_prefix_length(const struct Delivery *ctx) { // 5 = /bin\n const size_t prefix_len = strlen(ctx->storage.conda_install_prefix) + 2 + 5; const size_t prefix_len_max = 127; - msg(STASIS_MSG_L1, "Checking length of conda installation prefix\n"); + msg(STASIS_MSG_L2, "Checking length of conda installation prefix\n"); if (!strcmp(ctx->system.platform[DELIVERY_PLATFORM], "Linux") && prefix_len > prefix_len_max) { - msg(STASIS_MSG_L2 | STASIS_MSG_ERROR, + msg(STASIS_MSG_L3 | STASIS_MSG_ERROR, "The shebang, '#!%s/bin/python\\n' is too long (%zu > %zu).\n", ctx->storage.conda_install_prefix, prefix_len, prefix_len_max); - msg(STASIS_MSG_L2 | STASIS_MSG_ERROR, + msg(STASIS_MSG_L3 | STASIS_MSG_ERROR, "Conda's workaround to handle long path names does not work consistently within STASIS.\n"); - msg(STASIS_MSG_L2 | STASIS_MSG_ERROR, + msg(STASIS_MSG_L3 | STASIS_MSG_ERROR, "Please try again from a different, \"shorter\", directory.\n"); exit(1); } -- cgit From 2d163cd63c779368cd85b9970fa61ac49ee8b7fb Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 5 Mar 2026 16:10:41 -0500 Subject: Clean up messages --- src/cli/stasis/system_requirements.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/system_requirements.c b/src/cli/stasis/system_requirements.c index cb0ebd5..a749dda 100644 --- a/src/cli/stasis/system_requirements.c +++ b/src/cli/stasis/system_requirements.c @@ -27,38 +27,44 @@ void check_system_requirements(struct Delivery *ctx) { }; msg(STASIS_MSG_L1, "Checking system requirements\n"); + + msg(STASIS_MSG_L2, "Tools\n"); for (size_t i = 0; tools_required[i] != NULL; i++) { + msg(STASIS_MSG_L3, "%s: ", tools_required[i]); if (!find_program(tools_required[i])) { - msg(STASIS_MSG_L2 | STASIS_MSG_ERROR, "'%s' must be installed.\n", tools_required[i]); + msg(STASIS_MSG_ERROR, "'%s' must be installed.\n", tools_required[i]); exit(1); } + msg(STASIS_MSG_RESTRICT, "found\n"); } if (!globals.tmpdir && !ctx->storage.tmpdir) { delivery_init_tmpdir(ctx); } - if (!docker_capable(&ctx->deploy.docker.capabilities)) { + msg(STASIS_MSG_L2, "Docker\n"); + if (docker_capable(&ctx->deploy.docker.capabilities)) { struct DockerCapabilities *dcap = &ctx->deploy.docker.capabilities; - msg(STASIS_MSG_L2 | STASIS_MSG_WARN, "Docker is broken\n"); - msg(STASIS_MSG_L3, "Available: %s\n", dcap->available ? "Yes" : "No"); - msg(STASIS_MSG_L3, "Usable: %s\n", dcap->usable ? "Yes" : "No"); + msg(STASIS_MSG_L3, "Available: %s%s%s\n", dcap->available ? STASIS_COLOR_GREEN : STASIS_COLOR_RED, dcap->available ? "Yes" : "No", STASIS_COLOR_RESET); + msg(STASIS_MSG_L3, "Usable: %s%s%s\n", dcap->usable ? STASIS_COLOR_GREEN : STASIS_COLOR_RED, dcap->usable ? "Yes" : "No", STASIS_COLOR_RESET); msg(STASIS_MSG_L3, "Podman [Docker Emulation]: %s\n", dcap->podman ? "Yes" : "No"); msg(STASIS_MSG_L3, "Build plugin(s): "); if (dcap->usable) { if (dcap->build & STASIS_DOCKER_BUILD) { - printf("build "); + msg(STASIS_MSG_RESTRICT, "build "); } if (dcap->build & STASIS_DOCKER_BUILD_X) { - printf("buildx "); + msg(STASIS_MSG_RESTRICT, "buildx "); } - puts(""); + msg(STASIS_MSG_RESTRICT,"\n"); } else { - printf("N/A\n"); + msg(STASIS_MSG_RESTRICT, "%sN/A%s\n", STASIS_COLOR_YELLOW, STASIS_COLOR_RESET); } // disable docker builds globals.enable_docker = false; + } else { + msg(STASIS_MSG_L2 | STASIS_MSG_WARN, "Docker is broken\n"); } } -- cgit From e6a4c219ae8dfa67dfee49b0e448e42a4bb924cc Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 6 Mar 2026 16:02:06 -0500 Subject: Fix system requirement logic. If docker is not usable, disable. --- src/cli/stasis/system_requirements.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/cli/stasis') diff --git a/src/cli/stasis/system_requirements.c b/src/cli/stasis/system_requirements.c index a749dda..0f0aae8 100644 --- a/src/cli/stasis/system_requirements.c +++ b/src/cli/stasis/system_requirements.c @@ -49,7 +49,7 @@ void check_system_requirements(struct Delivery *ctx) { msg(STASIS_MSG_L3, "Usable: %s%s%s\n", dcap->usable ? STASIS_COLOR_GREEN : STASIS_COLOR_RED, dcap->usable ? "Yes" : "No", STASIS_COLOR_RESET); msg(STASIS_MSG_L3, "Podman [Docker Emulation]: %s\n", dcap->podman ? "Yes" : "No"); msg(STASIS_MSG_L3, "Build plugin(s): "); - if (dcap->usable) { + if (dcap->build) { if (dcap->build & STASIS_DOCKER_BUILD) { msg(STASIS_MSG_RESTRICT, "build "); } @@ -61,10 +61,14 @@ void check_system_requirements(struct Delivery *ctx) { msg(STASIS_MSG_RESTRICT, "%sN/A%s\n", STASIS_COLOR_YELLOW, STASIS_COLOR_RESET); } - // disable docker builds - globals.enable_docker = false; + if (!dcap->usable) { + // disable docker builds + globals.enable_docker = false; + } } else { msg(STASIS_MSG_L2 | STASIS_MSG_WARN, "Docker is broken\n"); + // disable docker builds + globals.enable_docker = false; } } -- cgit