With vs2017 there were several changes to the installation paths for VS including the vcvarsall.bat script used for setting the environment. To correctly get the paths for the newer versions of VS, we should use vswhere instead. This is similar to how the annotated builder sets the environment as well
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This defaults to the original behavior when vswhere.exe doesn't exist (so older versions of Visual Studio).
I see that in the code. The question was if you actually tested it with something older than VS 2015.
Anyway, LGTM.
I did test the snippet locally with 2015 and 2017. Is there a way to simulate the way the bots will execute the code as well?
It did occur to me after your question that this won't work if someone has vs2017 installed but wants to use an older version, so I need to re-think the logic a little bit. I'll send an update soon.
I updated the patch, so that it will not auto detect the VS installation unless explicitly requested. I also propagated the flag to all the builders that currently work with VS, so that it is available immediately if anyone chooses to create a buildbot with a newer VS installation.
Is there a way to test this (beyond running the logic locally) to make sure that all the bots will work correctly?
Thanks!
@gkistanova do you have a concern with the current changes or any additional testing you want me to do before I check this in?
The latest changes look too invasive for the purpose. And it seems confusing to have two parameters, both supposedly controlling the Visual Studio selection, especially when one could be silently ignored in some cases.
Could you use the first argument as a selector instead please?
Something like command=builders_util.getVisualStudioEnvironment(vs="autodetect", target_arch) would be good.
In this case no need to change any build factory and everything would keep working exactly as it was before your change.
zorg/buildbot/builders/Util.py | ||
---|---|---|
27 ↗ | (On Diff #170137) | Please do not use OS specific path handling, as this gets evaluated on the build master. OS build master is running under, and the OS where the build happens are usually different. |
zorg/buildbot/builders/Util.py | ||
---|---|---|
27 ↗ | (On Diff #170137) | Ok, so this is not the right change then as vswhere needs to run on the OS where the build is going to happen - otherwise, we will not correctly detect the version of visual studio. Is there a way to specify that we want the command to run on the build slave? |
Hi Stella,
Please see my notes inline.
Unless you want to do this by yourself, I can prepare this change. I think I have developed a good understanding of what you are after.
zorg/buildbot/builders/Util.py | ||
---|---|---|
26 ↗ | (On Diff #170137) | This thing also would run on the build master, which does not look like what you want. |
27 ↗ | (On Diff #170137) | You do build a command that would run on the build machine. But the Python script you write to build that command would be running on the build master. In other words, whatever you put in vcvars_command would go to a remote host to execute. |
Thanks, Galina. If you think it will be easier for you to make the change, that sounds great.
zorg/buildbot/builders/Util.py | ||
---|---|---|
26 ↗ | (On Diff #170137) | Yes, that's where vswhere is called and it has to run on the machine that will run the build. |