Skip to content
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

Infer registry #14340

Merged
merged 2 commits into from
Aug 7, 2024
Merged

Infer registry #14340

merged 2 commits into from
Aug 7, 2024

Conversation

jneem
Copy link
Contributor

@jneem jneem commented Aug 1, 2024

While working on cargo publish for workspaces, I noticed a few ways in which the registry inference for cargo package seemed wrong. (This only affects the unstable -Zpackage-workspace feature.) This is all about the interaction between --index/--registry, and the package.publish fields.

  • Previously, if multiple crates were packaged and they had different package.publish settings, we would ignore those setting and fall back to "crates-io". After this PR, we will bail out with an error instead (unless they've specified --registry or --index).
  • Previously, we would validate the inferred registry against the package.publish settings, even if the --index argument would have taken precedence. After this PR, we will skip registry validation in this case.
  • Previously, we were just ignoring the registry value inferred from package.publish: we'd validate that it was ok, but then just not use it.

@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2024

r? @ehuss

rustbot has assigned @ehuss.
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 Command-package S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 1, 2024
tests/testsuite/package.rs Outdated Show resolved Hide resolved
@jneem jneem force-pushed the infer-registry branch 2 times, most recently from 8402311 to 72411aa Compare August 2, 2024 09:33
tests/testsuite/package.rs Outdated Show resolved Hide resolved
tests/testsuite/package.rs Outdated Show resolved Hide resolved
@jneem
Copy link
Contributor Author

jneem commented Aug 5, 2024

I'm mystified by the failure in the build-std tests. When I run it locally I don't get the [UPDATING] line, but it seems to be reliably present in CI. (Also, I don't see why this PR would affect that test)

@jneem
Copy link
Contributor Author

jneem commented Aug 7, 2024

Ok, I rebased and the mysterious build-std error seems to have gone away.

@jneem jneem requested a review from epage August 7, 2024 14:30
jneem added 2 commits August 7, 2024 21:53
Infer the package registry only if all packages have the same publish
field. If there is confusion, bail out instead of defaulting to
crates-io.
@epage
Copy link
Contributor

epage commented Aug 7, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Aug 7, 2024

📌 Commit 275d3b6 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 7, 2024
@bors
Copy link
Contributor

bors commented Aug 7, 2024

⌛ Testing commit 275d3b6 with merge 495d02c...

@bors
Copy link
Contributor

bors commented Aug 7, 2024

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

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

3 commits in 94977cb1fab003d45eb5bb108cb5e2fa0149672a..0d8d22f83b066503f6b2b755925197e959e58b4f
2024-08-06 21:42:10 +0000 to 2024-08-08 12:54:24 +0000
- fix: std Cargo.lock moved to `library` dir (rust-lang/cargo#14370)
- fix(vendor): Strip excluded build targets (rust-lang/cargo#14367)
- Infer registry (rust-lang/cargo#14340)

r? ghost
@rustbot rustbot added this to the 1.82.0 milestone Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants