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 upMach: Improve Visual Studio detection for non-standard-path installations #25300
Conversation
highfive
commented
Dec 16, 2019
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @paulrouget (or someone else) soon. |
highfive
commented
Dec 16, 2019
|
Heads up! This PR modifies the following files:
|
|
Explanation: I understand if you don't want to maintain/integrate these changes, but it might help others being stuck in the same situation. I've also did it so that the default behavior is kept and only replaced when the operation fails. There are problems (apart from the "political" decision about maintenance and whethere this code should be touched or not):
[1]:
|
ed26599
to
22af70b
|
I think the existing detection code isn't needed if vswhere is used. ( |
|
The mozjs build failure happens when your CARGO_HOME directory is on a different drive than your servo working directory. |
| vers = find_highest_msvc_version_ext() | ||
| for version in sorted(vers, key=lambda tup: float(tup[1])): | ||
| return version | ||
| print("Can't find MSBuild.exe installation under %s. Try so specify the VSINSTALLDIR and VisualStudioVersion" + |
This comment has been minimized.
This comment has been minimized.
jdm
Dec 16, 2019
Member
Let's say "Please set the VSINSTALLDIR and VisualStudioVersion environment variables." instead.
|
|
||
| vers = find_highest_msvc_version_ext() | ||
| for version in sorted(vers, key=lambda tup: float(tup[1])): | ||
| return version |
This comment has been minimized.
This comment has been minimized.
jdm
Dec 16, 2019
Member
Let's write this as:
versions = sorted(vers, key=lambda tup: float(tup[1]))
if not versions:
print(...)
sys.exit(1)
return versions[0]
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ions
22af70b
to
0a80dd9
|
@bors-servo r+ |
|
|
|
What about the two remaining things (which could be follow ups to this PR):
|
|
I am not aware of any requirement for the graphics workload. It's not clear to me what we can do differently with mach.bat. |
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
Is this a reply for my comment? Not sure how relevant it is... |
|
No, it's a reply to the part of the earlier comment that mentions a failure to build mozjs_sys. |
|
|
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
|
|
|
Speaking of mach.bat, in my opinion, we could delete everything before Line 49 in 79408fa The reason is, that this searches for visual studio installations the old/legacy way and calls vcvars.bat. In my experiments, having vcvars.bat excluded didn't break anything, especially since the code already locates the path to VS and uses that one (no need to have them on PATH, wouldn't work for me anyway [path limited to 1024 chars...]). So we could do one of two things (or leave it as it is, of course):
|
Launch vcvarsall.bat for the recognized VS Installation Directory from python instead of making mach.bat try that on hardcoded paths. Move the Execution of vcvars (which sets up the environment for visual studio tools) from mach.bat to python, so that ./mach works under mozilla-build and that #25300 can be used. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25360 #25336 - [X] These changes do not require tests because changes to build infra
|
@bors-servo retry |
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
|
|
|
@bors-servo retry
|
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
|
|
Launch vcvarsall.bat for the recognized VS Installation Directory from python instead of making mach.bat try that on hardcoded paths. Move the Execution of vcvars (which sets up the environment for visual studio tools) from mach.bat to python, so that ./mach works under mozilla-build and that #25300 can be used. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25360 #25336 - [X] These changes do not require tests because changes to build infra
Launch vcvarsall.bat for the recognized VS Installation Directory from python instead of making mach.bat try that on hardcoded paths. Move the Execution of vcvars (which sets up the environment for visual studio tools) from mach.bat to python, so that ./mach works under mozilla-build and that #25300 can be used. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #25360 #25336 - [X] These changes do not require tests because changes to build infra
MeFisto94 commentedDec 16, 2019
•
edited by jdm
Improve locating the Visual Studio installation
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors