Skip to content

Comments

Clear ephemeral overlays when running tools#11141

Merged
charliermarsh merged 1 commit intomainfrom
charlie/overlay
Feb 4, 2025
Merged

Clear ephemeral overlays when running tools#11141
charliermarsh merged 1 commit intomainfrom
charlie/overlay

Conversation

@charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Jan 31, 2025

Summary

This PR removes the ephemeral .pth overlay when using a cached environment. This solution isn't completely safe, since we could remove the .pth file just as another process is starting the environment... But that risk already exists today, since we could overwrite the .pth file just as another process is starting the environment, so I think what I've added here is a strict improvement.

Ideally, we wouldn't write this file at all, and we'd instead somehow (e.g.) pass a file to the interpreter to run at startup? Or find some other solution that doesn't require poisoning the cache like this.

Closes #11117.

Test Plan

Ran through the great reproduction steps from the linked issue.

Before:

Screenshot 2025-01-31 at 2 11 31 PM

After:

Screenshot 2025-01-31 at 2 11 39 PM

@charliermarsh charliermarsh force-pushed the charlie/overlay branch 3 times, most recently from dc8405a to 7f8309b Compare January 31, 2025 19:20
@charliermarsh charliermarsh added the bug Something isn't working label Jan 31, 2025
@charliermarsh charliermarsh changed the base branch from main to charlie/base February 4, 2025 01:31
Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

lgtm

Base automatically changed from charlie/base to main February 4, 2025 22:23
@charliermarsh charliermarsh enabled auto-merge (squash) February 4, 2025 22:38
@charliermarsh charliermarsh merged commit f615e81 into main Feb 4, 2025
73 checks passed
@charliermarsh charliermarsh deleted the charlie/overlay branch February 4, 2025 22:45
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 6, 2025
This MR contains the following updates:

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

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.5.29`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0529)

[Compare Source](astral-sh/uv@0.5.28...0.5.29)

##### Enhancements

-   Add `--bare` option to `uv init` ([#&#8203;11192](astral-sh/uv#11192))
-   Add support for respecting `VIRTUAL_ENV` in project commands via `--active` ([#&#8203;11189](astral-sh/uv#11189))
-   Allow the project `VIRTUAL_ENV` warning to be silenced with `--no-active` ([#&#8203;11251](astral-sh/uv#11251))

##### Python

The managed Python distributions have been updated, including:

-   CPython 3.12.9
-   CPython 3.13.2
-   pkg-config files are now relocatable

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

##### Bug fixes

-   Always use base Python discovery logic for cached environments ([#&#8203;11254](astral-sh/uv#11254))
-   Use a flock to avoid concurrent initialization of project environments ([#&#8203;11259](astral-sh/uv#11259))
-   Fix handling of `--all-groups` and `--no-default-groups` flags ([#&#8203;11224](astral-sh/uv#11224))

##### Documentation

-   Minor touchups to the Docker provenance docs ([#&#8203;11252](astral-sh/uv#11252))
-   Move content from the `mkdocs.public.yml` into the template ([#&#8203;11246](astral-sh/uv#11246))

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

[Compare Source](astral-sh/uv@0.5.27...0.5.28)

##### Bug fixes

-   Allow discovering virtual environments from the first interpreter found on the `PATH` ([#&#8203;11218](astral-sh/uv#11218))
-   Clear ephemeral overlays when running tools ([#&#8203;11141](astral-sh/uv#11141))
-   Disable SSL in Git commands for `--allow-insecure-host` ([#&#8203;11210](astral-sh/uv#11210))
-   Fix hardlinks in tar unpacking ([#&#8203;11221](astral-sh/uv#11221))
-   Set base executable when returning virtual environment ([#&#8203;11209](astral-sh/uv#11209))
-   Use base Python for cached environments ([#&#8203;11208](astral-sh/uv#11208))

##### Documentation

-   Add documentation on verifying Docker image attestations ([#&#8203;11140](astral-sh/uv#11140))
-   Add `last updated` to documentation ([#&#8203;11164](astral-sh/uv#11164))

</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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNTguMSIsInVwZGF0ZWRJblZlciI6IjM5LjE1OC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv run --with ... leaves _uv_ephemeral_overlay.pth in ephemeral environment

3 participants