aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/util.py
Commit message (Collapse)AuthorAgeFilesLines
* Implement `bootstrap-gstreamer` for all platformsMartin Robinson2023-05-251-17/+49
| | | | | | | | | | | | | | | | | | This change makes it so that the Platform classes can now handle installing GStreamer dependencies and properly setting up the environment including when cross-compiling. For Windows and Linux is now installed into `target/dependencies/gstreamer` when not installed system-wide. In addition: 1. Creating and moving existing environment path append helpers to `util.py`. 2. Combining the `set_run_env` and `build_dev` functions and moving some outside code into them so that it can be shared. Now code that used to call `set_run_env` calls `build_dev` and then `os.environ.update(...)`. 3. Adding Python typing information in many places. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Start organizing platform-specific Python codeMartin Robinson2023-05-191-35/+4
| | | | | | This starts to split platform-specific Python code into its own module, which should help to tidy up our mach commands and make things more reusable.
* Replace usage of six.moves.urllib with urllibMartin Robinson2023-04-101-3/+3
| | | | | | Also organize some of the imports. Now that Servo only uses Python 3, this module is unnecessary. This is part of the gradual migration to using only Python 3.
* fix zip extraction for python 3takumi2020-02-071-0/+15
|
* mach: fix `bootstrap-android` on Python 3Zhuowei Zhang2020-01-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* Fix StringIO module import to be compatible with Python3marmeladema2019-10-161-2/+2
|
* Fix except statement in order to be compatible with Python3marmeladema2019-10-161-3/+3
|
* Use urllib from six module in order to be compatible with Python3marmeladema2019-10-161-6/+6
|
* Fix certifi import error while running ./match bootstrapShanavas M2019-01-031-9/+17
| | | | Fixes #22590
* Reduce log spam for large downloads made from machSimon Sapin2018-10-111-2/+11
| | | | Printing the same line again is a no-op on an actual terminal, but Taskcluster’s log viewer shows each such line separately.
* Allow bootstrap to be run before anything else is installedManish Goregaokar2018-09-111-1/+1
|
* TidySimon Sapin2018-07-021-0/+3
|
* boostrap: set executable bits when extracting zip filesSimon Sapin2018-07-021-4/+20
|
* Add `./mach bootstrap-android`Simon Sapin2018-07-021-0/+13
|
* Ensure readonly files can be removed on Windows.Josh Matthews2018-03-081-1/+8
|
* Use rustup.rs instead of custom bootstrapSimon Sapin2018-01-101-5/+2
| | | | Fixes #11361, closes #18874
* Only pass cafile argument to urlopen in Python versions that support it.Simon Sapin2017-10-191-1/+15
|
* Bootstrap: use 'certifi' package to obtain up-to-date root CA list.Simon Sapin2017-10-191-1/+2
| | | | | The default root CA store on our Windows CI builders does not trust static.rust-lang.org
* Bootstrap: print URLs being downloaded.Simon Sapin2017-10-181-2/+2
|
* Auto merge of #18145 - tigercosmos:master, r=larsbergstrombors-servo2017-10-161-15/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix windows build issue #18055 <!-- Please describe your changes on the following line: --> With some reasons, the windows and VS environment do not set the `env("PLATFORM")` variable. So, there's no need to check the variable, and set `os_type` equl to `pc-windows-msvc` as default. Then the script can get correct url to download `rustc`. --- <!-- 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 #18055 (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. --> <!-- 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/18145) <!-- Reviewable:end -->
| * fix windows build issuetigercosmos2017-08-191-15/+2
| |
* | Handle aarch64 cpu_typeHiroshi Hatake2017-08-241-0/+2
|/
* Move delete function to util.pyAneesh Agrawal2017-04-181-5/+13
| | | | This makes it easier to reuse in other places.
* Remove more deprecated Windows GNU code/docsAneesh Agrawal2017-04-161-4/+0
|
* Add support for Visual Studio 2017UK9922017-04-111-1/+1
|
* Disable LLVM assertions by default, on supported platforms.Simon Sapin2017-02-161-1/+5
| | | | But keep them on linux-dev CI.
* Avoid hardcoded references to rustc in download()Aneesh Agrawal2017-01-151-5/+5
| | | | | | | Use the `desc` parameter instead to make the error messages customized for the actual download. Also use new-style format strings.
* Create a util.py Python module for common functionsAneesh Agrawal2017-01-151-0/+151
Extracting these functions helps avoid circular dependencies, and make them easier to find/reuse.