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

refactor: move cached crates.io SourceID to config module #12711

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

weihanglo
Copy link
Member

What does this PR try to resolve?

SourceId should know nothing about config caching.

This factors out Config from some core types like SourceId step-by-step.

How should we test and review this PR?

Shouldn't have any behavior change.

`SourceId` should know nothing about `config` caching.
@rustbot
Copy link
Collaborator

rustbot commented Sep 20, 2023

r? @ehuss

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-configuration Area: cargo config files and env vars S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 20, 2023
@epage
Copy link
Contributor

epage commented Sep 20, 2023

This factors out Config from some core types like SourceId step-by-step.

is this the right direction for us to be going?

I'm trying to picture how we'd take advantage of this refactor. The main reason is splitting things up but we'll at least need some level of Config support for at least nightly features, if not diagnostics and other features.

@weihanglo
Copy link
Member Author

we'll at least need some level of Config support for at least nightly features, if not diagnostics and other features.

Agree, though this kind of "extension" seems better to be provided on demand behind some feature gates or trait imports. By making types being a bit purer, it's easier to do larger scales of refactor, and beneficial for lib users to use only a subset of the cargo lib. For example, a lib using the SourceId and PackageId as opaque unique IDs, without them being pure they need to pull the entire Config which doesn't make sense.

The roadmap in my mind is first doing some less controversial refactors, and then propose a greater one seeking consensus. That said, if this PR appears to be wayy too much, we can just drop the change.

@epage
Copy link
Contributor

epage commented Sep 20, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 20, 2023

📌 Commit 1fa386e 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 Sep 20, 2023
@bors
Copy link
Collaborator

bors commented Sep 20, 2023

⌛ Testing commit 1fa386e with merge 376b9a7...

@bors
Copy link
Collaborator

bors commented Sep 20, 2023

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

@bors bors merged commit 376b9a7 into rust-lang:master Sep 20, 2023
20 checks passed
@weihanglo weihanglo deleted the cached branch September 20, 2023 15:48
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 23, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Sep 23, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
@ehuss ehuss added this to the 1.74.0 milestone Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-configuration Area: cargo config files and env vars 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