Skip to content

mach: use uv run --frozen#42169

Merged
jschwe merged 5 commits intoservo:mainfrom
jschwe:uv_locked
Feb 3, 2026
Merged

mach: use uv run --frozen#42169
jschwe merged 5 commits intoservo:mainfrom
jschwe:uv_locked

Conversation

@jschwe
Copy link
Copy Markdown
Member

@jschwe jschwe commented Jan 26, 2026

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

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 26, 2026
@jschwe jschwe added T-full Do a full try run and removed S-awaiting-review There is new code that needs to be reviewed. labels Jan 26, 2026
@github-actions github-actions bot removed the T-full Do a full try run label Jan 26, 2026
@github-actions
Copy link
Copy Markdown

🔨 Triggering try run (#21371024852) for Linux (Unit Tests, Build libservo, WPT, Bencher), Windows (Unit Tests, Build libservo), Android, OpenHarmony, Lint

@github-actions
Copy link
Copy Markdown

⚠️ Try run (#21371024852) failed!

Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the lockfile just needs to be updated before landing or maybe more specific version need to be specified in the dependencies.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 27, 2026
@jschwe jschwe requested a review from sagudev as a code owner January 27, 2026 05:09
@jschwe
Copy link
Copy Markdown
Member Author

jschwe commented Jan 27, 2026

It's weird that locally this lockfile works, but in CI it doesn't. I wonder if this is OS specific, or related to uv version differences?

Edit: I did a try run with an updated uv version (same as on my machine), and it still failed - so perhaps there are differences in the lockfile depending on the host? that would be wierd, and imho a bug in uv...

@mrobinson
Copy link
Copy Markdown
Member

If this is a bug in uv which causes the lockfile to always be dirty, we should probably back out the original change until uv is fixed or not check in the lockfile. Always having a dirty lockfile in your working tree makes working on Servo very tedious and I suspect that contributors will often be checking it in by accident.

mrobinson added a commit to mrobinson/servo that referenced this pull request Jan 28, 2026
This is a temporary fix until a more complete solution such
as the one from servo#42169 works consistently.

Signed-off-by: Martin Robinson <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Jan 28, 2026
This is a temporary fix until a more complete solution, such
as the one from #42169, works consistently.

Testing: This should be tested by the CI run.

Signed-off-by: Martin Robinson <[email protected]>
@mukilan
Copy link
Copy Markdown
Member

mukilan commented Feb 2, 2026

It seems ike uv run will regenerate the lock file if the existing one had been generated by a different uv version. astral-sh/uv#10845

@jschwe
Copy link
Copy Markdown
Member Author

jschwe commented Feb 2, 2026

Hmm, I'm pretty sure one of the try runs I did was with the UV version updated to the same one I had locally - and that still failed ...

@sagudev
Copy link
Copy Markdown
Member

sagudev commented Feb 2, 2026

@mukilan
Copy link
Copy Markdown
Member

mukilan commented Feb 3, 2026

Reading uv issue, maybe we need --frozen instead of --locked. Also see https://docs.astral.sh/uv/concepts/projects/sync/#automatic-lock-and-sync.

That sounds like a good solution to me. I was worried we might loose the ability to detect PRs where requirement.txt is changed without updating lock file, but perhaps that can be acheived with a uv lock --checkstep in ./mach test-tidy.

This will avoid updated the lockfile during regular operations.
Also ignore the `servo.egg-info` directory, which
the new python requirement installation mechanism via setuptools
creates.

Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
Signed-off-by: Jonathan Schwender <[email protected]>
@mukilan mukilan changed the title mach: use uv run --locked mach: use uv run --frozen Feb 3, 2026
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Feb 3, 2026
@jschwe jschwe added this pull request to the merge queue Feb 3, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 3, 2026
Merged via the queue into servo:main with commit b5df4bc Feb 3, 2026
31 checks passed
@jschwe jschwe deleted the uv_locked branch February 3, 2026 13:31
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants