feat(publish): publish every workspace package by default#6526
Draft
Hofer-Julian wants to merge 9 commits into
Draft
feat(publish): publish every workspace package by default#6526Hofer-Julian wants to merge 9 commits into
Hofer-Julian wants to merge 9 commits into
Conversation
`pixi publish` now discovers all packages that belong to the workspace and builds and uploads them in dependency order, instead of operating on a single package. Packages are discovered by graph reachability: seeds are the closest `[package]` manifest, the `[workspace.dependencies]` pool, and the dependencies of every environment (in the target-platform view); from there, path-based source dependencies are followed transitively through each package's build, host, run, and extra dependencies via the build backend metadata. Only packages whose sources live inside the workspace root are published; external sources (git/url or paths escaping the workspace) are still built when needed but skipped from upload with a note. All packages are built before anything is uploaded, so a build failure never leaves the target channel with a partially published set. Uploads happen dependencies-first, so the channel never contains a package whose workspace run dependencies are missing. A failed upload can be retried; `--skip-existing` (on by default) resumes where it stopped. `--path <dir>` keeps the previous behavior of building and publishing exactly one package. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PpyoXrYLjQyo7tMEQUhFq9
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PpyoXrYLjQyo7tMEQUhFq9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
pixi publishcould previously only publish a single package — the one closest to the invocation directory. This PR makes it publish every package that belongs to the workspace, built and uploaded in dependency order.--path <dir>keeps the previous single-package behavior.How packages are discovered (new
crates/pixi_cli/src/publish/discovery.rs): graph reachability, seeded from the closest[package]manifest, path specs in[workspace.dependencies], and the dependencies of every environment (in the--target-platformview). From those seeds, path-based source dependencies are followed transitively through each package's build/host/run/extra dependencies via the build backend metadata (which the dispatcher caches, so the build phase doesn't pay for it twice). Only packages whose sources live inside the workspace root are published; external sources (git/url, or paths escaping the workspace root) are still built when required but skipped from upload with an informational note.Failure semantics: all packages are built before anything is uploaded, so a build failure never leaves the channel with a partially published, version-skewed set. Uploads happen dependencies-first, so there is never a moment where a package is on the channel while its workspace run dependencies are missing. If an upload fails partway, re-running resumes via
--skip-existing(on by default).Behavior notes:
pixi publishat a pure[workspace]root (no[package]) used to fail with a backend error; it now publishes the workspace, and reports a helpful error if the workspace has no packages at all.[workspace]and[package]plus path dependencies now publishes those dependencies too. Previously only the root package was uploaded, which produced channels with unsatisfiabledependsentries.pixi buildwrapper forwards--path, so it inherits the same defaults.Example against a workspace where the root manifest only references
pkg_b, andpkg_brun-depends onpkg_avia a path spec:How Has This Been Tested?
source_package_tests.rsusing the in-memory passthrough backend:kit → cpp → core) and uploads all three;--path <member>still publishes exactly one package;pixibinary against realpixi-build-pythonworkspaces: multi-package publish in dependency order, correctdependsmetadata in the built artifacts,--pathsingle-package mode, invocation from inside a member directory, the classic single-package workspace (unreferenced root[package]still found via the closest-package seed), and the empty-workspace error.cargo test -p pixi_cli --lib(91 passed) andcargo test -p pixi --test integration_rust source_package(34 passed).AI Disclosure
Tools: Claude Code
Checklist:
🤖 Generated with Claude Code
https://claude.ai/code/session_01PpyoXrYLjQyo7tMEQUhFq9
Generated by Claude Code