Skip to content

fix: avoid repo name collision for multi-version packages in uv.lock#795

Open
roundhd wants to merge 1 commit intoaspect-build:mainfrom
roundhd:fix/multi-version-collision
Open

fix: avoid repo name collision for multi-version packages in uv.lock#795
roundhd wants to merge 1 commit intoaspect-build:mainfrom
roundhd:fix/multi-version-collision

Conversation

@roundhd
Copy link

@roundhd roundhd commented Feb 12, 2026

Summary

When uv.lock contains multiple versions of the same package (e.g., python-version-conditional deps like ipython 8.x for py3.9 and 9.x for py3.13), _sbuild_repo_name and _whl_install_repo_name produce identical repo names, causing collisions.

Changes:

  • Include sha1(version)[:8] in _sbuild_repo_name and _whl_install_repo_name for disambiguation
  • Pass full package dict (with version) in _group_repos instead of {"name": package}

Fixes #792
Related: #718

When uv.lock contains multiple versions of the same package (e.g.,
python-version-conditional deps like ipython 8.x vs 9.x),
`_sbuild_repo_name` and `_whl_install_repo_name` produce identical
names causing collisions.

Include `sha1(version)[:8]` in repo names for disambiguation. Also
pass the full package dict in `_group_repos` so version info is
available.

Fixes aspect-build#792
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Shiyuan Zheng seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@aspect-workflows
Copy link

aspect-workflows bot commented Feb 12, 2026

Bazel 8 (Test)

16 test targets passed

Targets
//examples/multi_version:py_version_default_test [k8-fastbuild]                   1s
//examples/multi_version:py_version_test [k8-fastbuild]                           1s
//examples/pytest:pytest_test [k8-fastbuild]                                      2s
//examples/pytest:sharded/test [k8-fastbuild]                                     3s
//examples/virtual_deps:pytest_test [k8-fastbuild]                                1s
//py/tests/external-deps/sibling-package:test_test [k8-fastbuild]                 68ms
//py/tests/external-deps:test_0_test [k8-fastbuild]                               49ms
//py/tests/external-deps:test_1_test [k8-fastbuild]                               31ms
//py/tests/py-binary:runfiles_from_pip_test [k8-fastbuild]                        756ms
//py/tests/py-binary:test__run_py_test_help [k8-fastbuild]                        93ms
//py/tests/py-internal-venv:test [k8-fastbuild]                                   172ms
//py/tests/py-pex-binary:test__print_modules_pex [k8-fastbuild]                   92ms
//py/tests/py-venv-disable-systemsite:test [k8-fastbuild]                         173ms
//py/tests/py-venv-disable-usersite:test [k8-fastbuild]                           165ms
//py/tests/py-venv-enable-site:test [k8-fastbuild]                                238ms
//py/tests/py-venv-standalone-interpreter:test [k8-fastbuild]                     144ms

Total test execution time was 11s. 15 tests (48.4%) were fully cached saving 36s.


Bazel 9 (Test)

11 test targets passed

Targets
//examples/multi_version:py_version_default_test [k8-fastbuild]                 999ms
//examples/multi_version:py_version_test [k8-fastbuild]                         2s
//examples/pytest:pytest_test [k8-fastbuild]                                    1s
//examples/pytest:sharded/test [k8-fastbuild]                                   3s
//examples/virtual_deps:pytest_test [k8-fastbuild]                              1s
//py/tests/py-binary:runfiles_from_pip_test [k8-fastbuild]                      718ms
//py/tests/py-internal-venv:test [k8-fastbuild]                                 221ms
//py/tests/py-venv-disable-systemsite:test [k8-fastbuild]                       238ms
//py/tests/py-venv-disable-usersite:test [k8-fastbuild]                         154ms
//py/tests/py-venv-enable-site:test [k8-fastbuild]                              242ms
//py/tests/py-venv-standalone-interpreter:test [k8-fastbuild]                   90ms

Total test execution time was 9s. 20 tests (64.5%) were fully cached saving 59s.


Bazel 8 (Test)

e2e

⚠️ Buildkite build #2594 failed.

Failed tests (2)
//cases/uv-deps-650/crossbuild:app_amd64_layers_test [k8-fastbuild]🔗
//cases/uv-deps-650/crossbuild:app_arm64_layers_test [k8-fastbuild]🔗

💡 To reproduce the test failures, run

bazel test //cases/uv-deps-650/crossbuild:app_amd64_layers_test //cases/uv-deps-650/crossbuild:app_arm64_layers_test

Bazel 9 (Test)

e2e

1 test target passed

Targets
//cases/uv-deps-650/airflow:airflow [k8-fastbuild-ST-ba1312b31f78]              310ms

Total test execution time was 310ms. 11 tests (91.7%) were fully cached saving 6s.


Bazel 8 (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 335ms.

@arrdem
Copy link
Collaborator

arrdem commented Feb 13, 2026

Hey @roundhd, thanks for the contribution!

I don't believe this is a complete solution to the problem, since this original implementation of the module extension lacks the decision machinery to correctly handle multiple versions of a locked package. This and the need to correct extras handling is the driver behind #778, which has at this point turned into a near rewrite of the extension to handle all the relevant graph details. That should be coming shortly.

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.

[Bug]: uv extension repo name collision when uv.lock contains multiple versions of same package

3 participants

Comments