Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .ci/scripts/setup-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,22 @@ set -ex

install_conda() {
pushd .ci/docker || return
${CONDA_INSTALL} -c conda-forge -y --file conda-env-ci.txt

# The env created by pytorch/test-infra's setup-miniconda is pre-populated
# with cmake=3.22 ninja=1.10 pkg-config=0.29 wheel=0.37 from the anaconda
# defaults channel. Mixing those with conda-forge's newer transitive deps
# required by our cmake=3.31.2 pin (libzlib>=1.3.1, rhash>=1.4.5) has been
# intermittently failing the libmamba solver, especially on ephemeral
# GitHub-hosted macOS runners where the env is fresh every job. Tear down
# the pre-populated env and recreate it from conda-forge only so the solve
# never has to reconcile two channels.
PY_VERSION=$(conda run -p "${CONDA_PREFIX}" python -c \
'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')

conda env remove --prefix "${CONDA_PREFIX}" -y
conda create --prefix "${CONDA_PREFIX}" -c conda-forge --override-channels -y \
"python=${PY_VERSION}" --file conda-env-ci.txt

popd || return
}

Expand Down
Loading