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
feat: skip publish=false pkg when publishing entire workspace (#15525)
### What does this PR try to resolve?
Fixes#15006
This changes how cargo-publish works with the unstable
`-Zpackage-workspace` feature.
Before this, when publishing the entire workspace,
like `cargo publish --workspace`,
if there is a package with `package.pulibsh=false,
it'll fail the entire publish process.
After this, when `--workspace` is passed,
or when publishing the virtual workspace,
the intent is more like “publish all publishable in this workspace”,
so skip `publish=false` packages and proceed to publish others.
The new overall behavior looks like this:
* `cargo publish` (inside a `package.publish = false` package): error
* `cargo publish -p publishable -p unpublishable`: error
* `cargo publish --workspace`: skips `package.publish = false
See
#15006 (comment)
### How should we test and review this PR?
* `workspace_flag_with_unpublishable_packages` was added to ensure
`--workspace` work with non-virtual workspace.
* `unpublishable_package_as_versioned_dev_dep` was added to ensure
versioned dev-dependencies won't be skipped and still fail
cargo-publish, as they are required to be published.
There is a new scenario that nothing is going to publish.
I went with a warning instead of hard error because missing publish for
the entire worspace should be a fairly visible. However, this is open
for future to configure via Cargo lint system.
0 commit comments