From 9489d31f6314322d26ec43196284b94069d6cd3a Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Sat, 20 Jul 2024 11:56:16 -0400 Subject: Regression tests, envctl, and bug fixes (#13) * Found too many bugs * Implements a regression test * Moves and completely refactors the envctl code * Allows the user to keep @STR@ values in output files (if you want full control over where external packages comes from post-build) * Fixes wording in a few places * envctl redaction is not implemented yet. The original redaction code hasn't been modified. * Use generic.ini instead of bare_minimum.ini --- src/delivery.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/delivery.c') diff --git a/src/delivery.c b/src/delivery.c index b27ab08..d7b9b99 100644 --- a/src/delivery.c +++ b/src/delivery.c @@ -1676,7 +1676,7 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) } remove(tempfile); guard_free(tempfile); - } else if (stage == DELIVERY_REWRITE_SPEC_STAGE_2) { + } else if (globals.enable_rewrite_spec_stage_2 && stage == DELIVERY_REWRITE_SPEC_STAGE_2) { // Replace "local" channel with the staging URL if (ctx->storage.conda_staging_url) { file_replace_text(filename, "@CONDA_CHANNEL@", ctx->storage.conda_staging_url, 0); @@ -1684,15 +1684,19 @@ void delivery_rewrite_spec(struct Delivery *ctx, char *filename, unsigned stage) sprintf(output, "%s/%s/%s/%s/packages/conda", globals.jfrog.url, globals.jfrog.repo, ctx->meta.mission, ctx->info.build_name); file_replace_text(filename, "@CONDA_CHANNEL@", output, 0); } else { - msg(STASIS_MSG_WARN, "conda_staging_url is not configured\n", filename); - file_replace_text(filename, " - @CONDA_CHANNEL@", "", 0); + msg(STASIS_MSG_WARN, "conda_staging_dir is not configured. Using fallback: '%s'\n", ctx->storage.conda_artifact_dir); + file_replace_text(filename, "@CONDA_CHANNEL@", ctx->storage.conda_artifact_dir, 0); } if (ctx->storage.wheel_staging_url) { file_replace_text(filename, "@PIP_ARGUMENTS@", ctx->storage.wheel_staging_url, 0); - } else if (globals.jfrog.repo) { + } else if (globals.jfrog.url && globals.jfrog.repo) { sprintf(output, "--extra-index-url %s/%s/%s/%s/packages/wheels", globals.jfrog.url, globals.jfrog.repo, ctx->meta.mission, ctx->info.build_name); file_replace_text(filename, "@PIP_ARGUMENTS@", output, 0); + } else { + msg(STASIS_MSG_WARN, "wheel_staging_dir is not configured. Using fallback: '%s'\n", ctx->storage.wheel_artifact_dir); + sprintf(output, "--extra-index-url file://%s", ctx->storage.wheel_artifact_dir); + file_replace_text(filename, "@PIP_ARGUMENTS@", output, 0); } } } -- cgit