[uv] Rebase upstream - #2
Closed
naveenOnarayanan wants to merge 7 commits into
Closed
Conversation
When exclude-newer is computed from a relative span (e.g., "P7D"), the resulting timestamp now gets truncated to the start of the day (midnight UTC) instead of preserving second/millisecond precision. This eliminates lockfile churn caused by different developers running `uv lock` at slightly different times on the same day — they will all get the same `T00:00:00Z` timestamp. The timestamp only changes when the calendar day boundary crosses. Applied to both code paths: - `ExcludeNewerValue::recompute()` — called when tools re-evaluate spans - `ExcludeNewerValue::from_str()` — called when initially parsing spans Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> <!-- Thank you for contributing to uv! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan <!-- How was it tested? --> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Check that only files inside the installation scheme can be removed when uv uninstalls a package. This fixes a bug where uv would try to remove arbitrary files due to a malformed or malicious RECORD file in a wheel. For venvs, the installation prefix is the entire venv, as `.data/data` allows wheels to write to the entire venv, so all files in the venv can also be removed. This is both a correctness fix (uv should never remove files outside its domain) and a low severity security fix, where a malicious wheel could remove a user's files during uninstallation, such as a `uv sync` that upgrades the package version. Note that this requires an attacker having control over the wheel, which also allows them to modify arbitrary Python code. There are no known cases of wheels actually referencing files outside the installation scheme in their RECORD.
…-sh#18856) ## Summary Closes astral-sh#16586 Adds a public function to `uv-fs` crate called `verbatim_path` which is now leveraged by `rm_rf` in `uv-cache` crate for cleaning paths that require verbatim composition to avoid failures seen in astral-sh#16586. ## Test Plan Tested locally on Windows 10 and 11 by setting `UV_CACHE_DIR` to a local directory and then running `uv init`, `uv add uwsgi`, and `uv cache clean` to ensure there is no failures. Additionally unit and integration tests were added to avoid future regressions.
Check the RECORD of a wheel file and heal it if necessary, to ensure the RECORD and the wheel contents always match, and uninstallation can't remove files that don't belong to the wheel. This check and repair happen between unpacking a wheel and persisting it in the cache, ensuring that every wheel that ends up in the cache has a valid RECORD. We collect the paths from the archive in the unpacking step, I added it in all unpacking steps for consistency. I also improved the consistency around RECORD handling code. --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
## Summary This is towards astral-sh#18781 -- we now have a small `Filter` type, and we can filter an OSV query to limit it to just malware results by passing `Filter::Malware`. This has no performance cost versus normal queries since with OSV's "batch query" API we can cheaply pre-filter IDs before actually fetching the full OSV payloads. ## Test Plan Added a unit test that exhibits the filtering. --------- Signed-off-by: William Woodruff <william@astral.sh>
naveenOnarayanan
force-pushed
the
nn/rebase-main
branch
from
April 9, 2026 19:00
82ef577 to
b6d35a9
Compare
naveenOnarayanan
marked this pull request as ready for review
April 9, 2026 19:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
uv cache cleanerrors due to Win32 path normalization (Avoiduv cache cleanerrors due to Win32 path normalization astral-sh/uv#18856)GHSA-pjjw-68hj-v9mwto the changelog (AddGHSA-pjjw-68hj-v9mwto the changelog astral-sh/uv#18950)Summary
Test Plan