Skip to content

Commit 094a17c

Browse files
committed
CI: use strict channel priority for conda installs
macOS and Linux CI jobs that run `conda install -c conda-forge ...` have been intermittently failing at env solve time with errors like: LibMambaUnsatisfiableError: package cmake-3.31.2-h326f17c_0 requires libzlib >=1.3.1,<2.0a0, but ... zlib 1.2.13.* is not installable. The miniconda base env brings in older packages (e.g. zlib=1.2.13) from the anaconda defaults channel, while conda-env-ci.txt's pins resolve through conda-forge which ships newer transitive deps (libzlib>=1.3.1). With both channels active and equal priority, conda's solver picks ambiguously and tips into unsatisfiable. The same pattern surfaced in the Voxtral metal e2e job during the ffmpeg install in test_model_e2e.sh and would eventually bite the libstdcxx-ng installs in cuda.yml and the aarch64 openblas install in install_conda.sh. Adding `--strict-channel-priority` to every `conda install -c conda-forge` site forces conda-forge to win for every package it provides, so the defaults/conda-forge mismatch can no longer perturb the solve. This is the conda-forge community's canonical recommendation for exactly this mixed-channel scenario; it does not break the patched call sites because each of them already targets conda-forge-only packages. The remaining conda install sites in the repo (.ci/docker/common/utils.sh:20 and .ci/scripts/setup-windows-msvc.ps1:5) intentionally do not pass -c conda-forge and are left untouched, as is the sibling mkl install at install_conda.sh:44. Authored with Claude Code.
1 parent e84a418 commit 094a17c

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

.ci/docker/common/install_conda.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ install_python() {
3939

4040
# From https://github.com/pytorch/pytorch/blob/main/.ci/docker/common/install_conda.sh
4141
if [[ $(uname -m) == "aarch64" ]]; then
42-
conda_install "openblas==0.3.29=*openmp*" -c conda-forge
42+
conda_install "openblas==0.3.29=*openmp*" -c conda-forge --strict-channel-priority
4343
else
4444
conda_install mkl=2022.1.0 mkl-include=2022.1.0
4545
fi

.ci/scripts/setup-conda.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ set -ex
99

1010
install_conda() {
1111
pushd .ci/docker || return
12-
${CONDA_INSTALL} -c conda-forge -y --file conda-env-ci.txt
12+
# --strict-channel-priority makes conda-forge win for every package it
13+
# provides, eliminating the defaults/conda-forge conflict that
14+
# intermittently broke the macOS solve (LibMambaUnsatisfiableError on
15+
# cmake's libzlib >=1.3.1 vs base-env zlib 1.2.13).
16+
${CONDA_INSTALL} -c conda-forge --strict-channel-priority -y --file conda-env-ci.txt
1317
popd || return
1418
}
1519

.ci/scripts/test_model_e2e.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ fi
258258
if [ "$AUDIO_URL" != "" ]; then
259259
curl -L $AUDIO_URL -o ${MODEL_DIR}/$AUDIO_FILE
260260
elif [[ "$MODEL_NAME" == *whisper* ]] || [ "$MODEL_NAME" = "voxtral_realtime" ]; then
261-
conda install -y -c conda-forge "ffmpeg<8"
261+
conda install -y -c conda-forge --strict-channel-priority "ffmpeg<8"
262262
pip install datasets soundfile
263263
# We pushd'd into EXECUTORCH_ROOT above, so torch_pin is importable here.
264264
TORCHCODEC_PKG=$(python -c "from torch_pin import torchcodec_spec; print(torchcodec_spec())")

.github/workflows/cuda.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
126126
# The Triton-compiled .so files in the CUDA backend require GLIBCXX_3.4.29
127127
# which the default system libstdc++ doesn't have. Install a newer one.
128-
conda install -y -c conda-forge 'libstdcxx-ng>=12'
128+
conda install -y -c conda-forge --strict-channel-priority 'libstdcxx-ng>=12'
129129
export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
130130
131131
# Build ExecuTorch with CUDA support
@@ -433,7 +433,7 @@ jobs:
433433
# The embedded .so files in the CUDA blob require GLIBCXX_3.4.29
434434
# which the default conda libstdc++ doesn't have. Install a newer
435435
# libstdc++ from conda-forge and use it via LD_PRELOAD.
436-
conda install -y -c conda-forge 'libstdcxx-ng>=12'
436+
conda install -y -c conda-forge --strict-channel-priority 'libstdcxx-ng>=12'
437437
export LD_LIBRARY_PATH=/opt/conda/lib:$LD_LIBRARY_PATH
438438
# Verify the new libstdc++ has GLIBCXX_3.4.29
439439
strings /opt/conda/lib/libstdc++.so.6 | grep GLIBCXX_3.4.29 || {

0 commit comments

Comments
 (0)