-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
MSVC detection: 2019, 2017, 2017 Express, and 6.0 #3699
Comments
There's a routine to trim the version to a numeric-only version, perhaps use that rather than add another entry to the dictionary? Not that it's a big deal either way.
It's used by a testcase in |
Unless I'm missing something, the larger problem is I don't think you want the same vswhere query for both 14.1 and 14.1Exp: the same list is going to be returned for both 14.1 and 14.1Exp. In the end, one or both may be wrong depending on the number of installed instances. Proposed implementation notes and rationale:
|
different products string, right. I was just thinking of the old/existing dict which has only the version part of the query.
yes, we've talked about this elsewhere before, "the maintainer" is in favor, I know. an issue was whether to bother with what vswhere calls "legacy" versions - I feel those don't return enough information to be worth bothering with, but that's just one opinion.
if the json output is used, it is easy enough to exttract the properties you want (which I think you were saying) |
In the prototypes to support specific version numbers, vswhere was moved to a single call with json output as the product types and installation paths for all installations where easily identified. This also allowed specific product type to be selected by a user via the environment. Moving forward, I'm not sure there is a compelling reason to have "14.1Exp" as a user-facing option. In the prototype work having a distinction between "14.1" and "14.1Exp" made the implementation of specific version/product selection harder than it needs to be. |
Does #3701 resolve all these issues? |
Yes it resolves all of these issues. |
Closing |
Describe the bug
During the investigation of possible to solutions to issue #3664, 3 problems with msvc detection and another problem with clearing a local rather than global variable were discovered:
The function reset_installed_vcs is creating and setting a local variable of __INSTALLED_VCS_RUN rather than resetting the global variable. Ramifications unkown.
Initial detection of MSVC 6.0 fails due to a case-sensitive search for "cl.exe". On the local machine, the file name is "CL.EXE". Note that while 6.0 is not in the reported installed versions list, actually using 6.0 is successful (i.e., the initial detection reports a false negative).
Detection of "14.1Exp" fails with an UnsupportedVersion exception because the _VCVER_TO_VSWHERE_VER dictionary does not contain a key for "14.Exp".
The current vswhere queries are unreliable when multiple versions of msvc for each product are installed. This is due in part to the limitations of the vswhere tool itself. (Note: "14.1Exp" was added to the _VCVER_TO_VSWHERE_VER dictionary mentioned above.
14.2 [2019] with Community and BuildTools installed: find_vc_pdir_vswhere returns the BuildTools instance (i.e., the first entry in the products list).
14.1 [2017] with Community and Express installed: find_vc_pdir_vswhere returns the WDExpress instance for "14.1" (i.e., the first entry in the products list).
14.1Exp [2017] with Community and Express installed: find_vc_pdir_vswhere returns the WDExpress instance for "14.1Exp" (i.e., the first entry in the products list).
Required information
Link to SCons Users thread discussing your issue: this has not gone through the mailing list. Some discussions took place in MSVC Version 14.1 not found with 14.2 installed #3664.
Version of SCons: current master
Version of Python: 3.7.7
Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc): WinPython 32-bit
How you installed SCons: setup from scons_master.zip download
What Platform are you on? (Linux/Windows and which version): Windows 7 32-bit
How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues.
Install: MSVC 6.0, 2017 Community, 2017 Express, 2019 Community, 2019 Build Tools
set SCONS_MSCOMMON_DEBUG=-
Further information:
No tests where performed concerning the global variable issue mentioned above.
Possible solutions to all of the msvc detection issues were implemented. If desired, a pull request can be generated.
The text was updated successfully, but these errors were encountered: