Skip to content

Conversation

arlosi
Copy link
Contributor

@arlosi arlosi commented Jan 31, 2023

Registries that include auth-required: true in their config.json currently hit the following error on stable:

authenticated registries require `-Z registry-auth`

This situation makes it difficult for a registry to optionally offer the auth-required: true feature, since it forces users on to the nightly toolchain.

This PR changes the behavior to ignore the auth-required: true field of config.json without -Z registry-auth.

The downside to this change is that it makes it harder to discover why a registry isn't working, since the user will get an HTTP 401 error from the server, rather than a message from Cargo suggesting adding -Z registry-auth.

r? @Eh2406

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 31, 2023
@arlosi arlosi changed the title Do not error for auth-required: true without -Z sparse-registry Do not error for auth-required: true without -Z sparse-registry Jan 31, 2023
@Eh2406 Eh2406 added the T-cargo Team: Cargo label Jan 31, 2023
@Eh2406
Copy link
Contributor

Eh2406 commented Jan 31, 2023

This seemed reasonable to me. But it's technically breaking change. So I will check in with the rest of the cargo team.

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Jan 31, 2023

Team member @Eh2406 has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge final-comment-period FCP — a period for last comments before action is taken labels Jan 31, 2023
@rfcbot
Copy link

rfcbot commented Jan 31, 2023

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period An FCP proposal has started, but not yet signed off. label Jan 31, 2023
@Eh2406
Copy link
Contributor

Eh2406 commented Jan 31, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Jan 31, 2023

📌 Commit f1dadb6 has been approved by Eh2406

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 Jan 31, 2023
@bors
Copy link
Contributor

bors commented Jan 31, 2023

⌛ Testing commit f1dadb6 with merge 711e323...

@bors
Copy link
Contributor

bors commented Jan 31, 2023

☀️ Test successful - checks-actions
Approved by: Eh2406
Pushing 711e323 to master...

@bors bors merged commit 711e323 into rust-lang:master Jan 31, 2023
weihanglo added a commit to weihanglo/rust that referenced this pull request Feb 1, 2023
18 commits in 3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c..e84a7928d93a31f284b497c214a2ece69b4d7719
2023-01-24 15:48:15 +0000 to 2023-01-31 22:18:09 +0000

- chore: Add autolabel for `Command-*` labels (rust-lang/cargo#11664)
- Update cross test instructions for aarch64-apple-darwin (rust-lang/cargo#11663)
- Make cargo install report needed features (rust-lang/cargo#11647)
- docs(contrib): Remove out-of-date process step (rust-lang/cargo#11662)
- Do not error for `auth-required: true` without `-Z sparse-registry` (rust-lang/cargo#11661)
- Warn on commits to non-default branches. (rust-lang/cargo#11655)
- Avoid saving the same future_incompat warning multiple times (rust-lang/cargo#11648)
- Mention current default value in `publish.timeout` docs (rust-lang/cargo#11652)
- Make cargo aware of dwp files. (rust-lang/cargo#11572)
- Reduce target info rustc query calls (rust-lang/cargo#11633)
- Bump to 0.70.0; update changelog (rust-lang/cargo#11640)
- Enable sparse protocol in CI (rust-lang/cargo#11632)
- Fix split-debuginfo support detection (rust-lang/cargo#11347)
- refactor(toml): Move `TomlWorkspaceDependency` out of `TomlDependency` (rust-lang/cargo#11565)
- book: describe how the current resolver sometimes duplicates deps (rust-lang/cargo#11604)
- `cargo add` check `[dependencies]` order without considering the dotted item (rust-lang/cargo#11612)
- Link CoC to  www.rust-lang.org/conduct.html (rust-lang/cargo#11622)
- Add more labels to triagebot (rust-lang/cargo#11621)
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 1, 2023
Update cargo

18 commits in 3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c..e84a7928d93a31f284b497c214a2ece69b4d7719 2023-01-24 15:48:15 +0000 to 2023-01-31 22:18:09 +0000

- chore: Add autolabel for `Command-*` labels (rust-lang/cargo#11664)
- Update cross test instructions for aarch64-apple-darwin (rust-lang/cargo#11663)
- Make cargo install report needed features (rust-lang/cargo#11647)
- docs(contrib): Remove out-of-date process step (rust-lang/cargo#11662)
- Do not error for `auth-required: true` without `-Z sparse-registry` (rust-lang/cargo#11661)
- Warn on commits to non-default branches. (rust-lang/cargo#11655)
- Avoid saving the same future_incompat warning multiple times (rust-lang/cargo#11648)
- Mention current default value in `publish.timeout` docs (rust-lang/cargo#11652)
- Make cargo aware of dwp files. (rust-lang/cargo#11572)
- Reduce target info rustc query calls (rust-lang/cargo#11633)
- Bump to 0.70.0; update changelog (rust-lang/cargo#11640)
- Enable sparse protocol in CI (rust-lang/cargo#11632)
- Fix split-debuginfo support detection (rust-lang/cargo#11347)
- refactor(toml): Move `TomlWorkspaceDependency` out of `TomlDependency` (rust-lang/cargo#11565)
- book: describe how the current resolver sometimes duplicates deps (rust-lang/cargo#11604)
- `cargo add` check `[dependencies]` order without considering the dotted item (rust-lang/cargo#11612)
- Link CoC to  www.rust-lang.org/conduct.html (rust-lang/cargo#11622)
- Add more labels to triagebot (rust-lang/cargo#11621)

r? `@ghost`
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Feb 1, 2023
Update cargo

18 commits in 3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c..e84a7928d93a31f284b497c214a2ece69b4d7719 2023-01-24 15:48:15 +0000 to 2023-01-31 22:18:09 +0000

- chore: Add autolabel for `Command-*` labels (rust-lang/cargo#11664)
- Update cross test instructions for aarch64-apple-darwin (rust-lang/cargo#11663)
- Make cargo install report needed features (rust-lang/cargo#11647)
- docs(contrib): Remove out-of-date process step (rust-lang/cargo#11662)
- Do not error for `auth-required: true` without `-Z sparse-registry` (rust-lang/cargo#11661)
- Warn on commits to non-default branches. (rust-lang/cargo#11655)
- Avoid saving the same future_incompat warning multiple times (rust-lang/cargo#11648)
- Mention current default value in `publish.timeout` docs (rust-lang/cargo#11652)
- Make cargo aware of dwp files. (rust-lang/cargo#11572)
- Reduce target info rustc query calls (rust-lang/cargo#11633)
- Bump to 0.70.0; update changelog (rust-lang/cargo#11640)
- Enable sparse protocol in CI (rust-lang/cargo#11632)
- Fix split-debuginfo support detection (rust-lang/cargo#11347)
- refactor(toml): Move `TomlWorkspaceDependency` out of `TomlDependency` (rust-lang/cargo#11565)
- book: describe how the current resolver sometimes duplicates deps (rust-lang/cargo#11604)
- `cargo add` check `[dependencies]` order without considering the dotted item (rust-lang/cargo#11612)
- Link CoC to  www.rust-lang.org/conduct.html (rust-lang/cargo#11622)
- Add more labels to triagebot (rust-lang/cargo#11621)

r? `@ghost`
@ehuss ehuss added this to the 1.69.0 milestone Feb 2, 2023
@Eh2406
Copy link
Contributor

Eh2406 commented Feb 3, 2023

Do we want to back port this to Beta?

@weihanglo weihanglo added the beta-nominated Nominated to backport to the beta branch. label Feb 3, 2023
weihanglo pushed a commit to weihanglo/cargo that referenced this pull request Feb 3, 2023
…Eh2406

Do not error for `auth-required: true` without `-Z sparse-registry`

Registries that include `auth-required: true` in their `config.json` currently hit the following error on stable:
```
authenticated registries require `-Z registry-auth`
```

This situation makes it difficult for a registry to optionally offer the `auth-required: true` feature, since it forces users on to the nightly toolchain.

This PR changes the behavior to ignore the `auth-required: true` field of `config.json` without `-Z registry-auth`.

The downside to this change is that it makes it harder to discover why a registry isn't working, since the user will get an HTTP 401 error from the server, rather than a message from Cargo suggesting adding `-Z registry-auth`.

r? `@Eh2406`
@ehuss
Copy link
Contributor

ehuss commented Feb 3, 2023

Seems fine to me, feel free to post a PR.

bors added a commit that referenced this pull request Feb 8, 2023
 [beta-1.68] Backport fixes

Beta backports:

* #11661 — Do not error for `auth-required: true` without `-Z sparse-registry`
* #11672 — Verify source before recompile
bors added a commit that referenced this pull request Feb 9, 2023
 [beta-1.68] Backport fixes

Beta backports:

* #11661 — Do not error for `auth-required: true` without `-Z sparse-registry`
* #11672 — Verify source before recompile
@rfcbot rfcbot added finished-final-comment-period FCP complete to-announce and removed final-comment-period FCP — a period for last comments before action is taken labels Feb 10, 2023
@arlosi arlosi changed the title Do not error for auth-required: true without -Z sparse-registry Do not error for auth-required: true without -Z registry-auth Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-nominated Nominated to backport to the beta branch. disposition-merge FCP with intent to merge finished-final-comment-period FCP complete S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-cargo Team: Cargo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants