Repository navigation
Add support for MSVC Insider compiler - #4939
Conversation
|
Some of the infrastructure was put in place to allow the visual studio channel (Release vs Preview) to be user-selected. At one point most of the code necessary was in place but would have been an enormous PR and development was abandoned on that particular branch which started taking on more and more features. A quick-and-dirty prototype of This was done very quickly. There are a number of flaws with the implementation and the test suite was not run. It would take a bit of work to make it a first-class citizen. At which point adding the variant (Enterprise, Professional, Community) would likely be a next logical step. The experimental query functions were updated to illustrate selection. However, there are almost certainly bugs lurking due to internal caching and the existing 1:1 mapping of MSVC_VERSION to product directory. Certain internal data structures (cached or otherwise) probably need to expanded when passing data around and saved. In addition, there are calls into the sub-package and possible argument validation/verification that would have to be taken into account. Not all function comment blocks were updated. The reported msvc versions when a preview lookup fails is not correct as it may be the union of all instances found. Environment construction value
Release and Preview only search for their respective channel releases. test-msvc-insiders-files.zip contains:
For legacy reasons, VS instances are installed in custom locations without any spaces. Sample sconstruct for the proof-of-concept: Out from sample on a machine with Preview and Release versions of 2026 and 2022: |
|
Thanks for popping up. Wasn't quite sure how to take this comment - work was done towards this but got put aside because things got too complicated? Does that mean you'd prefer to revive that work? Does it make sense to deploy this PR as an interim until there's time to implement the more general |
Yes. I found the local branch containing the work that was abandoned. The "channel" support was a minor part. There was a lot of code movement. I don't remember exactly, but I suspect that there were going to be significant changes in the way values were passed around to carry more information. The last update was around 10/2023. One of the ongoing challenges is validation/verification that user parameters are consistent which is a challenge as more parameters are added.
Possibly. Before yesterday, I hadn't looked at the code in years.
I think there might be a more straightforward way to get there given the proposed implementation. While code expansion will be necessary, it may be better spent moving in a direction which may make other future goals easier. This is of those "it shouldn't be that hard" problems on its face but has to play nice with the code that is already in place; the ramifications of which may not be entirely obvious but deep seated. As always, I could be wrong. I'm willing to take a stab and implementing channel support. However, I'm not sure how quickly that can happen as I'm really time limited in the short term. Some observations on the current master implementation and how release/preview could be implemented with other future goals in mind:
There are a few things that I would do differently in the "proof-of-concept" prototype attached. If I were doing the work in earnest, I would likely first try:
For background context, attached is a zip file containing the abandoned MSCommon folder contents. I really don't remember the state that it was in when development stopped. Finishing likely would have resulted in a PR with an obscene number of changes. |
|
I'm thinking we merge this code, and when @jcbrill has time to submit a better/more complete PR we can revisit it then. |
|
How about if I add this in the manpage entry for <para>
<emphasis>New in version NEXT_RELEASE</emphasis>.
This flag is semi-experimental.
&SCons; will continue to support selecting a pre-release compiler,
but the details may possibly take a different form in a future release.
</para>I need to add the NEXT_RELEASE marker anyway, I forgot that. |
|
PR implementation notes:
The equivalent
The differences of the prototype implementation:
There are many ways to implement the ability to use Preview/Insiders instances. I'm not convinced the PR implementation of manipulating the vswhere state is the way to go. It brings a lot a baggage for a not quite complete payoff. My 2 cents. Disclaimer: all observations are human generated, Intelligence, Artificial or otherwise, was not employed :) |
|
I have updated the prototype to handle @mwichmann If you have time, could you test the prototype to see if offers the functionality expected? Branch: The definition of
Updated archive file: Sample SConstruct: Sample output: |
|
I will deploy this to test... might be a day or two. |
|
Thank you. I'm buried in other stuff for at least another week. There are a handful of query outputs that look strange but may be correct given the baked-in assumptions (mostly for versions 14.0 and earlier). |
These are preview builds - have previously not been available through SCons. The change adds an MSVC_PREVIEW varianble to enable, otherwise a released compiler will be selected. Development of the code for this feature was assisted by AI. Assisted-by: OpenCode with BigPickle LLM Signed-off-by: Mats Wichmann <mats@linux.com>
Some problems with the CI runs (namely - Python 3.9) are fixed and code otherwised synced with updated test tree. Signed-off-by: Mats Wichmann <mats@linux.com>
Signed-off-by: Mats Wichmann <mats@linux.com>
6753d92 to
61964e8
Compare
"Insiders" are preview builds - they have previously not been available through SCons. The change adds an
MSVC_PREVIEWvariable to enable, otherwise a released compiler will be selected.This is a pretty minimal approach - after trying this a few times I'm submitting because "it works for me", and we've lacked this capability, but open to suggestions if it's too simplistic.
Development of the code for this feature was assisted by AI.
Assisted-by: OpenCode with BigPickle LLM
Contributor Checklist:
CHANGES.txtandRELEASE.txt(and read theREADME.rst).