You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
all_packages=True skips Dagger codegen for workspace members #100
At b0e9d0ca81328d3c91a08ab8c7a0e8963c2fa7ae, UvSyncPlan.create(all_packages=True, dagger_codegen=True) runs codegen only at . instead of for each local workspace member.
Expected behavior
all_packages is documented to install every workspace member. Dagger codegen is documented to run for the package being built before uv sync, so every selected local Dagger member needs its generated SDK materialized.
Actual behavior
Codegen paths are derived only from the explicit package list. The normal empty list used with all_packages=True falls back to ['.'] before local members are discovered.
Observed: expected ['packages/app-one', 'packages/app-two']; actual codegen visits ['.'].
The explicit package=['app-one', 'app-two'] control visits both member paths and passes.
Impact
A pure workspace root can omit gitignored generated SDK sources before frozen sync, so an all-packages build can fail even though explicit selection of the same members works. A full Dagger container build was not run in this audit.
Root cause
uv/src/uv/workspace/plan.py:204-210 computes codegen paths from explicit packages only, before _discover_local_packages handles all_packages.
Suggested fix and regression test
When all_packages is true, derive and deduplicate codegen paths for all reachable local members. Preserve current explicit-package and bare-root behavior. Add a two-member pure-workspace regression plus explicit/default controls.
Duplicate check
The full all-state tracker and actual open patches were inspected. Fresh searches covered all_packages, dagger_codegen, UvSyncPlan.create, workspace member paths, generated SDKs, and skip/selection synonyms. PRs #2/#3 establish codegen necessity and PR #81 changes eligibility, but none addresses all-packages selection.
In uv/src/uv/workspace/plan.py, line 208 derived codegen paths strictly from explicit package selections:
codegen_paths=list(dict.fromkeys(raw_local[p] forpinpackagesifpinraw_local)) or ["."]
When all_packages=True is set, callers supply an empty packages list ([]). Consequently, [raw_local[p] for p in packages if p in raw_local] evaluates to [], triggering the fallback to ["."].
In a pure workspace root with members (e.g. packages/app-one, packages/app-two), Dagger codegen runs solely at . and never executes inside the actual member directories.
2. Implementation in uv/src/uv/workspace/plan.py
When all_packages is True, gather and deduplicate the member directory paths from raw_local.values():
ifdagger_codegen:
raw_local=parse_local_packages(lock_data)
# Overlay each target package's SDK (deduped); fall back to the# workspace root when no target is a local package.ifall_packages:
codegen_paths=list(dict.fromkeys(raw_local.values())) or ["."]
else:
codegen_paths=list(dict.fromkeys(raw_local[p] forpinpackagesifpinraw_local)) or ["."]
forcodegen_pathincodegen_paths:
ws_dir=await_run_codegen(ws_dir, codegen_path)
ifworkspace_path==".":
source_dir=ws_direlse:
source_dir=source_dir.with_directory(workspace_path, ws_dir)
3. Verification & Regressions
Added unit test test_codegen_paths_all_packages_visits_all_members in uv/tests/test_workspace_resolution.py:
Confirms all_packages=True yields all member paths (['packages/app-one', 'packages/app-two']).
Confirms explicit package lists (['app-one']) visit only the targeted member.
Confirms empty/unmatched packages fall back to root (['.']).
All 130 tests in uv/tests pass. Zero ruff lint/format findings.
Activity
aoright commentedon Sep 24, 2026
I implemented and verified a fix for this workspace member codegen issue on fork branch
fix/all-packages-codegen(commite75403b).Compare: main...aoright:daggerverse:fix/all-packages-codegen
1. Root Cause Breakdown
uv/src/uv/workspace/plan.py, line 208 derived codegen paths strictly from explicit package selections:all_packages=Trueis set, callers supply an emptypackageslist ([]). Consequently,[raw_local[p] for p in packages if p in raw_local]evaluates to[], triggering the fallback to["."].packages/app-one,packages/app-two), Dagger codegen runs solely at.and never executes inside the actual member directories.2. Implementation in
uv/src/uv/workspace/plan.pyWhen
all_packagesis True, gather and deduplicate the member directory paths fromraw_local.values():3. Verification & Regressions
Added unit test
test_codegen_paths_all_packages_visits_all_membersinuv/tests/test_workspace_resolution.py:all_packages=Trueyields all member paths (['packages/app-one', 'packages/app-two']).['app-one']) visit only the targeted member.['.']).All 130 tests in
uv/testspass. Zero ruff lint/format findings.aoright commentedon Sep 24, 2026
Opened PR #105 with the zero-regression fix and test coverage.