From 095793d256f97ef8bd0820ffee78be1f6c8c9349 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 6 May 2026 17:16:44 -0400 Subject: terminate strings --- src/lib/delivery/delivery_install.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/delivery/delivery_install.c') diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c index 4d52b82..e699122 100644 --- a/src/lib/delivery/delivery_install.c +++ b/src/lib/delivery/delivery_install.c @@ -376,14 +376,16 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha if (INSTALL_PKG_CONDA_DEFERRED & type) { strncat(command_base, " --use-local", sizeof(command_base) - strlen(command_base) - 1); + command_base[sizeof(command_base) - 1] = '\0'; } else if (INSTALL_PKG_PIP_DEFERRED & type) { // Don't change the baseline package set unless we're working with a // new build. Release candidates will need to keep packages as stable // as possible between releases. if (!ctx->meta.based_on) { strncat(command_base, " --upgrade", sizeof(command_base) - strlen(command_base) - 1); + command_base[sizeof(command_base) - 1] = '\0'; } - snprintf(command_base + strlen(command_base), sizeof(command_base), " --extra-index-url 'file://%s'", ctx->storage.wheel_artifact_dir); + snprintf(command_base + strlen(command_base), sizeof(command_base) - strlen(command_base), " --extra-index-url 'file://%s'", ctx->storage.wheel_artifact_dir); } size_t args_alloc_len = STASIS_BUFSIZ; -- cgit From 5ec6f09c2abcc866b4ba34a995d5f61e7851df48 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 6 May 2026 17:17:06 -0400 Subject: Add debug output --- src/lib/delivery/delivery_install.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib/delivery/delivery_install.c') diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c index e699122..ca41c82 100644 --- a/src/lib/delivery/delivery_install.c +++ b/src/lib/delivery/delivery_install.c @@ -404,15 +404,18 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha continue; } if (INSTALL_PKG_PIP_DEFERRED & type) { + SYSDEBUG("Getting requirements for test: %s", name); struct Test *info = requirement_from_test(ctx, name); if (info) { if (!strcmp(info->version, "HEAD") || is_git_sha(info->version)) { + SYSDEBUG("Using version: %s", info->version); struct StrList *tag_data = strlist_init(); if (!tag_data) { SYSERROR("Unable to allocate memory for tag data"); guard_free(args); return -1; } + SYSDEBUG("%s", "Tokenizing repository info tag: %s\n", info->repository_info_tag); strlist_append_tokenize(tag_data, info->repository_info_tag, "-"); struct WheelInfo *whl = NULL; @@ -420,13 +423,16 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha char *hash = NULL; if (strlist_count(tag_data) > 1) { post_commit = strlist_item(tag_data, 1); + SYSDEBUG("post_commit: %s", post_commit); hash = strlist_item(tag_data, 2); + SYSDEBUG("hash: %s", hash); } // We can't match on version here (index 0). The wheel's version is not guaranteed to be // equal to the tag; setuptools_scm auto-increments the value, the user can change it manually, // etc. errno = 0; + SYSDEBUG("%s", "Getting wheel information"); whl = wheelinfo_get(ctx->storage.wheel_artifact_dir, info->name, (char *[]) {ctx->meta.python_compact, ctx->system.arch, "none", "any", @@ -441,8 +447,10 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha SYSERROR("No wheel packages found that match the description of '%s'", info->name); } else { // found, replace the original version with newly detected version + SYSDEBUG("Replacing version: %s", whl->version); guard_free(info->version); info->version = strdup(whl->version); + SYSDEBUG("Version replaced with: %s", whl->version); } guard_strlist_free(&tag_data); wheelinfo_free(&whl); -- cgit From 69c99be43c918f7f0723fa6632ae1a766ed794e5 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sun, 10 May 2026 20:33:31 -0400 Subject: Update macro --- src/lib/delivery/delivery_install.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/delivery/delivery_install.c') diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c index ca41c82..d39fa3e 100644 --- a/src/lib/delivery/delivery_install.c +++ b/src/lib/delivery/delivery_install.c @@ -415,7 +415,7 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha guard_free(args); return -1; } - SYSDEBUG("%s", "Tokenizing repository info tag: %s\n", info->repository_info_tag); + SYSDEBUG("Tokenizing repository info tag: %s\n", info->repository_info_tag); strlist_append_tokenize(tag_data, info->repository_info_tag, "-"); struct WheelInfo *whl = NULL; -- cgit From 48066ec0b4491b6b07d90c4da82dc98f2dc62bff Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 12 May 2026 10:43:38 -0400 Subject: remove linefeed from debug message --- src/lib/delivery/delivery_install.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/delivery/delivery_install.c') diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c index d39fa3e..037098d 100644 --- a/src/lib/delivery/delivery_install.c +++ b/src/lib/delivery/delivery_install.c @@ -415,7 +415,7 @@ int delivery_install_packages(struct Delivery *ctx, char *conda_install_dir, cha guard_free(args); return -1; } - SYSDEBUG("Tokenizing repository info tag: %s\n", info->repository_info_tag); + SYSDEBUG("Tokenizing repository info tag: %s", info->repository_info_tag); strlist_append_tokenize(tag_data, info->repository_info_tag, "-"); struct WheelInfo *whl = NULL; -- cgit From 898044af3a714481ca40d244f92a31296d503d55 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 12 May 2026 10:44:55 -0400 Subject: when no spec is present use the package name instead --- src/lib/delivery/delivery_install.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/lib/delivery/delivery_install.c') diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c index 037098d..538ae15 100644 --- a/src/lib/delivery/delivery_install.c +++ b/src/lib/delivery/delivery_install.c @@ -235,12 +235,16 @@ int delivery_conda_enforce_package_version(struct Delivery *ctx, const char *env goto cleanup; } if (strstr(item, name)) { - char *spec_tmp = find_version_spec((char *) item); - while (!isalnum(*spec_tmp)) { - spec_tmp++; + const char *spec_tmp = find_version_spec((char *) item); + if (spec_tmp) { + while (!isalnum(*spec_tmp)) { + spec_tmp++; + } + spec_request = strdup(spec_tmp); + } else { + spec_request = strdup(item); } - spec_request = strdup(spec_tmp); if (!spec_request) { SYSERROR("unable to allocate memory for conda package spec request"); status = -1; -- cgit From 95786be9be8c77709c197b8efbcebd13d9ca8049 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 12 May 2026 10:45:24 -0400 Subject: if conda fails, return --- src/lib/delivery/delivery_install.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/lib/delivery/delivery_install.c') diff --git a/src/lib/delivery/delivery_install.c b/src/lib/delivery/delivery_install.c index 538ae15..efdb819 100644 --- a/src/lib/delivery/delivery_install.c +++ b/src/lib/delivery/delivery_install.c @@ -265,9 +265,17 @@ int delivery_conda_enforce_package_version(struct Delivery *ctx, const char *env } snprintf(cmd, PATH_MAX, "remove --name %s %s", env_name, name); - conda_exec(cmd); + if (conda_exec(cmd)) { + SYSERROR("unable to remove package %s from %s", name, env_name); + status = -1; + goto cleanup; + } snprintf(cmd, PATH_MAX, "install --name %s %s=%s", env_name, name, spec_request); - conda_exec(cmd); + if (conda_exec(cmd)) { + SYSERROR("unable to install package %s into %s", name, env_name); + status = -1; + goto cleanup; + } cleanup: guard_free(spec_request); -- cgit