Skip to content

CI: recreate conda env from conda-forge to avoid mixed-channel solve#19255

Closed
rascani wants to merge 1 commit intopytorch:mainfrom
rascani:fix-conda-channel-priority
Closed

CI: recreate conda env from conda-forge to avoid mixed-channel solve#19255
rascani wants to merge 1 commit intopytorch:mainfrom
rascani:fix-conda-channel-priority

Conversation

@rascani
Copy link
Copy Markdown
Contributor

@rascani rascani commented May 1, 2026

Summary

pytorch/test-infra's setup-miniconda action pre-populates the conda env
at ${CONDA_PREFIX} with cmake=3.22, ninja=1.10, pkg-config=0.29, and
wheel=0.37 from the anaconda defaults channel. Our subsequent install
of cmake=3.31.2 from conda-forge has to reconcile two channels in one
solve, and that's been intermittently failing because conda-forge's
newer cmake needs transitive deps (libzlib>=1.3.1, rhash>=1.4.5) that
defaults' shipped versions don't satisfy. Patches that just tweak the
solver flags (--strict-channel-priority, --override-channels alone,
--update-deps) each address one symptom but expose another, because
libmamba on macOS has gaps around channel priority and in-place
upgrades that surface differently per runner class.

Tear down the pre-populated env and recreate it from conda-forge only
with --override-channels. The python version is read from the existing
env so we recreate at parity. Because we recreate at the same prefix,
${CONDA_RUN}, ${CONDA_INSTALL}, and the ~80 workflow callsites that
depend on those vars keep working unchanged. The cache layer in
setup-miniconda caches the base/clone-source rather than the per-run
env, so destroy+recreate doesn't disturb caching either.

Authored with Claude Code.

Test plan

CI

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 1, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19255

Note: Links to docs will display an error until the docs builds have been completed.

❌ 51 New Failures, 1 Pending, 1 Unrelated Failure

As of commit bf378fe with merge base e84a418 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@rascani rascani force-pushed the fix-conda-channel-priority branch from 094a17c to 7203a62 Compare May 1, 2026 16:20
@rascani rascani changed the title CI: use strict channel priority for conda installs CI: drop defaults channel from conda installs to fix mixed-channel solve May 1, 2026
pytorch/test-infra's setup-miniconda action pre-populates the conda env
at ${CONDA_PREFIX} with cmake=3.22, ninja=1.10, pkg-config=0.29, and
wheel=0.37 from the anaconda defaults channel. Our subsequent install
of cmake=3.31.2 from conda-forge has to reconcile two channels in one
solve, and that's been intermittently failing because conda-forge's
newer cmake needs transitive deps (libzlib>=1.3.1, rhash>=1.4.5) that
defaults' shipped versions don't satisfy. Patches that just tweak the
solver flags (--strict-channel-priority, --override-channels alone,
--update-deps) each address one symptom but expose another, because
libmamba on macOS has gaps around channel priority and in-place
upgrades that surface differently per runner class.

Tear down the pre-populated env and recreate it from conda-forge only
with --override-channels. The python version is read from the existing
env so we recreate at parity. Because we recreate at the same prefix,
${CONDA_RUN}, ${CONDA_INSTALL}, and the ~80 workflow callsites that
depend on those vars keep working unchanged. The cache layer in
setup-miniconda caches the base/clone-source rather than the per-run
env, so destroy+recreate doesn't disturb caching either.

This is the surgical short-term fix. The lasting fix is to plumb a
default-packages input through pytorch/test-infra's macos_job.yml so
we can pass default-packages: "" and skip the wasted install entirely;
that's a follow-up upstream PR.

Authored with Claude Code.
@rascani rascani force-pushed the fix-conda-channel-priority branch from 7203a62 to bf378fe Compare May 1, 2026 19:12
@rascani rascani changed the title CI: drop defaults channel from conda installs to fix mixed-channel solve CI: recreate conda env from conda-forge to avoid mixed-channel solve May 1, 2026
@rascani rascani closed this May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/cuda ciflow/metal ciflow/mlx ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant