4 Commits

Author SHA1 Message Date
Daniel Paoliello
0f2adc6f05 mach: Force the use of arm64 Python when running with Windows on arm64 (#42371)
There is currently [a bug in
UV](https://github.com/astral-sh/uv/issues/12906) that results in it
using the x64 flavor of Python when running on Arm64 Windows. This then
causes all Python scripts to believe they are on an x64 device and so
Server installs the wrong dependencies and builds for the wrong
architecture.

Testing: Local on my Arm64 Windows device
Contributes to fixing #40611

Signed-off-by: Daniel Paoliello <daniel@meta-sys.info>
2026-02-06 02:58:37 +00:00
Jonathan Schwender
b5df4bc90a mach: use uv run --frozen (#42169)
This will avoid updating the lockfile during regular operations. Also
ignore the `servo.egg-info` directory, which
the new python requirement installation mechanism via setuptools
creates.
To update the lockfile one can run `uv lock`. This is also done
automatically, when syncing requirements from WPT.

This PR also updates the uv version in CI to a newer one. If you
encounter any issues with the lockfile after this PR, it might be
necessary to update your local instance of uv.

Testing: Build still works. [mach try
full](https://github.com/servo/servo/actions/runs/21624364040)

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-02-03 12:43:04 +00:00
Jonathan Schwender
82df609833 mach: Use uv to manage the virtual environment (#41861)
Instead of attempting to manage the virtual environment ourselves, use
`uv` to manage the installation of dependencies.
Since we still have dependencies coming from upstream wpt, we use
`[tool.setuptool]` in our pyproject.toml to ensure that `uv` dynamically
installs our dependencies according to the requirements.txt files.

Additionally, this PR also reverts `--no-project` usage. `--no-project`
was added as a temporary workaround in
https://github.com/servo/servo/pull/37741.
It's not 100% clear to me what exactly the issue was, but
[apparently](https://github.com/servo/servo/pull/37741#pullrequestreview-2985666234)
the issue caused the build to break.
Removing the arg seems to work fine, except that we get a warning about
a missing `requiress-python` value in `pyproject.toml`.
Apparently it is good practice to specify the requirement as `>=` in th
pyroject, and lock the exact version via `uv pin` (which writes to
`.python_version`, where we already pin 3.11.


Testing: Should be covered by existing tests, which compile code on all
platforms.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2026-01-22 05:51:44 +00:00
Euclid Ye
142eb63c08 mach: New powershell script mach.ps1 mimicking globbing of Unix (#39730)
Unix terminal natively supports globbing, but Windows don't. That's why
command like `.\mach update-wpt D:\selenium_servo\linux\*.log` works
differently on Windows.

This PR creates a new script `mach.ps1`. 

1. If user uses cmd, `./mach` still runs `./mach.bat`.
2. If user uses powershell, `./mach` runs `./mach.ps1`, supporting the
feature mentioned.

Testing: Manually tested. 
Fixes: #39724

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-10-09 08:25:49 +00:00