This allows us to use `uv` for:
1. Installing a pinned Python version
2. Installing the dependency packages using `uv`'s pip compatible interface.
4. Bootstrapping `mach` without a Python installion on the host, using `uv
run`
This change also introduces a new 'composite' GitHub action to setup
python in the different CI workflows. There is no support for externally
managed python installations and virtual environments. These could be
added in the future.
Fixes#34095, #34547
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This patch switches servo to use `uv` for both installing a pinned
Python version as well as installing the dependency packages using
`uv`'s pip compatible interface. It also introduces a new 'composite'
GitHub action to setup python in the different CI workflows.
There is no support for externally managed python installations and
virtual environments. These could be added in the future.
Fixes#34095
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Mach is currently failing bootstrap and building if the Python version
is greater than 3.12. This is because wpt does not support 3.13 yet.
This causes confusion for people running recent distros that ship 3.13
by default.
I changed the logic so that mach checks both the minimum and the maximum
supported versions of Python instead of just checking the minimum. It
will now also tell you which maximum version is supported.
I also updated the README.md to specify the supported Python versions
so that people don't accidentally install the wrong version.
Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
* Make Android build optional on Nix
I want to build Servo without also installing the entire Android SDK.
This makes it so Android support is only built if `buildAndroid` is
true.
Signed-off-by: syvb <me@iter.ca>
* Add Android support to nix-shell if SERVO_ANDROID_BUILD set
---------
Signed-off-by: syvb <me@iter.ca>
* remove NixOS check from mach wrapper
* pin nixpkgs to fix jemalloc-sys + mozangle build scripts
* add stdenv.cc.cc to LD_LIBRARY_PATH to fix webrender build.rs
* add all buildInputs to LD_LIBRARY_PATH to fix ldd servo
* add glib + zlib to buildInputs to fix ldd servo
* working! patchelf --remove-rpath --set-interpreter
* undo changes that were ultimately unhelpful
* make compiled programs independent of Nix
* avoid installing patchelf’d toolchains in ~/.rustup
* remove another spurious change
* fix rustup pollution
* only enable on other distros when MACH_USE_NIX is set
In addition to minor changes for Windows, this forces Windows Python to
be used for all Windows builds (instead of using Windows Python only for
pc-windows-msvc builds).
We already redirect stdout, but the problem is that (at least on Windows/MSYS2), the `which` command tends to output things to stderr when failing:
```
$ ./mach build -d
which: no python2.7 in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/c/Program Files/Java/jdk1.8.0_66/bin:/c/Python27:/c/Python27/Scripts)
```
This PR silences this noise.