From 34bec11e8ff957bf92186cb40e3f96db20f82db9 Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Tue, 28 Mar 2023 11:08:38 +0200 Subject: [PATCH] Set solver right after `conda clean ...` to avoid incompatible caches (#355) --- anaconda-pkg-build/linux/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anaconda-pkg-build/linux/Dockerfile b/anaconda-pkg-build/linux/Dockerfile index 847517d8..c310ee6a 100644 --- a/anaconda-pkg-build/linux/Dockerfile +++ b/anaconda-pkg-build/linux/Dockerfile @@ -102,6 +102,9 @@ RUN MC_ARCH="$(uname -m)" \ && /opt/conda/bin/conda update --all --quiet --yes \ && /opt/conda/bin/conda install --quiet --yes conda-build conda-libmamba-solver \ && /opt/conda/bin/conda clean --all --yes \ + # The solver has to be set right after the `conda clean` call and before the next + # `conda install` call to avoid incompatible cache formats. + && /opt/conda/bin/conda config --system --set solver libmamba \ # Cache our C and C++ compilers so we don't have to download them with # each build; skipping the Fortran compiler as it's not used often # enough to justify the cache space. Note that we do NOT want to @@ -118,7 +121,6 @@ RUN MC_ARCH="$(uname -m)" \ # hadolint ignore=DL3059 RUN rm -fv /opt/conda/.condarc \ && /opt/conda/bin/conda config --system --set show_channel_urls True \ - && /opt/conda/bin/conda config --system --set solver libmamba \ && /opt/conda/bin/conda config --system --set add_pip_as_python_dependency False \ && /opt/conda/bin/conda config --show-sources