{"record":{"id":"925e241a6be2bd73","repo":"astral-sh/uv","slug":"workspace-does-not-contain-any-buildable-packages","errorCode":null,"errorMessage":"Workspace does not contain any buildable packages. For example, to build `{}` with `{}`, add a `{}` to `{}`:\n```toml\n[build-system]\nrequires = [\"uv_build>={min_version},<{max_version}\"]\nbuild-backend = \"uv_build\"\n```","messagePattern":"Workspace does not contain any buildable packages\\. For example, to build `(.+?)` with `(.+?)`, add a `(.+?)` to `(.+?)`:\n```toml\n\\[build-system\\]\nrequires = \\[\"uv_build>=(.+?),<(.+?)\"\\]\nbuild-backend = \"uv_build\"\n```","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/build_frontend.rs","lineNumber":423,"sourceCode":"        if workspace.packages().is_empty() {\n            return Err(anyhow::anyhow!(\"No packages found in workspace\"));\n        }\n\n        let packages: Vec<_> = workspace\n            .packages()\n            .values()\n            .filter(|package| package.pyproject_toml().is_package(true))\n            .map(|package| AnnotatedSource {\n                source: Source::Directory(Cow::Borrowed(package.root())),\n                package: Some(package.project().name.clone()),\n            })\n            .collect();\n\n        if packages.is_empty() {\n            let member = workspace.packages().values().next().unwrap();\n            let name = &member.project().name;\n            let pyproject_toml = member.root().join(\"pyproject.toml\");\n            return Err(anyhow::anyhow!(\n                \"Workspace does not contain any buildable packages. For example, to build `{}` with `{}`, add a `{}` to `{}`:\\n```toml\\n[build-system]\\nrequires = [\\\"uv_build>={min_version},<{max_version}\\\"]\\nbuild-backend = \\\"uv_build\\\"\\n```\",\n                name.cyan(),\n                \"uv_build\".cyan(),\n                \"build-system\".green(),\n                pyproject_toml.user_display().cyan()\n            ));\n        }\n\n        packages\n    } else {\n        vec![AnnotatedSource::from(src)]\n    };\n\n    // Build backends can include arbitrary files from the source directory in the distribution.\n    // Warn if the active cache is within the source since cache contents may be included in the\n    // build.\n    for source in &packages {\n        if let Source::Directory(source_dir) = &source.source","sourceCodeStart":405,"sourceCodeEnd":441,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/build_frontend.rs#L405-L441","documentation":"`uv build --all-packages` found workspace members, but after filtering with pyproject_toml().is_package(true) zero remain — every member lacks a `[build-system]`, so none is buildable. The error prints the first member and a uv_build `[build-system]` snippet pinned to the running uv version range. Note the code uses .next().unwrap() on the non-empty packages map, which is safe here because error 75 already guaranteed non-emptiness.","triggerScenarios":"A workspace of virtual/utility members (only `[project]`, no `[build-system]`) run with `--all-packages`; all real packages excluded from the workspace while virtual ones remain.","commonSituations":"Monorepos where several members are metadata-only; migrating a repo to uv where build-system tables were optional under the old tooling.","solutions":["Add the `[build-system]` table (snippet in the message) to each member you want built.","If only some members should build, build them explicitly with `--package <name>` instead of --all-packages.","Move non-buildable utility members out of the workspace or keep them virtual and stop using --all-packages."],"exampleFix":"# before: packages/a/pyproject.toml (no build-system)\n# after\n[build-system]\nrequires = [\"uv_build>=0.8,<0.9\"]\nbuild-backend = \"uv_build\"\n\n# then: uv build --all-packages","handlingStrategy":"validation","validationCode":"# Rust: pre-filter buildable members and fail with a clear list\nlet buildable: Vec<_> = workspace.packages().values()\n    .filter(|p| p.pyproject_toml().is_package(true))\n    .collect();\nanyhow::ensure!(\n    !buildable.is_empty(),\n    \"no member has [build-system]; add it to at least one of: {:?}\",\n    workspace.packages().keys().collect::<Vec<_>>()\n);","typeGuard":"fn has_build_system(pkg: &WorkspacePackage) -> bool {\n    pkg.pyproject_toml().is_package(true)\n}","tryCatchPattern":null,"preventionTips":["Keep virtual members out of --all-packages flows; build concrete packages with --package instead.","Enforce a repo lint: every member meant to ship must declare a build backend."],"tags":["build","build-system","workspace"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}