Skip to content

Conversation

jneem
Copy link
Contributor

@jneem jneem commented Aug 15, 2024

This PR allows for packaging workspaces that include publish = false crates, in some circumstances:

  • unpublishable crates are ignored when inferring the publish registry
  • when checking whether the publish registry is valid, we ignore unpublishable crates
  • we don't put unpublishable crates in the local registry overlay, so if any workspace crates depend on an unpublishable crate then they will fail to verify.

This PR also contains a refactor, moving the registry inference logic to registry/mod.rs, where it will be reused by the upcoming publish-workspace feature. I put the refactor and the logic changes in different commits.

Fixes #14356

@rustbot
Copy link
Collaborator

rustbot commented Aug 15, 2024

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-interacts-with-crates.io Area: interaction with registries Command-package S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2024
@bors
Copy link
Contributor

bors commented Aug 16, 2024

☔ The latest upstream changes (presumably #14326) made this pull request unmergeable. Please resolve the merge conflicts.

@jneem jneem force-pushed the infer-registry-ignore-unpublishable branch from 3afd758 to 591993f Compare August 19, 2024 05:08
@jneem jneem force-pushed the infer-registry-ignore-unpublishable branch from 591993f to 9e553b0 Compare August 19, 2024 06:19
@jneem jneem force-pushed the infer-registry-ignore-unpublishable branch from 9e553b0 to 4ee3aef Compare August 19, 2024 06:51
@jneem
Copy link
Contributor Author

jneem commented Aug 19, 2024

Ok, I've split that commit further. We can drop the "Use the shared source building..." commit if you want; it changes some behavior mostly just to get some more code re-use.

@jneem jneem force-pushed the infer-registry-ignore-unpublishable branch from 4ee3aef to c3043c5 Compare August 19, 2024 07:28
@epage
Copy link
Contributor

epage commented Aug 19, 2024

Thank you for splitting things out further. That was a big help in following what is happening!

jneem added 2 commits August 20, 2024 10:41
This changes the registry validation slightly, adding in a check
forbidding implicit source replacement. This affects the tests (which
configure a dummy registry for source replacement), so we also weaken
the checks by only erroring for registry issues when there are actually
local dependencies.
@jneem jneem force-pushed the infer-registry-ignore-unpublishable branch from c3043c5 to 96d4d6f Compare August 20, 2024 03:48
@epage
Copy link
Contributor

epage commented Aug 20, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Aug 20, 2024

📌 Commit 96d4d6f has been approved by epage

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 20, 2024
@bors
Copy link
Contributor

bors commented Aug 20, 2024

⌛ Testing commit 96d4d6f with merge b2430df...

@bors
Copy link
Contributor

bors commented Aug 20, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing b2430df to master...

@bors bors merged commit b2430df into rust-lang:master Aug 20, 2024
22 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 22, 2024
Update cargo

12 commits in ba8b39413c74d08494f94a7542fe79aa636e1661..8f40fc59fb0c8df91c97405785197f3c630304ea
2024-08-16 22:48:57 +0000 to 2024-08-21 22:37:06 +0000
- Tests rely on absence of RUST_BACKTRACE (rust-lang/cargo#14441)
- fix: -Cmetadata includes whether extra rustflags is same as host (rust-lang/cargo#14432)
- [mdman] Normalize newlines when rendering options (rust-lang/cargo#14428)
- fix: doctest respects Cargo's color options (rust-lang/cargo#14425)
- Be more permissive while packaging unpublishable crates. (rust-lang/cargo#14408)
- fix: Limiting pre-release match semantics to use only on `OptVersionReq::Req` (rust-lang/cargo#14412)
- test: add a regression test for Issue 14409 (rust-lang/cargo#14430)
- chore: update label trigger for Command-info (rust-lang/cargo#14422)
- doc: add lockfile-path unstable doc section (rust-lang/cargo#14423)
- doc: update lockfile-path tracking issue (rust-lang/cargo#14424)
- fix: remove list owners feature of info subcommand (rust-lang/cargo#14418)
- Lockfile path tests (follow-up) (rust-lang/cargo#14417)
@rustbot rustbot added this to the 1.82.0 milestone Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interacts-with-crates.io Area: interaction with registries Command-package S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-Zpackage-workspace is not smart about publish = false
4 participants