Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake vcvarsall.bat detection more robust #25225
Comments
|
Actually, I've found a/the solution, but it seems @indygreg has already applied it at least to the part where firefox tries to locate cl.exe etc. It was in this https://developercommunity.visualstudio.com/content/problem/2813/cant-find-registry-entries-for-visual-studio-2017.html arcticle: The solution was:
It requires json parsing, but for me it was also able to work (the folder is there, even when you've installed VS 2017 on a completely different partition). Now before I dive deep into that, is there some mach API which we can use to use the location? |
|
What sort of API are you looking for? mach is pretty small: https://searchfox.org/mozilla-central/source/python/mach/mach |
|
Actually I am looking for the part where mach (if it's really mach) is detecting the VS Source Path as described in that article. Maybe it's not in mach but it's definitely in some python code, so it can't be part of configure/autoconf. Note that this issue is about allowing non-hardcoded VS Installation Paths, which for me seems common, especially when the Partition C is a small SSD and most data resides on another Partition (VS with all Options is just large) As a note to myself:
|
|
So I found what I'm looking for, but I'd like some feedback: Essentially we can take the way gecko does this, see here: https://searchfox.org/mozilla-central/rev/923eec8d2fb8078ebc7a33a9e1ce73eac01f7446/build/moz.configure/toolchain.configure#581 We can then walk the extra mile to analyse the installed packages, so we could warn the user if they didn't install the correct payloads. |
|
Correct, there is no configure step. Just mach commands, then cargo. |
Mach: Improve Visual Studio detection for non-standard-path installations Improve locating the Visual Studio installation --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25225 - [X] These changes do not require tests because testing build infrastructure is difficult
Mach: Improve Visual Studio detection for non-standard-path installations Improve locating the Visual Studio installation --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25225 - [X] These changes do not require tests because testing build infrastructure is difficult
Mach: Improve Visual Studio detection for non-standard-path installations Improve locating the Visual Studio installation --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25225 - [X] These changes do not require tests because testing build infrastructure is difficult
Mach: Improve Visual Studio detection for non-standard-path installations Improve locating the Visual Studio installation --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25225 - [X] These changes do not require tests because testing build infrastructure is difficult
Mach: Improve Visual Studio detection for non-standard-path installations Improve locating the Visual Studio installation --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25225 - [X] These changes do not require tests because testing build infrastructure is difficult
Mach: Improve Visual Studio detection for non-standard-path installations Improve locating the Visual Studio installation --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25225 - [X] These changes do not require tests because testing build infrastructure is difficult
Mach: Improve Visual Studio detection for non-standard-path installations Improve locating the Visual Studio installation --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25225 - [X] These changes do not require tests because testing build infrastructure is difficult
On my system, there are two installs of Visual Studio:
Now it seems that I don't even have a proper Visual Studio 2015 installed, which may be some kind of source for the problem, but using 2015 probably won't work either.
Windows says I only have
VS 2015 Shell (Isolated)andVS 2015 Tools for Unityinstalled.The problem is, that Visual Studio 2015 contains
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat.This is what mach is picking up (
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\is set) and thus it fails to locate MSBuild ("Can't find MSBuild.exe installation under C:\Program Files (x86)\Microsoft Visual Studio.")The real path should be
E:\Programme\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.batMaybe mach could just search all paths, launch the vcvarsall.bat, try to invoke msbuild.exe and use it to query the version of VS and then use the most recent one. I have to look into the registry as well, if there is something pointing to the VS 2017 Install Directory.
Workaround Number 2 from https://github.com/servo/servo/blob/master/README.md#troubleshooting-a-windows-environment makes MSBuild.exe available, but isn't a solution for me either, because I couldn't add python to the path, because Windows seems to truncate env vars to 1024 characters [and %PATH% got much longer than that when using said prompt]
Apart from that I'd want to go the unsupported way of making mach work under mozilla-build, i.e. the regular firefox environment, because I'm all set there (python installed, git installed, several tools and configurations).
It seems it suffers the same problem as mach.bat: just being unable to locate the vcvarsall.bat file.
I understand there might be no official support for my undertaking, but maybe someone else is willing to help out or my findings can help them with their environment somehow, because given my current situation, I am unable to build servo either way.
Edit1: Do note that multiple folders within the Visual Studio Folder are on the Path by default, so it might be an idea to scan %PATH% for vcvarsall.bat