diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-16 11:40:41 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-22 11:57:05 -0400 |
| commit | b95f5a2fed749f7fe5154927620457385b0292f8 (patch) | |
| tree | 130a9d2bfaf503be95b532ca8ee116d147d5ec85 /src | |
| parent | f9c7645c6491a8f38b957d52df934911e0a51472 (diff) | |
| download | stasis-b95f5a2fed749f7fe5154927620457385b0292f8.tar.gz | |
Passing the conda installation directory to delivery_conda_enable isn't necessary
* The delivery context already provides this path
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/delivery/delivery_conda.c | 15 | ||||
| -rw-r--r-- | src/lib/delivery/include/delivery.h | 3 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/delivery/delivery_conda.c b/src/lib/delivery/delivery_conda.c index 12eddb7..4f2920e 100644 --- a/src/lib/delivery/delivery_conda.c +++ b/src/lib/delivery/delivery_conda.c @@ -103,18 +103,14 @@ void delivery_install_conda(char *install_script, char *conda_install_dir) { } } -void delivery_conda_enable(struct Delivery *ctx, char *conda_install_dir) { +void delivery_conda_enable(struct Delivery *ctx) { setenv("MAMBA_ROOT_PREFIX", ctx->storage.conda_install_prefix, 1); - if (conda_activate(conda_install_dir, "base")) { - SYSERROR("conda activation failed"); - exit(1); - } // Setting the CONDARC environment variable appears to be the only consistent // way to make sure the file is used. Not setting this variable leads to strange // behavior, especially if a conda environment is already active when STASIS is loaded. char rcpath[PATH_MAX]; - snprintf(rcpath, sizeof(rcpath), "%s/%s", conda_install_dir, ".condarc"); + snprintf(rcpath, sizeof(rcpath), "%s/%s", ctx->storage.conda_install_prefix, ".condarc"); setenv("CONDARC", rcpath, 1); setenv("MAMBARC", rcpath, 1); if (runtime_replace(&ctx->runtime.environ, __environ)) { @@ -122,8 +118,13 @@ void delivery_conda_enable(struct Delivery *ctx, char *conda_install_dir) { exit(1); } + if (conda_activate(ctx->storage.conda_install_prefix, "base")) { + SYSERROR("conda activation failed"); + exit(1); + } + char pinned[PATH_MAX]; - snprintf(pinned, sizeof(pinned), "%s/conda-meta/pinned", conda_install_dir); + snprintf(pinned, sizeof(pinned), "%s/conda-meta/pinned", ctx->storage.conda_install_prefix); touch(pinned); if (errno == ENOENT) { errno = 0; diff --git a/src/lib/delivery/include/delivery.h b/src/lib/delivery/include/delivery.h index 60255fe..7d846ab 100644 --- a/src/lib/delivery/include/delivery.h +++ b/src/lib/delivery/include/delivery.h @@ -356,9 +356,8 @@ void delivery_defer_packages(struct Delivery *ctx, int type); /** * Configure and activate a Conda installation based on Delivery context * @param ctx pointer to Delivery context - * @param conda_install_dir path to Conda installation */ -void delivery_conda_enable(struct Delivery *ctx, char *conda_install_dir); +void delivery_conda_enable(struct Delivery *ctx); /** * Install Conda |
