Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the GLPK build on Windows for setuptools>74.0 #106

Merged
merged 17 commits into from
Nov 20, 2024
Merged

Conversation

cdiener
Copy link
Member

@cdiener cdiener commented Sep 3, 2024

Background

Starting from setuptools 74.0 setuptools has removed the deprecated MSVC toolchain. We did not actually use that to compile any Python packages, but we did use it to setup the compilation environment for building GLPK. Some functionality was restored into setuptool via setuptools.msvc.EnvironmentInfo but the return_env function there did not work as it is missing some env variables, most importantly the ones pointing towards the C standard lib which glpk needs.

Solution

As far as i can tell there is no way to setup the env with Python libraries anymore. The alternative is the good ol' vcvarsall.bat which is notoriously hard to locate in a MSVC install but will lead to a working environment. This PR adds a function to look for it with an initial guess that is the current location in Github Actions and a somehwat future-proof fallback that will simply go digging for it.

Backwards compatibility

The new solution does not use setuptools at all so it works will any version.

Don't forget to squash before merge. It needed a lot of experiments.

@cdiener cdiener marked this pull request as draft September 3, 2024 14:48
@cdiener cdiener marked this pull request as ready for review September 4, 2024 07:07
scripts/build_glpk.py Outdated Show resolved Hide resolved
@cdiener
Copy link
Member Author

cdiener commented Nov 20, 2024

@Midnighter Have a look now.

@cdiener cdiener merged commit 378d8ac into master Nov 20, 2024
5 checks passed
@cdiener cdiener deleted the fix/win_glpk branch November 20, 2024 10:09
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.

2 participants