-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Lock the source tree when running setuptools, to protect concurrent builds #14174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I don't think locking the output directory is actually sufficient because IIRC setuptools uses a build directory in the source directory? So, like, concurrent builds to different output directories would still fail? |
|
Ah true, I still get failures with something like this: |
e4a8f29 to
0019a4a
Compare
|
I've switched to locking (the hash of) the source dir. The following now succeeds with no errors, and the builds run in series: I'm considering refactoring this a bit to stop putting so many file locks directly in /tmp. Going to put another PR on top of this one, which we can take or not. |
uv build lock its output dir, to prevent concurrent builds from interferinguv build lock its source dir, to prevent concurrent builds from interfering
0019a4a to
04670c9
Compare
uv build lock its source dir, to prevent concurrent builds from interfering|
Just put up a new iteration. I've kept the same locking strategy (a |
| debug!( | ||
| r#"Calling `{}.build_{}("{}", {})`"#, | ||
| pep517_backend.backend, | ||
| self.pep517_backend.backend, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are drive-by cleanup.
konstin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me
|
I'm not a huge fan of special-casing setuptools but I don't feel strongly enough to advocate for a change. |
|
(Actually just ignore my comment, it's alright.) |
Standard lock guards have the same annotation, because creating them without binding them to a local variable is almost always a mistake.
04670c9 to
2a44332
Compare
|
(rebasing to pick up test fixes from main) |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.7.14` -> `0.7.16` | 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.7.16`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0716) [Compare Source](astral-sh/uv@0.7.15...0.7.16) ##### Python - Add Python 3.14.0b3 See the [`python-build-standalone` release notes](https://github.com/astral-sh/python-build-standalone/releases/tag/20250626) for more details. ##### Enhancements - Include path or URL when failing to convert in lockfile ([#​14292](astral-sh/uv#14292)) - Warn when `~=` is used as a Python version specifier without a patch version ([#​14008](astral-sh/uv#14008)) ##### Preview features - Ensure preview default Python installs are upgradeable ([#​14261](astral-sh/uv#14261)) ##### Performance - Share workspace cache between lock and sync operations ([#​14321](astral-sh/uv#14321)) ##### Bug fixes - Allow local indexes to reference remote files ([#​14294](astral-sh/uv#14294)) - Avoid rendering desugared prefix matches in error messages ([#​14195](astral-sh/uv#14195)) - Avoid using path URL for workspace Git dependencies in `requirements.txt` ([#​14288](astral-sh/uv#14288)) - Normalize index URLs to remove trailing slash ([#​14245](astral-sh/uv#14245)) - Respect URL-encoded credentials in redirect location ([#​14315](astral-sh/uv#14315)) - Lock the source tree when running setuptools, to protect concurrent builds ([#​14174](astral-sh/uv#14174)) ##### Documentation - Note that GCP Artifact Registry download URLs must have `/simple` component ([#​14251](astral-sh/uv#14251)) ### [`v0.7.15`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0715) [Compare Source](astral-sh/uv@0.7.14...0.7.15) ##### Enhancements - Consistently use `Ordering::Relaxed` for standalone atomic use cases ([#​14190](astral-sh/uv#14190)) - Warn on ambiguous relative paths for `--index` ([#​14152](astral-sh/uv#14152)) - Skip GitHub fast path when rate-limited ([#​13033](astral-sh/uv#13033)) - Preserve newlines in `schema.json` descriptions ([#​13693](astral-sh/uv#13693)) ##### Bug fixes - Add check for using minor version link when creating a venv on Windows ([#​14252](astral-sh/uv#14252)) - Strip query parameters when parsing source URL ([#​14224](astral-sh/uv#14224)) ##### Documentation - Add a link to PyPI FAQ to clarify what per-project token is ([#​14242](astral-sh/uv#14242)) ##### Preview features - Allow symlinks in the build backend ([#​14212](astral-sh/uv#14212)) </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:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Fixes #13703.
If I repeat the repro steps from my comment on that issue with this PR, the errors are gone:
There's also no performance impact: