diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2026-05-10 20:03:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-10 20:03:12 -0400 |
| commit | 58d3ca17dcd3f8b3aeb50b8e4f24afc76d33ff26 (patch) | |
| tree | 965264cfc865df78276da47eece86130a6b2b6b5 /src/lib/delivery/delivery_build.c | |
| parent | 0ef06cbec6f3796db244501b4c5fec2d579c7e5b (diff) | |
| parent | 70f20294bd63e9774ee0c8a7a032ac63e1a1da2e (diff) | |
| download | stasis-58d3ca17dcd3f8b3aeb50b8e4f24afc76d33ff26.tar.gz | |
Merge pull request #142 from jhunkeler/execpoint
Improve messaging functions
Diffstat (limited to 'src/lib/delivery/delivery_build.c')
| -rw-r--r-- | src/lib/delivery/delivery_build.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/src/lib/delivery/delivery_build.c b/src/lib/delivery/delivery_build.c index 49d2f5b..3eb2714 100644 --- a/src/lib/delivery/delivery_build.c +++ b/src/lib/delivery/delivery_build.c @@ -1,4 +1,8 @@ +#include <fnmatch.h> + #include "delivery.h" +#include "conda.h" +#include "recipe.h" int delivery_build_recipes(struct Delivery *ctx) { for (size_t i = 0; i < ctx->tests->num_used; i++) { @@ -181,17 +185,17 @@ int manylinux_exec(const char *image, const char *script, const char *copy_to_co // setup if (get_random_bytes(suffix, sizeof(suffix))) { - SYSERROR("%s", "unable to acquire value from random generator"); + SYSERROR("unable to acquire value from random generator"); goto manylinux_fail; } if (asprintf(&container_name, "manylinux_build_%d_%zd_%s", uid, time(NULL), suffix) < 0) { - SYSERROR("%s", "unable to allocate memory for container name"); + SYSERROR("unable to allocate memory for container name"); goto manylinux_fail; } if (asprintf(&args, "--name %s -w /build -v %s:/build", container_name, container_name) < 0) { - SYSERROR("%s", "unable to allocate memory for docker arguments"); + SYSERROR("unable to allocate memory for docker arguments"); goto manylinux_fail; } @@ -201,77 +205,77 @@ int manylinux_exec(const char *image, const char *script, const char *copy_to_co } if (asprintf(&nop_create_command, "run --name nop_%s -v %s:/build busybox", container_name, container_name) < 0) { - SYSERROR("%s", "unable to allocate memory for nop container command"); + SYSERROR("unable to allocate memory for nop container command"); goto manylinux_fail; } if (asprintf(&source_copy_command, "cp %s nop_%s:/build", copy_to_container_dir, container_name) < 0) { - SYSERROR("%s", "unable to allocate memory for source copy command"); + SYSERROR("unable to allocate memory for source copy command"); goto manylinux_fail; } if (asprintf(&nop_rm_command, "rm nop_%s", container_name) < 0) { - SYSERROR("%s", "unable to allocate memory for nop container command"); + SYSERROR("unable to allocate memory for nop container command"); goto manylinux_fail; } if (asprintf(&wheel_paths_filename, "%s/wheel_paths_%s.txt", globals.tmpdir, container_name) < 0) { - SYSERROR("%s", "unable to allocate memory for wheel paths file name"); + SYSERROR("unable to allocate memory for wheel paths file name"); goto manylinux_fail; } if (asprintf(&find_command, "run --rm -t -v %s:/build busybox sh -c 'find %s -name \"*.whl\"' > %s", container_name, copy_from_container_dir, wheel_paths_filename) < 0) { - SYSERROR("%s", "unable to allocate memory for find command"); + SYSERROR("unable to allocate memory for find command"); goto manylinux_fail; } // execute if (docker_exec(nop_create_command, 0)) { - SYSERROR("%s", "docker nop container creation failed"); + SYSERROR("docker nop container creation failed"); goto manylinux_fail; } if (docker_exec(source_copy_command, 0)) { - SYSERROR("%s", "docker source copy operation failed"); + SYSERROR("docker source copy operation failed"); goto manylinux_fail; } if (docker_exec(nop_rm_command, STASIS_DOCKER_QUIET)) { - SYSERROR("%s", "docker nop container removal failed"); + SYSERROR("docker nop container removal failed"); goto manylinux_fail; } if (docker_script(image, args, (char *) script, 0)) { - SYSERROR("%s", "manylinux execution failed"); + SYSERROR("manylinux execution failed"); goto manylinux_fail; } if (docker_exec(find_command, 0)) { - SYSERROR("%s", "docker find command failed"); + SYSERROR("docker find command failed"); goto manylinux_fail; } struct StrList *wheel_paths = strlist_init(); if (!wheel_paths) { - SYSERROR("%s", "wheel_paths not initialized"); + SYSERROR("wheel_paths not initialized"); goto manylinux_fail; } if (strlist_append_file(wheel_paths, wheel_paths_filename, read_without_line_endings)) { - SYSERROR("%s", "wheel_paths append failed"); + SYSERROR("wheel_paths append failed"); goto manylinux_fail; } for (size_t i = 0; i < strlist_count(wheel_paths); i++) { const char *item = strlist_item(wheel_paths, i); if (asprintf(©_command, "cp %s:%s %s", container_name, item, copy_to_host_dir) < 0) { - SYSERROR("%s", "unable to allocate memory for docker copy command"); + SYSERROR("unable to allocate memory for docker copy command"); goto manylinux_fail; } if (docker_exec(copy_command, 0)) { - SYSERROR("%s", "docker copy operation failed"); + SYSERROR("docker copy operation failed"); goto manylinux_fail; } guard_free(copy_command); @@ -289,21 +293,21 @@ int manylinux_exec(const char *image, const char *script, const char *copy_to_co // Keep going on failure unless memory related. // We don't want build debris everywhere. if (asprintf(&rm_command, "rm %s", container_name) < 0) { - SYSERROR("%s", "unable to allocate memory for rm command"); + SYSERROR("unable to allocate memory for rm command"); goto late_fail; } if (docker_exec(rm_command, STASIS_DOCKER_QUIET)) { - SYSERROR("%s", "docker container removal operation failed"); + SYSERROR("docker container removal operation failed"); } if (asprintf(&volume_rm_command, "volume rm -f %s", container_name) < 0) { - SYSERROR("%s", "unable to allocate memory for docker volume removal command"); + SYSERROR("unable to allocate memory for docker volume removal command"); goto late_fail; } if (docker_exec(volume_rm_command, STASIS_DOCKER_QUIET)) { - SYSERROR("%s", "docker volume removal operation failed"); + SYSERROR("docker volume removal operation failed"); } } @@ -327,7 +331,7 @@ int delivery_build_wheels_manylinux(struct Delivery *ctx, const char *outdir) { const char *manylinux_image = globals.wheel_builder_manylinux_image; if (!manylinux_image) { - SYSERROR("%s", "manylinux_image not initialized"); + SYSERROR("manylinux_image not initialized"); return -1; } @@ -345,7 +349,7 @@ int delivery_build_wheels_manylinux(struct Delivery *ctx, const char *outdir) { char *script = NULL; if (asprintf(&script, script_fmt, meta->python, meta->python) < 0) { - SYSERROR("%s", "unable to allocate memory for build script"); + SYSERROR("unable to allocate memory for build script"); return -1; } manylinux_build_status = manylinux_exec( @@ -406,7 +410,7 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) { snprintf(srcdir, sizeof(srcdir), "%s/%s", ctx->storage.build_sources_dir, ctx->tests->test[i]->name); if (git_clone(&proc, ctx->tests->test[i]->repository, srcdir, ctx->tests->test[i]->version)) { - SYSERROR("Unable to checkout tag '%s' for package '%s' from repository '%s'\n", + SYSERROR("Unable to checkout tag '%s' for package '%s' from repository '%s'", ctx->tests->test[i]->version, ctx->tests->test[i]->name, ctx->tests->test[i]->repository); return NULL; } @@ -460,13 +464,13 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) { } else if (use_builder_build || use_builder_cibuildwheel) { if (use_builder_build) { if (asprintf(&cmd, "-m build -w -o %s", outdir) < 0) { - SYSERROR("%s", "Unable to allocate memory for build command"); + SYSERROR("Unable to allocate memory for build command"); return NULL; } } else if (use_builder_cibuildwheel) { if (asprintf(&cmd, "-m cibuildwheel --output-dir %s --only cp%s-manylinux_%s", outdir, ctx->meta.python_compact, ctx->system.arch) < 0) { - SYSERROR("%s", "Unable to allocate memory for cibuildwheel command"); + SYSERROR("Unable to allocate memory for cibuildwheel command"); return NULL; } } |
