Skip to content

Patch Cargo.lock in uv-build source distributions#18831

Merged
zanieb merged 1 commit intoastral-sh:mainfrom
zaniebot:claude/reproduce-uv-18824-NMelP
Apr 7, 2026
Merged

Patch Cargo.lock in uv-build source distributions#18831
zanieb merged 1 commit intoastral-sh:mainfrom
zaniebot:claude/reproduce-uv-18824-NMelP

Conversation

@zanieb
Copy link
Copy Markdown
Member

@zanieb zanieb commented Apr 2, 2026

Closes #18824

This is a little janky but not ridiculous while we work on upstreaming a proper fix. It seems like they can't just invoke cargo so I think it's quite involved.

See also PyO3/maturin#2609

Maturin copies the full workspace Cargo.lock into the sdist, but the sdist
only contains a subset of workspace crates. This makes `cargo build --locked`
fail because the lock file references packages not present in the sdist.

Add a post-processing script that extracts the sdist, runs
`cargo update --workspace` to prune the lockfile to only the packages
needed by the included crates (preserving pinned versions), and repacks
the tarball. The CI workflow now runs this after building the uv-build sdist.

Fixes astral-sh#18824

https://claude.ai/code/session_01Mr44wUMQGhVVHor22QZQ8j
@zaniebot zaniebot force-pushed the claude/reproduce-uv-18824-NMelP branch from 510f3d0 to a9934b9 Compare April 2, 2026 22:24
@zanieb zanieb marked this pull request as ready for review April 3, 2026 12:47
@zanieb zanieb requested a review from konstin April 7, 2026 12:40
@zanieb zanieb merged commit f40124f into astral-sh:main Apr 7, 2026
71 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Apr 9, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [uv](https://github.com/astral-sh/uv) | patch | `0.11.3` → `0.11.5` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (uv)</summary>

### [`v0.11.5`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0115)

[Compare Source](astral-sh/uv@0.11.4...0.11.5)

Released on 2026-04-08.

##### Python

- Add CPython 3.13.13, 3.14.4, and 3.15.0a8 ([#&#8203;18908](astral-sh/uv#18908))

##### Enhancements

- Fix `build_system.requires` error message ([#&#8203;18911](astral-sh/uv#18911))
- Remove trailing path separators in path normalization ([#&#8203;18915](astral-sh/uv#18915))
- Improve error messages for unsupported or invalid TLS certificates ([#&#8203;18924](astral-sh/uv#18924))

##### Preview features

- Add `exclude-newer` to `[[tool.uv.index]]` ([#&#8203;18839](astral-sh/uv#18839))
- `uv audit`: add context/warnings for ignored vulnerabilities ([#&#8203;18905](astral-sh/uv#18905))

##### Bug fixes

- Normalize persisted fork markers before lock equality checks ([#&#8203;18612](astral-sh/uv#18612))
- Clear junction properly when uninstalling Python versions on Windows ([#&#8203;18815](astral-sh/uv#18815))
- Report error cleanly instead of panicking on TLS certificate error ([#&#8203;18904](astral-sh/uv#18904))

##### Documentation

- Remove the legacy `PIP_COMPATIBILITY.md` redirect file ([#&#8203;18928](astral-sh/uv#18928))
- Fix `uv init example-bare --bare` examples ([#&#8203;18822](astral-sh/uv#18822), [#&#8203;18925](astral-sh/uv#18925))

### [`v0.11.4`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0114)

[Compare Source](astral-sh/uv@0.11.3...0.11.4)

Released on 2026-04-07.

##### Enhancements

- Add support for `--upgrade-group` ([#&#8203;18266](astral-sh/uv#18266))
- Merge repeated archive URL hashes by version ID ([#&#8203;18841](astral-sh/uv#18841))
- Require all direct URL hash algorithms to match ([#&#8203;18842](astral-sh/uv#18842))

##### Bug fixes

- Avoid panics in environment finding via cycle detection ([#&#8203;18828](astral-sh/uv#18828))
- Enforce direct URL hashes for `pyproject.toml` dependencies ([#&#8203;18786](astral-sh/uv#18786))
- Error on `--locked` and `--frozen` when script lockfile is missing ([#&#8203;18832](astral-sh/uv#18832))
- Fix `uv export` extra resolution for workspace member and conflicting extras ([#&#8203;18888](astral-sh/uv#18888))
- Include conflicts defined in virtual workspace root ([#&#8203;18886](astral-sh/uv#18886))
- Recompute relative `exclude-newer` values during `uv tree --outdated` ([#&#8203;18899](astral-sh/uv#18899))
- Respect `--exclude-newer` in `uv tool list --outdated` ([#&#8203;18861](astral-sh/uv#18861))
- Sort by comparator to break specifier ties ([#&#8203;18850](astral-sh/uv#18850))
- Store relative timestamps in tool receipts ([#&#8203;18901](astral-sh/uv#18901))
- Track newly-activated extras when determining conflicts ([#&#8203;18852](astral-sh/uv#18852))
- Patch `Cargo.lock` in `uv-build` source distributions ([#&#8203;18831](astral-sh/uv#18831))

##### Documentation

- Clarify that `--exclude-newer` compares artifact upload times ([#&#8203;18830](astral-sh/uv#18830))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDkuMyIsInVwZGF0ZWRJblZlciI6IjQzLjEwOS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
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.

Cargo fails to build uv-build from a source distribution with --locked

3 participants