-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-Zpackage-workspace
is not smart about publish = false
#14356
Comments
I agree this looks like an issue. However, I guess it's a matter of interpretation whether or not |
Because |
Every member except for those that cannot be packaged (hence may have |
No, that doesn't follow with what I said. From what I can tell, |
OK, so packaging should simply not fail on:
|
As far as I can tell from existing precedence in |
...I uhh... certainly would not want "publish the |
It looks like the thing that I would most want to do in the meantime is to cull the workspace down to only the crates I want to publish, but I can't think of a good way, currently, to enable a feature for some of the packages in the workspace so that |
I wonder if that would be a flag of interested for |
I'll try writing a test for this. |
-Zpublish-workspace
is not smart about publish = false
-Zpackage-workspace
is not smart about publish = false
typo whoops. |
Test that pgrx will always build after we publish it. It should never again take an excessive amount of time to release pgrx, because we will always be confident we are ready to release. This does not finish making the release "turnkey", but it does take care of every obstacle to such. Note that there is a technicality: we are "only" testing that our _package_ builds. We are not actually pulling a published-to-cargo release and testing it. We are not running the `cargo publish --dry-run` command, either, because there is no `cargo publish --workspace`. Instead, we are packaging the workspace and rebuilding *that package*. This unfortunately demands that we factor out all the packages in the workspace that are not going to be published. Other details of the refactoring are informed by these oddities: - `package.publish = false` doesn't play well with the extensions to `cargo package --workspace`: rust-lang/cargo#14356 - `workspace.exclude = []` does not properly support globs: rust-lang/cargo#6009 - We *need* to reuse the same `CARGO_TARGET_DIR` for building and testing our many examples or we run out of storage space on the runners.
I carried out the repo refactoring I mentioned. Obviously, what I "really want" is For now, I am quite pleased that |
The reason we have
I assume what you are referring to is |
"a long way off" can still be far enough out that it's worth the time to reengineer my repo to make things work now!
oh good. |
Publish workspace Adds support for simultaneously publishing multiple (possibly inter-dependent) packages in a workspace, gated by the `-Zpackage-workspace` flag. Questions to be worked out through stabilization: - Are we ok stabilizing this and #10948 at the same time? Currently, they are behind the same flag - What is the desired behavior for the publish timeout? This PR uploads the crates in batches (depending on the dependency graph), and we only timeout if nothing in the batch is available within the timeout, deferring the rest to the next wait-for-publish. So for example, if you have packages `a`, `b`, `c` then we'll wait up to 60 seconds and if only `a` and `b` were ready in that time, we'll then wait another 60 seconds for `c`. - What is the desired behavior when some packages in a workspace have `publish = false`? This PR raises an error whenever any of the selected packages has `publish = false`, so it will error on `cargo publish --workspace` in a workspace with an unpublishable package. An alternative interface would implicitly exclude unpublishable packages in this case, but still error out if you explicitly select an unpublishable package with `-p package-name` (see #14356). This PR's behavior is the most conservative one as it can change from an error to implicit excludes later. This is part of #1169
Problem
I was hoping to include
-Zpackage-workspace
as part of a workspace's CI so that it doesn't repeat certain embarrassing mistakes, but it didn't work as expected with respect to certain crates that havepublish = false
on them.Steps
After bumping the versions of all packages I wished to publish a new release for, I used this on the workspace with the following command:
Possible Solution(s)
This seems a curious error, given that this is intentional? I wish to not publish that crate and thus do not wish to package it for publishing?
Cargo has the option of doing the "smart" thing ("What I mean") here and simply ignoring such packages. The other obvious alternative is that it can simply continue to fail-fast, but if so it should probably have a more helpful error message. Note these are "leaf" packages on which nothing depends, so automatically excluding them would work.
Notes
I do have the option of simply removing it from the workspace, but it all gets a bit awkward. To complicate matters further, these packages being in the workspace does affect feature resolution which also affects whether or not basic
cargo check
orcargo test
work (as the library is one of those "you must enable one and only one of these features" sorts).Related:
Version
The text was updated successfully, but these errors were encountered: