Instruct intallation of python-virtualenv
Fixes servo/servo#23210
Closes servo/servo#23212
<!-- Please describe your changes on the following line: -->
(Re-)enable `./mach bootstrap` by requiring a separate installation step for packages python, python-pip and python-virtualenv.
---
<!-- 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#23210
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because bootstrap command is not covered by tests
<!-- 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. -->
Add OpenSSL 1.1.1 build check, Update HSTS Preload list
* This variant also works with cross-compilation. PR should fail in CI on Android at first:
The net crate successfully compiled after switching to OpenSSL 1.1.1 on Android. It seemed openssl.sh doesn't need any changes.(?)
* Updated HSTS preload list and public suffix list.
* Configured OpenSSL [SECLEVEL=2](https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_security_level.html) like [Debian](https://wiki.debian.org/ContinuousIntegration/TriagingTips/openssl-1.1.1) Stable:
> As a result RSA, DSA and DH keys shorter than [2048 bits](16a5a9bb78/docs/BR.md (6153-subscriber-certificates)) and ECC keys shorter than 224 bits are prohibited.
* Although all other crates compile I generally get a `libscript-fe019dd3e0a4e06d.rlib: bad extended name index at 8` error on simpleservo_jniapi, I guess Debian Testing is too new and I just haven't found the right steps so far.
./mach build -d --android
```
= note: /home/darkspirit/github/servo/android-toolchains/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.gold: error: /home/darkspirit/github/servo/target/android/armv7-linux-androideabi/debug/deps/libscript-fe019dd3e0a4e06d.rlib: bad extended name index at 8
clang: error: linker command failed with exit code 1 (use -v to see invocation)
toolchain: /home/darkspirit/github/servo/android-toolchains/ndk/toolchains/llvm/prebuilt/linux-x86_64/bin
libs dir: /home/darkspirit/github/servo/android-toolchains/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a
sysroot: /home/darkspirit/github/servo/android-toolchains/ndk/platforms/android-21/arch-arm
targetdir: /home/darkspirit/github/servo/target/android/armv7-linux-androideabi/debug/build/simpleservo_jniapi-26ef18debb5b3630/out/../../..
```
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#25708, fix#25619.
Revert ANGLE upgrade.
This reverts commit ce6204b904, reversing
changes made to 904fcb4317.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix#25683
mach: fix `bootstrap-android` on Python 3
When running `python3 ./mach bootstrap-android`, this error occurs:
```
AttributeError: 'HTTPMessage' object has no attribute 'getheader'
File "/servo/python/servo/bootstrap_commands.py", line 136, in bootstrap_android
download("sdk", tools.format(system=system))
File "/servo/python/servo/bootstrap_commands.py", line 117, in download
download_file(filename, url, archive)
File "/servo/python/servo/util.py", line 170, in download_file
download(desc, src, fd)
File "/servo/python/servo/util.py", line 110, in download
if resp.info().getheader('Content-Length'):
```
Use the `get()` function instead, which exists in both Python 3 and 2
(where it is a synonym for `getheader()`).
Fixes#25616.
When running `python3 ./mach bootstrap-android`, this error occurs:
```
AttributeError: 'HTTPMessage' object has no attribute 'getheader'
File "/servo/python/servo/bootstrap_commands.py", line 136, in bootstrap_android
download("sdk", tools.format(system=system))
File "/servo/python/servo/bootstrap_commands.py", line 117, in download
download_file(filename, url, archive)
File "/servo/python/servo/util.py", line 170, in download_file
download(desc, src, fd)
File "/servo/python/servo/util.py", line 110, in download
if resp.info().getheader('Content-Length'):
```
Use the `get()` function instead, which exists in both Python 3 and 2
(where it is a synonym for `getheader()`).
Fixes#25616.
Previously, when running Mach on Python 3, specifying a target when building
causes this error:
```
TypeError: a bytes-like object is required, not 'str'
File "/servo/python/servo/build_commands.py", line 241, in build
self.ensure_bootstrapped(target=target)
File "/servo/python/servo/command_base.py", line 1023, in ensure_bootstrapped
["rustup", "target", "list", "--installed", "--toolchain", toolchain]
```
This change encodes the target using utf-8 before comparing.
Fixes#25614.
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
Add &DomRoot<T> lint check
So far, the lint check code appears to work as intended. However, some trait implementations require modification to pass the lint check and I'm not sure how to fix these. Commit 92cf5d5 attempts to correct one of the implementations, but fails to compile with error:
```
--> components/script/dom/servoparser/xml.rs:76:36
|
76 | tree_builder.trace_handles(&tracer);
| ^^^^^^^ expected struct `dom::bindings::root::Dom`, found struct `dom::node::Node`
|
= note: expected struct `dom::bindings::root::Dom<dom::node::Node>`
found struct `dom::node::Node`
= note: required for the cast to the object type `dyn html5ever::tree_builder::Tracer<Handle = dom::bindings::root::Dom<dom::node::Node>>`
```
I've tried to debug further but to no avail. I also don't want to mangle too much existing code unnecessarily. Any help is appreciated.
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
`./mach test-tidy --all` does, and some are directly related to this PR
- [ ] These changes fix#25342
The fix is a WIP
<!-- Either: -->
- [X] There are tests for these changes
Note that I will clean up the commit history before the final PR.
<!-- 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. -->
Use filename instead of opened file descriptor when calling ZipFile
This should fix#25251
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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 ___
<!-- 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. -->
mach clean now finds the right virtualenv to remove
<!-- Please describe your changes on the following line: -->
mach clean now knows about the 00cf7452ef change and will remove _virtualenv2.7 appropriately
---
<!-- 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 problems discussed today with SimonSapin in IRC
<!-- Either: -->
- [X] These changes do not require tests because the functionality being changed uninstalls some of the test framework
<!-- 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. -->
Enable some mach commands to be run with python3
This change finally enable the following commands to be run with python3:
* `build`
* `test-unit`
* `package`
As previously explained, `test-tidy` will require more work in the wpt repository directly. Maybe `test-tidy --no-wpt` is achievable relatively quickly though.
For possible remaining bits that might need to be worked on, see https://github.com/servo/servo/issues/23607
---
<!-- 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
<!-- Either: -->
- [x] There are tests for these changes
<!-- 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. -->