Commit graph

30 commits

Author SHA1 Message Date
Delan Azabani
14db055d46
Fix mach argument quoting on NixOS (#35573)
This patch makes mach shell-quote its arguments when rerunning itself
with `nix-shell`, so that spaces and other special characters are
handled correctly.

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-02-21 08:21:50 +00:00
Mukilan Thiyagarajan
88a35b3cc9
mach: adopt uv and avoid system python (#34632)
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>
2024-12-16 09:20:37 +00:00
Mukilan Thiyagarajan
2f64dde623
Revert "mach: switch to uv for managing python venv (#34504)" (#34548)
This reverts commit 4103421ba5.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-12-10 03:43:50 +00:00
Mukilan Thiyagarajan
4103421ba5
mach: switch to uv for managing python venv (#34504)
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>
2024-12-09 14:52:06 +00:00
Peter Mikola
4ddbdc61a3
tweak mach files a little bit (#34485)
Signed-off-by: Peter MIKOLA <mikopet@mikopet.dev>
2024-12-06 15:57:30 +00:00
Michael Mc Donnell
3fa1d3d9cf
Check maximum Python version in mach (#34490)
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>
2024-12-05 21:15:02 +00:00
Delan Azabani
67012a5091
Remove etc/shell.nix in favour of shell.nix (#34336)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-11-22 04:03:35 +00:00
Smitty
f27227b1db
Make Android build optional on Nix (#31231)
* 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>
2024-02-02 02:13:24 +00:00
Martin Robinson
e726893165
mach: Error out sooner with Python < 3.10 (#31225)
We upgraded our Python dependency to 3.10, but neglected to update mach.
This change makes sure we error out sooner, rather than later.
2024-01-30 12:02:23 +00:00
Delan Azabani
94a3c49a80
Allow building with Nix on Linux distros other than NixOS (#31001)
* 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
2024-01-09 10:29:25 +00:00
Martin Robinson
f5627ce4cc
Remove __future__ imports that are no longer necessary (#30661)
These are no longer necessary as we always use Python 3.
2023-11-02 12:01:10 +00:00
Delan Azabani
048ca7806b
mach: fix exit status on NixOS (#30079) 2023-08-08 09:09:27 +00:00
David Heidelberg
aa0484d76b
mach: cleanup after dropping Python 2 support
Signed-off-by: David Heidelberg <david@ixit.cz>
2021-07-19 14:24:29 +02:00
Maciej Krüger
49fc87f385
extend message about nixOS shell 2021-06-21 09:13:47 +02:00
Maciej Krüger
8e48b6fd74
add NixOS support to mach and automatically re-launch mach in nix-shell 2021-06-04 10:56:41 +02:00
Vincent Ricard
a627dde0d0 Port some code to Python3 2021-02-18 09:35:46 -05:00
Kagami Sascha Rosylight
bb1d3193e5 Don't run multiprocessing hack on Python 3 2020-06-20 16:16:51 +02:00
marmeladema
67c2c115c0 Allow to run mach with Python3 (>=3.5) 2019-12-09 19:31:46 +00:00
Bastien Orivel
7f5e6db63d Check for python's version in mach
On archlinux, python 2 isn't installed by default and it leads to some
really confusing error messages when running mach
2019-06-03 22:02:52 +02:00
Jan Andre Ikenmeyer
f5ab95786f
Update MPL license to https (part 1) 2018-11-19 14:46:43 +01:00
Manish Goregaokar
e72e08ea9c Allow bootstrap to be run before anything else is installed 2018-09-11 19:34:38 +05:30
Josh Matthews
64cbf02084 Revert "build(mach): locate vs via vswhere on win32"
This reverts commit c20efd5e9a.
2018-08-20 12:58:59 -04:00
OJ Kwon
c20efd5e9a
build(mach): locate vs via vswhere on win32 2018-06-20 11:30:58 -07:00
Ravi Shankar
c8e43958ad Disable bytecode generation in mach 2017-04-10 23:09:07 +05:30
Jack Moffitt
8e8519d038 Fix test-wpt and test-css for Windows.
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).
2016-11-16 10:38:15 -07:00
Ravi Shankar
b579841183 Minor cleanup of mach and bootstrap script 2016-09-01 17:25:36 +05:30
Vladimir Vukicevic
5bbec7469d Native MSVC windows build, convert to cmake 2016-08-17 09:50:51 -04:00
Per Lundberg
347b7bb51d Redirect stderr to /dev/null
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.
2016-05-25 00:28:06 +03:00
Aidan Hobson Sayers
078d21b6e2 Minor style tweak 2015-09-14 20:55:23 +01:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00