Skip to content

Conversation

konstin
Copy link
Member

@konstin konstin commented Aug 10, 2025

Venvs should not be in source distributions, and on Unix, we now reject them for having a link outside the source directory. This PR adds a hint for that since users were confused (#15096).

In the process, we're differentiating IO errors for format error for uncompression generally.

Fixes #15096

@konstin konstin added the error messages Messaging when something goes wrong label Aug 10, 2025
@konstin konstin force-pushed the konsti/venv-in-source-dist-hint branch from 12b4345 to b6931b0 Compare August 10, 2025 13:43
#[error("Invalid zip file")]
Zip(#[from] zip::result::ZipError),
#[error("Failed to read from zip file")]
#[error("Invalid zip file during async read")]
Copy link
Member Author

Choose a reason for hiding this comment

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

The during async read allows us to tell apart the code path.

Copy link
Member

Choose a reason for hiding this comment

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

To tell it apart from which case? I would rather not leak that it's async to a user.

Copy link
Member Author

@konstin konstin Aug 18, 2025

Choose a reason for hiding this comment

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

Telling apart zip errors vs. async-zip errors from user reports. I've made it more sneaky now by using two slightly different strings that effectively say the same but lead us to the correct location when grepping through the code.

@konstin konstin temporarily deployed to uv-test-registries August 10, 2025 13:50 — with GitHub Actions Inactive
}
Err(err) => {
let help = if let Error::Extract(uv_extract::Error::Tar(err)) = &err {
// TODO(konsti): astral-tokio-tar should use a proper error instead of
Copy link
Member Author

Choose a reason for hiding this comment

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

The tokio-tar crate has an effectively stringly-types, very nested, everything-is-an-io::Error interface.

Venvs should not be in source distributions, and on Unix, we now reject them for having a link outside the source directory.

In the process, we're differentiating IO errors for format error for uncompression generally.

Fixes #15096
@konstin konstin force-pushed the konsti/venv-in-source-dist-hint branch from b6931b0 to 3531077 Compare August 18, 2025 16:47
@konstin konstin changed the title Hint about error from venv in source distribution Add hint for venv in source distribution error Aug 18, 2025
@konstin konstin requested a review from zanieb August 18, 2025 16:48
@konstin konstin temporarily deployed to uv-test-registries August 18, 2025 16:50 — with GitHub Actions Inactive
@konstin konstin temporarily deployed to uv-test-registries August 18, 2025 18:35 — with GitHub Actions Inactive
@konstin konstin enabled auto-merge (squash) August 18, 2025 18:36
@konstin konstin merged commit 4f4492d into main Aug 18, 2025
238 of 239 checks passed
@konstin konstin deleted the konsti/venv-in-source-dist-hint branch August 18, 2025 22:07
@musicinmybrain
Copy link
Contributor

Looking at astral-sh/tokio-tar@f148818, are you planning to release astral-tokio-tar 0.5.3 and change astral-tokio-tar = { git = "https://github.com/astral-sh/tokio-tar", rev = "f1488188f1d1b54a73eb0c42a8b8f4b9ee87d688" } back to astral-tokio-tar = { version = "0.5.3" }?

@konstin
Copy link
Member Author

konstin commented Aug 19, 2025

Yes, we plan doing a new release in https://github.com/astral-sh/tokio-tar soon.

konstin added a commit to astral-sh/tokio-tar that referenced this pull request Aug 19, 2025
konstin added a commit to astral-sh/tokio-tar that referenced this pull request Aug 19, 2025
Release v0.5.3 for
astral-sh/uv#15202 (comment). The
`Cargo.toml` is already bumped, so we only need update the Changelog.
konstin added a commit that referenced this pull request Aug 19, 2025
This is not actually an update, we're just updating the commit tag for #15202 (comment)
konstin added a commit that referenced this pull request Aug 19, 2025
This is not actually an update, we're just updating the commit tag to a
crates.io release for
#15202 (comment)
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 21, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.11` -> `0.8.12` |

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 (astral-sh/uv)</summary>

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

[Compare Source](astral-sh/uv@0.8.11...0.8.12)

##### Python

- Add 3.13.7
- Improve performance of zstd in Python 3.14

See the [python-build-standalone release notes](https://github.com/astral-sh/python-build-standalone/releases/tag/20250818) for details.

##### Enhancements

- Add an `aarch64-pc-windows-msvc` target for `python-platform` ([#&#8203;15347](astral-sh/uv#15347))
- Add fallback parent process detection to `uv tool update-shell` ([#&#8203;15356](astral-sh/uv#15356))
- Install non-build-isolation packages in a second phase ([#&#8203;15306](astral-sh/uv#15306))
- Add hint when virtual environments are included in source distributions ([#&#8203;15202](astral-sh/uv#15202))
- Add Docker images derived from `buildpack-deps:trixie`, `debian:trixie-slim`, `alpine:3.22` ([#&#8203;15351](astral-sh/uv#15351))

##### Bug fixes

- Reject already-installed wheels built with outdated settings ([#&#8203;15289](astral-sh/uv#15289))
- Skip interpreters that are not found on query ([#&#8203;15315](astral-sh/uv#15315))
- Handle dotted package names in script path resolution ([#&#8203;15300](astral-sh/uv#15300))
- Reject `match-runtime = true` for dynamic packages ([#&#8203;15292](astral-sh/uv#15292))

##### Documentation

- Document improvements to build-isolation setups ([#&#8203;15326](astral-sh/uv#15326))
- Fix reference documentation recommendation to use `uv cache clean` instead of `clear` ([#&#8203;15313](astral-sh/uv#15313))

</details>

---

### Configuration

📅 **Schedule**: 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:eyJjcmVhdGVkSW5WZXIiOiI0MS43Ni4wIiwidXBkYXRlZEluVmVyIjoiNDEuNzYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error messages Messaging when something goes wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a hint for virtual environments included in wheels

3 participants