Skip to content

[ci] avoid overwriting installed 'build' in build-python.sh - #7356

Merged
jameslamb merged 3 commits into
mainfrom
fix-windows-builds
Jul 14, 2026
Merged

jameslamb merged 3 commits into
mainfrom
fix-windows-builds

Conversation

@jameslamb

@jameslamb jameslamb commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Fixes #7354

build shells out to python and in LightGBM's CI appears to be mixing interpreters:

[INFO] --- building wheel ---
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - scikit-build-core>=0.11.0
> C:\Miniconda\envs\test-env\python.exe -m pip --python
  C:\Users\runneradmin\tmp\build-env-sjc10dui\Scripts\python.exe install
  --ignore-installed --use-pep517 --no-warn-script-location --no-compile --no-
  input -r C:\Users\runneradmin\tmp\build-requirements-vbl05rlk.txt

(build link)

I think that leads to the DLL-loading issues, and that the root cause is pip-installing build into an environment otherwise managed by conda.

This proposes fixing that by:

  • removing pip install build in build-python.sh
  • manually installing it in CI before that script's invoked (with conda for conda-based jobs, pip for pip-based jobs)

Notes for Reviewers

"breaking"?

This is labeled breaking because this could break any workflows that relied on this script installing build.

I think it's well worth doing, to avoid issues like #7354, which users could just as easily face. It'd probably also be welcomed by repackagers, who'd prefer to tightly control how dependencies are installed instead of having this one-off pip install running in a build script.

@jameslamb jameslamb changed the title WIP: [ci] avoid overwriting installed 'build' in build-python.sh [ci] avoid overwriting installed 'build' in build-python.sh Jul 10, 2026
@jameslamb jameslamb added the blocking CI will be unsuccessful until this is resolved. label Jul 10, 2026
@jameslamb
jameslamb marked this pull request as ready for review July 10, 2026 05:27
@jameslamb

Copy link
Copy Markdown
Member Author

@jmoralez could you help out with a review on this one to unblock CI?

@jameslamb

Copy link
Copy Markdown
Member Author

Thanks for all the reviews @borchero , I'll merge this and get CI going on the other approved-but-blocked-by-this PRs.

@jameslamb jameslamb removed the blocking CI will be unsuccessful until this is resolved. label Jul 14, 2026
@jameslamb
jameslamb merged commit 688d789 into main Jul 14, 2026
75 of 78 checks passed
@jameslamb
jameslamb deleted the fix-windows-builds branch July 14, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] Python tests failing (Windows + MSVC only): "DLL load failed while importing pyexpat"

2 participants