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 upPy2 #23098
Py2 #23098
Conversation
highfive
commented
Mar 26, 2019
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. |
highfive
commented
Mar 26, 2019
|
Heads up! This PR modifies the following files:
|
|
I can't quite figure out what's up with the automated Trusty failures. I've tried on minimal 16.04 and 18.04 VMs with I made a revision to match the same style with minimal changes and not require virtualenv 'early'. |
|
As I'm getting further and further into bootstrapping Servo, it looks like mach.bat needs to be reworked to support Visual Studio 2019, as well as not screw up the environment if one is already provided (whether VS Command Line, or manually provided). Otherwise, it's simply too aggressive and clobbers the environment which causes even further quiet errors that are confusing to resolve. |
61a6b53
to
86bb79e
|
Failing any syntax errors, that should support both VS2019 and user-supplied environments from mach.bat. Bases an existing environment off of There is technically a semantics change with using setlocal/endlocal in mach.bat, but it keeps the environment clean so is probably a net win. Would reinitialize the Visual Studio environment (if one isn't supplied) each time mach.bat is called, but also makes abundantly clear which compiler is being used. |
|
These changes break using mach on linux:
|
|
I'm fine with the goal of these changes, but I don't know enough about the low-level details of imports and modules and different versions to suggest how not to break our CI, unfortunately. |
|
@bors-servo try |
Py2 <!-- Please describe your changes on the following line: --> 86bb79e: Rework mach.bat to support VS2019 and user-supplied environments. f6bd2d2: Default mach.bat to using py -2. 81d48c9: Don't assume the user's environment in mach_bootstrap. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23083 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it changes the python bootstrap slightly and the changes are obvious. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> The virtualenv changes shouldn't disrupt anything as it just uses the existing python (being used) to call itself `-m virtualenv`, and only if it exists. imp is still apparently the preferred builtin way to find this in Python 2.x without actually importing it. Importing it would cause an unused import warning in tidy. It still picks up the new things in _virtualenv, just no longer has a special case for Win32/MSYS because it's no longer needed. The .bat change is the simplest I could think of that allows fallback in both cases and is no worse than before. `where /Q` is documented by Microsoft to return 0 if a successful match is found, and print nothing in either case. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23098) <!-- Reviewable:end -->
|
Presumably we will need: Depending on the results of the try run, we may need to adjust https://github.com/servo/saltfs/ for the rest of our CI as well. |
|
Windows taskcluster:
|
|
Cleaned up the mach issue (I forgot about the environment), as well as the requested change on mach_bootstrap.py. |
On Windows with multiple Pythons installed, this was causing python2.7 to bootstrap a 3.7 virtualenv that it couldn't make use of. PIP_NAMES wasn't used at all, and VIRTUALENV_NAMES ends up being unused now.
Servo already assumes the user has Python, this is the primary way to make sure that Python 2 is preferred, and you should get a sensible error message if you have python 3 but not 2. But first, check that py.exe exists because if a system has only Python 2.x only, it won't have it. If it doesn't, then try python.exe.
As a bonus, use setlocal to avoid environment pollution.
|
Hmm, even |
Py2 <!-- Please describe your changes on the following line: --> da31023: Rework mach.bat to support VS2019 and user-supplied environments. 4551f60: Default mach.bat to using py -2. 03e4708: Don't assume the user's environment in mach_bootstrap. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23083 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it changes the python bootstrap slightly and the changes are obvious. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> The virtualenv changes shouldn't disrupt anything as it just uses the existing python (being used) to call itself `-m virtualenv`, and only if it exists. imp is still apparently the preferred builtin way to find this in Python 2.x without actually importing it. Importing it would cause an unused import warning in tidy. It still picks up the new things in _virtualenv, just no longer has a special case for Win32/MSYS because it's no longer needed. The .bat change is the simplest I could think of that allows fallback in both cases and is no worse than before. `where /Q` is documented by Microsoft to return 0 if a successful match is found, and print nothing in either case. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23098) <!-- Reviewable:end -->
|
|
|
@bors-servo r+ |
|
|
Py2 <!-- Please describe your changes on the following line: --> da31023: Rework mach.bat to support VS2019 and user-supplied environments. 4551f60: Default mach.bat to using py -2. 03e4708: Don't assume the user's environment in mach_bootstrap. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23083 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it changes the python bootstrap slightly and the changes are obvious. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> The virtualenv changes shouldn't disrupt anything as it just uses the existing python (being used) to call itself `-m virtualenv`, and only if it exists. imp is still apparently the preferred builtin way to find this in Python 2.x without actually importing it. Importing it would cause an unused import warning in tidy. It still picks up the new things in _virtualenv, just no longer has a special case for Win32/MSYS because it's no longer needed. The .bat change is the simplest I could think of that allows fallback in both cases and is no worse than before. `where /Q` is documented by Microsoft to return 0 if a successful match is found, and print nothing in either case. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23098) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Py2 <!-- Please describe your changes on the following line: --> da31023: Rework mach.bat to support VS2019 and user-supplied environments. 4551f60: Default mach.bat to using py -2. 03e4708: Don't assume the user's environment in mach_bootstrap. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23083 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because it changes the python bootstrap slightly and the changes are obvious. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> The virtualenv changes shouldn't disrupt anything as it just uses the existing python (being used) to call itself `-m virtualenv`, and only if it exists. imp is still apparently the preferred builtin way to find this in Python 2.x without actually importing it. Importing it would cause an unused import warning in tidy. It still picks up the new things in _virtualenv, just no longer has a special case for Win32/MSYS because it's no longer needed. The .bat change is the simplest I could think of that allows fallback in both cases and is no worse than before. `where /Q` is documented by Microsoft to return 0 if a successful match is found, and print nothing in either case. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23098) <!-- Reviewable:end -->
|
|
build_commands: Make Visual Studio detection not assume environment <!-- Please describe your changes on the following line: --> Ever since 3dd1bfc, servo breaks building if you're not running Visual Studio 2015 or 2017 in the default location on C:. I rewrote the PR to not assume environment, similarly to #23098. We need to stop meeting like this.🦊 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because 3dd1bfc didn't. Realistically, there should be environment tests for Visual Studio 2015, 2017, and 2019, but I won't have the time for it soon. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24051) <!-- Reviewable:end -->
build_commands: Make Visual Studio detection not assume environment <!-- Please describe your changes on the following line: --> Ever since 3dd1bfc, servo breaks building if you're not running Visual Studio 2015 or 2017 in the default location on C:. I rewrote the PR to not assume environment, similarly to #23098. We need to stop meeting like this.🦊 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because 3dd1bfc didn't. Realistically, there should be environment tests for Visual Studio 2015, 2017, and 2019, but I won't have the time for it soon. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24051) <!-- Reviewable:end -->
build_commands: Make Visual Studio detection not assume environment <!-- Please describe your changes on the following line: --> Ever since 681d7b1, servo breaks building if you're not running Visual Studio 2015 or 2017 in the default location on C:. I rewrote the PR to not assume environment, similarly to #23098. We need to stop meeting like this.🦊 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because 681d7b1 didn't. Realistically, there should be environment tests for Visual Studio 2015, 2017, and 2019, but I won't have the time for it soon. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24051) <!-- Reviewable:end -->
build_commands: Make Visual Studio detection not assume environment <!-- Please describe your changes on the following line: --> Ever since 681d7b1, servo breaks building if you're not running Visual Studio 2015 or 2017 in the default location on C:. I rewrote the PR to not assume environment, similarly to #23098. We need to stop meeting like this.🦊 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because 681d7b1 didn't. Realistically, there should be environment tests for Visual Studio 2015, 2017, and 2019, but I won't have the time for it soon. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24051) <!-- Reviewable:end -->
TheGoddessInari commentedMar 26, 2019
•
edited
da31023: Rework mach.bat to support VS2019 and user-supplied environments.
4551f60: Default mach.bat to using py -2.
03e4708: Don't assume the user's environment in mach_bootstrap.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThe virtualenv changes shouldn't disrupt anything as it just uses the existing python (being used) to call itself
-m virtualenv, and only if it exists. imp is still apparently the preferred builtin way to find this in Python 2.x without actually importing it. Importing it would cause an unused import warning in tidy. It still picks up the new things in _virtualenv, just no longer has a special case for Win32/MSYS because it's no longer needed.The .bat change is the simplest I could think of that allows fallback in both cases and is no worse than before.
where /Qis documented by Microsoft to return 0 if a successful match is found, and print nothing in either case.This change is