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

feat(toml): Add autolib #14591

Merged
merged 5 commits into from
Sep 27, 2024
Merged

feat(toml): Add autolib #14591

merged 5 commits into from
Sep 27, 2024

Conversation

epage
Copy link
Contributor

@epage epage commented Sep 24, 2024

What does this PR try to resolve?

PR #5335 added autobins, etc for #5330. Nowhere in there is
discussion of autolib.

Cargo script disables support for additional build-targets by disabling
discovery.
Except we don't have a way to disable discovery of autolib, leading to #14476.
By adding autolib, we can continue in that direction.

This also allows us to bypass inferring of libs on published packages,
like all other build-targets which were handled in #13849.

Fixes #14476

How should we test and review this PR?

Additional information

As this seems fairly low controversy, this insta-stabilizes the field.
In prior versions of Cargo, users will get an "unused manifest key"
warning.
For packages where this is set by cargo publish, the warning will be suppressed and things will work as normal.
For cargo vendor, the same except there will be some churn in the
vendored source as this field will now be set.
For local development, it should be rare to set autolib so the lack of
error by discovering a file when this is set shouldn't be a problem.

@epage epage added the T-cargo Team: Cargo label Sep 24, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 24, 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 A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 24, 2024
@epage
Copy link
Contributor Author

epage commented Sep 24, 2024

Starting FCP in parallel to the PR review

@rfcbot fcp merge

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 24, 2024

Team member @epage 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 labels Sep 24, 2024
PR rust-lang#5335 added `autobins`, etc for rust-lang#5330.  Nowhere in there is
discussion of `autolib`.

Cargo script disables support for additional build-targets by disabling
discovery.
Except we don't have a way to disable discovery of `autolib`, leading to rust-lang#14476.
By adding `autolib`, we can continue in that direction.

This also allows us to bypass inferring of libs on published packages,
like all other build-targets which were handled in rust-lang#13849.

As this seems fairly low controversy, this insta-stabilizes the field.
In prior versions of Cargo, users will get an "unused manifest key"
warning.
For packags where this is set by `cargo publish`, the warning will be suppressed and things will work as normal.
For `cargo vendor`, the same except there will be some churn in the
vendored source as this field will now be set.
For local development, it should be rare to set `autolib` so the lack of
error by discovering a file when this is set shouldn't be a problem.

Fixes rust-lang#14476
@rfcbot rfcbot added final-comment-period FCP — a period for last comments before action is taken and removed proposed-final-comment-period An FCP proposal has started, but not yet signed off. labels Sep 25, 2024
@rfcbot
Copy link
Collaborator

rfcbot commented Sep 25, 2024

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

src/cargo/util/toml/targets.rs Outdated Show resolved Hide resolved
@@ -173,6 +173,7 @@ pub struct TomlPackage {
pub publish: Option<InheritableVecStringOrBool>,
pub workspace: Option<String>,
pub im_a_teapot: Option<bool>,
pub autolib: Option<bool>,
Copy link
Member

@weihanglo weihanglo Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, except this could potentially break other third-party build tools like cargo-manifest in the future. I'd like to give them a heads-up in https://rust-lang.zulipchat.com/#narrow/stream/334885-t-cargo.2Fbuild-integration and merge on Friday. Any other opinion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of that!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @kornelski and @LukeMathWalker since you're maintainers of relevant crates.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Turbo87 who is covering for me while I'm on pat leave

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep yep, already aware of it :)

@epage epage force-pushed the autolib branch 2 times, most recently from 25310c7 to 5e35e27 Compare September 26, 2024 14:46
@weihanglo
Copy link
Member

It's Friday! Let us not wait for the entire FCP. Feel free to comment below if you have any further concerns.

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 27, 2024

📌 Commit 5e35e27 has been approved by weihanglo

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 27, 2024
@bors
Copy link
Collaborator

bors commented Sep 27, 2024

⌛ Testing commit 5e35e27 with merge b396f2c...

@bors
Copy link
Collaborator

bors commented Sep 27, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing b396f2c to master...

@bors bors merged commit b396f2c into rust-lang:master Sep 27, 2024
24 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2024
Update cargo

19 commits in eaee77dc1584be45949b75e4c4c9a841605e3a4b..80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a
2024-09-19 21:10:23 +0000 to 2024-09-27 17:56:01 +0000
- Update cc to 1.1.22 (rust-lang/cargo#14607)
- feat: lockfile path implies --locked on cargo install (rust-lang/cargo#14556)
- feat(toml): Add `autolib` (rust-lang/cargo#14591)
- fix: correct error count for `cargo check --message-format json` (rust-lang/cargo#14598)
- test: relax panic output assertion (rust-lang/cargo#14602)
- feat(timings): support dark color scheme in HTML output (rust-lang/cargo#14588)
- feat: add CARGO_MANIFEST_PATH env variable (rust-lang/cargo#14404)
- fix(config): Don't double-warn about `$CARGO_HOME/config` (rust-lang/cargo#14579)
- fix(cargo-rustc): give trailing flags higher precedence on nightly (rust-lang/cargo#14587)
- feat: make lockfile v4 the default (rust-lang/cargo#14595)
- perf: Improve quality of completion performance traces (rust-lang/cargo#14592)
- test: Remove completion tests (rust-lang/cargo#14590)
- feat: Add support for completing `cargo update &lt;TAB&gt;` (rust-lang/cargo#14552)
- test: Migrate remaining with_stdout/with_stderr calls (rust-lang/cargo#14577)
- fix(resolve): Improve multi-MSRV workspaces (rust-lang/cargo#14569)
- chore: Bump MSRV to 1.81 (rust-lang/cargo#14585)
- Add a `--dry-run` flag to the `install` command (rust-lang/cargo#14280)
- fix(resolve): Don't list transitive, incompatible dependencies as available (rust-lang/cargo#14568)
- feat(complete): Upgrade clap_complete (rust-lang/cargo#14573)
@rustbot rustbot added this to the 1.83.0 milestone Sep 28, 2024
@epage epage deleted the autolib branch September 30, 2024 19:59
@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 Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues 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 to-announce
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cargo scripts try to build a nearby src/lib.rs if present
8 participants