diff options
| author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2026-02-18 18:54:14 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-18 18:54:14 -0500 |
| commit | c7a6b5b8f7e535cc97fb1f8ed1ea2f55cdc28875 (patch) | |
| tree | b9c1b1215b03e59bf7b2aaf14ec12fd33fe2d3e1 /src/lib | |
| parent | d6b60205974136969212a2e415dadd773b471bc0 (diff) | |
| parent | bddde6dde420ae9d0bc6d8c2ad6865de7e90c73e (diff) | |
| download | stasis-c7a6b5b8f7e535cc97fb1f8ed1ea2f55cdc28875.tar.gz | |
Merge pull request #126 from jhunkeler/cibuildwheel
Use cibuildwheel
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/core/utils.c | 1 | ||||
| -rw-r--r-- | src/lib/delivery/delivery_build.c | 20 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/lib/core/utils.c b/src/lib/core/utils.c index 2cfebdf..00d747f 100644 --- a/src/lib/core/utils.c +++ b/src/lib/core/utils.c @@ -1017,6 +1017,7 @@ static int read_vcs_records(const size_t line, char **data) { // Ignore file comment(s) if (startswith(data_local, "#") || startswith(data_local, ";")) { // continue + guard_free(data_local); return 1; } diff --git a/src/lib/delivery/delivery_build.c b/src/lib/delivery/delivery_build.c index c5093d4..2f31b33 100644 --- a/src/lib/delivery/delivery_build.c +++ b/src/lib/delivery/delivery_build.c @@ -168,10 +168,9 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) { if (!pushd(srcdir)) { char dname[NAME_MAX]; char outdir[PATH_MAX]; - char cmd[PATH_MAX * 2]; + char *cmd = NULL; memset(dname, 0, sizeof(dname)); memset(outdir, 0, sizeof(outdir)); - memset(cmd, 0, sizeof(outdir)); const int dep_status = check_python_package_dependencies("."); if (dep_status) { @@ -194,11 +193,26 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) { return NULL; } - sprintf(cmd, "-m build -w -o %s", outdir); + if (asprintf(&cmd, "-m build -w -o %s", outdir) < 0) { + SYSERROR("%s", "Unable to allocate memory for build command"); + return NULL; + } + if (!strcmp(ctx->system.platform[DELIVERY_PLATFORM], "Linux") + && globals.enable_docker + && ctx->deploy.docker.capabilities.usable) { + guard_free(cmd); + 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"); + return NULL; + } + } + if (python_exec(cmd)) { fprintf(stderr, "failed to generate wheel package for %s-%s\n", ctx->tests[i].name, ctx->tests[i].version); guard_strlist_free(&result); + guard_free(cmd); return NULL; } popd(); |
