pypa / pypa/setuptools

[BUG] Incorrect VSxxCOMNTOOLS environment variable calculation in find_vcvarsall

Open
#2,810 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

setuptools version

58.2.0

Python version

any

OS

Windows

Additional environment information

No response

Description

There is a bug in
https://github.com/pypa/setuptools/blob/3dd1af099fc1379935a975a2a5f1561870c9dc92/setuptools/_distutils/msvc9compiler.py#L232

"%f" will round its argument, e.g. if version==15.9 the above line will emit incorrect environment variable name
VS160COMNTOOLS

Expected behavior

Possible solution is
toolskey = "VS%0.f0COMNTOOLS" % int(version)

How to Reproduce

not applicable

Output

not applicable

Code of Conduct
  • I agree to follow the PSF Code of Conduct

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in setuptools/_distutils/msvc9compiler.py at the referenced line in find_vcvarsall. Check how the current formatting calculates the VSxxCOMNTOOLS environment variable, especially for version 15.9, and compare it with the expected variable name in the issue. Done means the calculation no longer rounds the version into an incorrect environment variable name.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.