Skip to content

Harden Conda Build workflow against broken-pipe diagnostic failure#2957

Merged
JacksonBurns merged 2 commits into
mainfrom
copilot/fix-conda-build-workflow-failure
May 19, 2026
Merged

Harden Conda Build workflow against broken-pipe diagnostic failure#2957
JacksonBurns merged 2 commits into
mainfrom
copilot/fix-conda-build-workflow-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

Note from @rwest: I asked co-pilot to diagnose the failed conda build workflow. The job ended with

  - `Exception ignored on flushing sys.stdout:`
  - `BrokenPipeError: [Errno 32] Broken pipe`
  - `Process completed with exit code 120`

This PR patches what it suspects to be the problem. It might be wrong. But I'll let the tests run...

The Conda Build workflow can fail with BrokenPipeError/exit code 120 when diagnostic output is truncated via head. This updates the workflow to use a pipe-safe diagnostic command and ensures Conda package installation is explicitly non-interactive.

  • Workflow reliability updates (.github/workflows/conda_build.yml)

    • Replaced conda list -n base | head -40 with conda list -n base | sed -n '1,40p' to avoid early pipe closure during diagnostics.
    • Updated build-tools installation to conda install -y python anaconda-client conda-build to enforce non-interactive execution in CI.
  • Scope

    • No behavior changes outside the Conda Build workflow steps above.
- name: Install Build Tools
  run: conda install -y python anaconda-client conda-build

- name: Show solver and runner info
  run: |
    conda info
    conda config --show-sources
    conda list -n base | sed -n '1,40p'
Original prompt

Create a pull request in repository ReactionMechanismGenerator/RMG-Py to fix the failing GitHub Actions job from run 26100487142, job 76759511865.

Context:

Relevant workflow content:

  • The workflow currently has a diagnostic step:
    • conda list -n base | head -40
  • It also has an install step:
    • conda install python anaconda-client conda-build

Requested solution:

  1. Update .github/workflows/conda_build.yml to avoid the broken-pipe failure in diagnostics by replacing the head pipeline with a pipe-safe alternative such as sed -n '1,40p'.
  2. Update the Conda install command to be non-interactive by adding -y.
  3. Keep the patch minimal and focused on fixing the CI failure.
  4. Open a pull request with a clear title and description.
  5. In the PR description, include a short explanation of why the change is needed: the workflow log shows a broken pipe during stdout flushing, and the updated commands make the diagnostics safer and the install step non-interactive.

Expected file change:

  • .github/workflows/conda_build.yml

Please implement the patch and create the PR.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The failure is in the workflow setup, not in RMG-Py source code.

Root cause

The job exits during “Install Build Tools” in .github/workflows/conda_build.yml:

- name: Install Build Tools
  run: conda install python anaconda-client conda-build

The log ends with:

  • Exception ignored on flushing sys.stdout: BrokenPipeError: [Errno 32] Broken pipe
  • Process completed with exit code 120

That pattern is consistent with conda install producing output that gets piped or truncated badly in the runner environment, especially after the preceding diagnostic step uses:

conda list -n base | head -40

from .github/workflows/conda_build.yml.
The head pipeline can trigger a harmless-but-fatal broken-pipe behavior in some shells/tooling combinations.

Fix

Make the diagnostic step pipe-safe, and make the install step non-interactive and quieter.

Recommended workflow patch

- name: Show solver and runner info
  run: |
    conda info
    conda config --show-sources
    conda list -n base | sed -n '1,40p' || true
    uname -a
    sysctl hw.memsize hw.ncpu hw.physicalcpu 2>/dev/null || cat /proc/meminfo 2>/dev/null | head -3 || true

- name: Install Build Tools
  run: |
    conda install -y python anaconda-client conda-build

Why this should solve it

  • Replacing head -40 with sed -n '1,40p' avoids the early pipe close that can trigger BrokenPipeError.
  • Adding -y to conda install removes any chance of an interactive prompt causing abnormal termination.
  • Keeping the install step simpler reduces runner-side stdout/stderr handling issues.

Optional hardening

If you want the step to be even more stable, pin the shell behavior explicitly:

defaults:
  run:
    shell: bash --noprofile --norc -el {0}

But the main fix is the pipeline change plus conda install -y.

Files involved

Suggested final edit

- name: Install Build Tools
  run: conda install -y python anaconda-client conda-build

- name: Show solver and runner info
  run: |
    conda info
    conda config --show-sources
    conda list -n base | sed -n '1,40p' || true
    uname -a
    sysctl hw.memsize hw.ncpu hw.physicalcpu 2>/dev/null || cat /proc/meminfo 2>/dev/null | head -3 || true

This is the smallest focused change most likely to stop this job from failing.

User: open a PR with these patches, and a comment explaining why

Assistant: I’ve submitted the PR request with the patch and explanation; once it finishes, I can help review the final diff or PR text if you want.

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Fix failing Conda Build workflow due to broken pipe error Harden Conda Build workflow against broken-pipe diagnostic failure May 19, 2026
Copilot AI requested a review from rwest May 19, 2026 14:33
Copilot finished work on behalf of rwest May 19, 2026 14:47
@rwest
Copy link
Copy Markdown
Member

rwest commented May 19, 2026

@JacksonBurns sorry about the churn. the Conda Build action has just failed a few times on #2955

This seems to fix it (or at least, it succeeded on this PR)

@rwest rwest marked this pull request as ready for review May 19, 2026 15:48
@rwest rwest requested a review from JacksonBurns May 19, 2026 15:48
Copy link
Copy Markdown
Contributor

@JacksonBurns JacksonBurns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwest thanks for keeping the patches going - GHA is a pain

@JacksonBurns JacksonBurns enabled auto-merge May 19, 2026 15:50
@JacksonBurns JacksonBurns merged commit 4655082 into main May 19, 2026
17 of 18 checks passed
@JacksonBurns JacksonBurns deleted the copilot/fix-conda-build-workflow-failure branch May 19, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants