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

[BUG] Windows + Conda - Code compilation errors due to VS code / vcvarsall.bat -> interrogate registry swap #4664

Open
mrmundt opened this issue Sep 30, 2024 · 1 comment
Labels
bug Needs Simplified Reproducer A simplified (ideally minimal) reproducer needs to be provided so that investigation may proceed

Comments

@mrmundt
Copy link

mrmundt commented Sep 30, 2024

setuptools version

setuptools>=74

Python version

All tested versions; distributed with conda (3.9-3.12)

OS

Windows

Additional environment information

Issue only occurs on windows+conda; we do not see it on windows+pip

Description

With the recent upgrade of setuptools, one of our project's extension builds (specifically with conda) is now failing with the error:

**** Building APPSI ****
Building in 'C:\Users\RUNNER~1\AppData\Local\Temp\tmpyzw9baoa'
ERROR: DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is
required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/

If we downgrade to setuptools<74 or we use pip instead of conda, we do not have this issue.

Expected behavior

We expect the compilation to run / build / not hit a "version required is not available" error.

How to Reproduce

There are a lot of steps to reproduce this because it happens significantly later in the CI process:
https://github.com/mrmundt/pyomo/actions/runs/11109169438/job/30863888315

The basic steps, though, are:

  1. Install miniconda for appropriate windows version
  2. Install dependencies through conda
  3. Install pyomo - pyomo setup.py develop
  4. Run download and build extensions:
        pyomo download-extensions 
        pyomo build-extensions # this is where the error occurs

Output

**** Building APPSI ****
Building in 'C:\Users\RUNNER~1\AppData\Local\Temp\tmpyzw9baoa'
ERROR: DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is
required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/
@mrmundt mrmundt added bug Needs Triage Issues that need to be evaluated for severity and status. labels Sep 30, 2024
@abravalheri
Copy link
Contributor

Hi @mrmundt thank you very much for reporting this.

I am afraid we need to reduce a bit more this reproducer so that we can reach the root cause of the problem. Ideally the reproducer needs removing all the extra layers to to expose a very elementary version of the problem with the bare minimum components.

For example, pyomo build-extensions seems to be encapsulating somehow the steps that setuptools uses to build projects.

Would it be possible for you to create a more simplified reproducer that does not rely on pyomo and uses the standard interface recommend by setuptools (specifically python -m build) for building?

If you want to use the dependencies installed via conda for the test, you can create a virtual environment with build installed on it1 and run python -m build --no-isolation.

Bonus points if you can create a very very basic mock extension code without the complexity of a real pyomo extension.

Other than that, please also note that in version 74 and 75 there were removals of deprecated functionality like in pypa/distutils#287, so if the setup you are using relies on them (or patches some of the removed modules) that might explain the change in behaviour.

Footnotes

  1. Please install build and pyproject-hooks<1.2, as we have identified a well know incompatibility with the latest versions of pyproject-hooks but we are working on it.

@abravalheri abravalheri added Needs Simplified Reproducer A simplified (ideally minimal) reproducer needs to be provided so that investigation may proceed and removed Needs Triage Issues that need to be evaluated for severity and status. labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Simplified Reproducer A simplified (ideally minimal) reproducer needs to be provided so that investigation may proceed
Projects
None yet
Development

No branches or pull requests

2 participants