From 9863a96a91b853d70cc1972db1c36df65c6cfecf Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 16 Jun 2026 11:39:00 -0400 Subject: Ensure .condrc exists and conda knows where to find it --- src/lib/core/conda.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lib') diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c index b1d4cc2..8d2753d 100644 --- a/src/lib/core/conda.c +++ b/src/lib/core/conda.c @@ -585,6 +585,19 @@ int conda_check_required() { } int conda_setup_headless(struct CondaCapabilities *cc) { + mkdirs(cc->prefix, 0755); + + char rcpath[PATH_MAX]; + snprintf(rcpath, sizeof(rcpath), "%s/.condarc", cc->prefix); + touch(rcpath); + if (errno == ENOENT) { + errno = 0; + } + + setenv("CONDARC", rcpath, 1); + setenv("MAMBARC", rcpath, 1); + setenv("MAMBA_ROOT_PREFIX", cc->prefix, 1); + if (globals.verbose) { conda_exec("config --system --set quiet false"); } else { -- cgit