Skip to content

Fix Windows cibuildwheel failure: linker cannot find openblas.lib#1

Closed
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-cibuildwheel-windows-failure
Closed

Fix Windows cibuildwheel failure: linker cannot find openblas.lib#1
Copilot wants to merge 4 commits into
masterfrom
copilot/fix-cibuildwheel-windows-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 18, 2026

Windows builds were failing with LNK1181: cannot open input file 'openblas.lib'. Environment variables for library paths defined in workflow YAML were not propagating to cibuildwheel's isolated build environment.

Changes

  • Moved Windows configuration to pyproject.toml: CIBW_BEFORE_ALL_WINDOWS and CIBW_ENVIRONMENT_WINDOWS now defined in [tool.cibuildwheel.windows] section where cibuildwheel correctly passes them to the build
  • Added library path environment variables: EASYSBA_INCLUDE_DIRS and EASYSBA_LIBRARY_DIRS point to vcpkg's x64-windows installation paths
  • PowerShell-based vcpkg setup: Conditional check for existing vcpkg installation before clone/bootstrap
  • Enhanced caching: Hash-based cache key with restore-keys for vcpkg artifacts

Configuration

[tool.cibuildwheel.windows]
before-all = "powershell -Command \"if (!(Test-Path C:\\vcpkg\\vcpkg.exe)) { git clone https://github.com/microsoft/vcpkg.git C:\\vcpkg; C:\\vcpkg\\bootstrap-vcpkg.bat -disableMetrics }; C:\\vcpkg\\vcpkg.exe install openblas:x64-windows\""
environment = { 
  EASYSBA_LAPACK_LIBS = "openblas", 
  EASYSBA_INCLUDE_DIRS = "C:\\vcpkg\\installed\\x64-windows\\include", 
  EASYSBA_LIBRARY_DIRS = "C:\\vcpkg\\installed\\x64-windows\\lib" 
}

The setup.py already parses these environment variables via _parse_path_env() and adds them to library_dirs for the Extension.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 18, 2026 20:55
Co-authored-by: alexlib <747110+alexlib@users.noreply.github.com>
Co-authored-by: alexlib <747110+alexlib@users.noreply.github.com>
Co-authored-by: alexlib <747110+alexlib@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failure of cibuildwheel on Windows platform Fix Windows cibuildwheel failure: linker cannot find openblas.lib Feb 18, 2026
Copilot AI requested a review from alexlib February 18, 2026 21:01
@alexlib alexlib marked this pull request as ready for review February 18, 2026 22:11
Copilot AI review requested due to automatic review settings February 18, 2026 22:11
@alexlib alexlib closed this Feb 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Windows cibuildwheel failures caused by the linker being unable to locate openblas.lib. The root issue was that environment variables defined in the GitHub Actions workflow YAML were not propagating to cibuildwheel's isolated build environment.

Changes:

  • Relocated Windows-specific cibuildwheel configuration from workflow YAML to pyproject.toml
  • Added library and include path environment variables pointing to vcpkg installation directories
  • Enhanced vcpkg caching with hash-based keys and restore fallbacks

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pyproject.toml Added Windows cibuildwheel configuration with vcpkg setup command and environment variables for library/include paths
.github/workflows/cibuildwheel.yml Removed Windows environment variables from workflow and improved vcpkg cache configuration
Comments suppressed due to low confidence (2)

pyproject.toml:32

  • The command string uses semicolons to chain PowerShell commands, which can fail silently if any intermediate command fails. Consider using -ErrorAction Stop and separating commands with && or properly handling errors to ensure the vcpkg installation doesn't proceed if cloning or bootstrapping fails.
before-all = "powershell -Command \"if (!(Test-Path C:\\vcpkg\\vcpkg.exe)) { git clone https://github.com/microsoft/vcpkg.git C:\\vcpkg; C:\\vcpkg\\bootstrap-vcpkg.bat -disableMetrics }; C:\\vcpkg\\vcpkg.exe install openblas:x64-windows\""

pyproject.toml:33

  • The hardcoded paths C:\\vcpkg\\installed\\x64-windows\\include and C:\\vcpkg\\installed\\x64-windows\\lib are duplicated from the before-all command and tightly couple the configuration to this specific installation location. Consider using a variable or ensuring consistency if the vcpkg path ever needs to change.
environment = { EASYSBA_LAPACK_LIBS = "openblas", EASYSBA_INCLUDE_DIRS = "C:\\vcpkg\\installed\\x64-windows\\include", EASYSBA_LIBRARY_DIRS = "C:\\vcpkg\\installed\\x64-windows\\lib" }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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