From 6501468e71bc78871ca6a37bea35f415aa10a74e Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Mon, 25 May 2026 01:05:46 +0800 Subject: [PATCH] fix windows conda run encoding in workflows Enable UTF-8 for later conda run commands so anaconda-client version output does not fail under the Windows code page. fix conda plugin timing in windows workflows Set CONDA_NO_PLUGINS only after mamba installs anaconda-client so setup-miniconda can initialize normally while later conda commands avoid the anaconda-auth plugin crash. fix conda plugin crash in windows workflows Disable conda plugins in build jobs so anaconda-auth from anaconda-client does not break conda info or conda run on Windows. fix windows mamba bat quoting in workflows Pass the mamba.bat command to cmd without nested escaped quotes so Git Bash does not produce an invalid program name. fix windows mamba install in conda workflows Use the Windows mamba.bat entrypoint from Git Bash so the setup-miniconda wrapper does not break after recent runner updates. --- .github/workflows/multi-platform-build.yml | 9 ++++++++- .github/workflows/unilabos-conda-build.yml | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/multi-platform-build.yml b/.github/workflows/multi-platform-build.yml index 13f877c8..5d3496a0 100644 --- a/.github/workflows/multi-platform-build.yml +++ b/.github/workflows/multi-platform-build.yml @@ -115,7 +115,14 @@ jobs: - name: Install rattler-build and anaconda-client if: steps.should_build.outputs.should_build == 'true' run: | - mamba install -n build-env --override-channels -c conda-forge rattler-build anaconda-client -y + if [[ "$RUNNER_OS" == "Windows" ]]; then + cmd //D //S //C '%CONDA%\condabin\mamba.bat install -n build-env --override-channels -c conda-forge rattler-build anaconda-client -y' + else + mamba install -n build-env --override-channels -c conda-forge rattler-build anaconda-client -y + fi + echo "CONDA_NO_PLUGINS=true" >> "$GITHUB_ENV" + echo "PYTHONUTF8=1" >> "$GITHUB_ENV" + echo "PYTHONIOENCODING=utf-8" >> "$GITHUB_ENV" - name: Show environment info if: steps.should_build.outputs.should_build == 'true' diff --git a/.github/workflows/unilabos-conda-build.yml b/.github/workflows/unilabos-conda-build.yml index 0fc532b0..f269606c 100644 --- a/.github/workflows/unilabos-conda-build.yml +++ b/.github/workflows/unilabos-conda-build.yml @@ -108,7 +108,14 @@ jobs: - name: Install rattler-build and anaconda-client if: steps.should_build.outputs.should_build == 'true' run: | - mamba install -n build-env --override-channels -c conda-forge rattler-build anaconda-client -y + if [[ "$RUNNER_OS" == "Windows" ]]; then + cmd //D //S //C '%CONDA%\condabin\mamba.bat install -n build-env --override-channels -c conda-forge rattler-build anaconda-client -y' + else + mamba install -n build-env --override-channels -c conda-forge rattler-build anaconda-client -y + fi + echo "CONDA_NO_PLUGINS=true" >> "$GITHUB_ENV" + echo "PYTHONUTF8=1" >> "$GITHUB_ENV" + echo "PYTHONIOENCODING=utf-8" >> "$GITHUB_ENV" - name: Show environment info if: steps.should_build.outputs.should_build == 'true'