[SERVER-51001] Allow specifying Visual Studio path/version for Windows builds Created: 17/Sep/20  Updated: 06/Dec/22  Resolved: 05/Jan/21

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Ryan Egesdahl (Inactive) Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Assigned Teams:
Server Development Platform
Sprint: Dev Platform 2021-01-25
Participants:

 Description   

We currently locate the VS tools using PATH. This is not ideal because there may be more than one version installed, and this means that finding the correct tool depends on system configuration rather than what is specified on the command line. We should instead find a way to specify one or a few default tool paths and allow specifying alternate paths the way we do with CC/CXX.



 Comments   
Comment by Ryan Egesdahl (Inactive) [ 05/Jan/21 ]

Fair enough. It's always nice to learn enough to find work you shouldn't be doing.

Comment by Andrew Morrow (Inactive) [ 05/Jan/21 ]

ryan.egesdahl - I think we should close this. The selected mechanism of specifying MSVC_VERSION on the command line was chosen because it models how SCons itself wants you to inform it of your chosen compiler. We could offer variables files that named the different compilers if we thought that would bring it more in line with other platforms, but those variables files would simply contain settings of MSVC_VERSION. I'm not sure that is worth the effort, and would prefer we document this under our build system documentation project.

Comment by Ryan Egesdahl (Inactive) [ 04/Jan/21 ]

acm I made this ticket before I fully understood how SCons selects the MSVC version. Also, there was a bit more discussion on what the problem actually was, and I neglected to update the description. Basically, the problem ended up being the fact that SCons was always selecting the latest version, which was causing problems in builds when a new version is added to the image. We figured out that this version selection mechanism exists since I made the ticket. The goal here is to make using MSVC look more like our other toolchains, if possible. If that's not something we really want to do/care about doing, or if you think it's something best handled by documentation, we can close this.

Comment by Andrew Morrow (Inactive) [ 04/Jan/21 ]

ryan.egesdahl - SCons doesn't exactly use PATH to find the tools on windows. There is an entire subsystem devoted to discovering the available versions of the VS tools available on the system via the registry, and you can explicitly select among the discovered versions by setting MSVC_VERSION=x.y on the command line. This was implemented in SERVER-44557 and backported all the way to v4.0.

Generated at Thu Feb 08 05:24:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.