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

Migrate build-rs to the Cargo repo #14786

Merged
merged 22 commits into from
Nov 13, 2024
Merged

Migrate build-rs to the Cargo repo #14786

merged 22 commits into from
Nov 13, 2024

Conversation

epage
Copy link
Contributor

@epage epage commented Nov 5, 2024

What does this PR try to resolve?

Fixes #12432

How should we test and review this PR?

This pulls in https://github.com/cad97/build-rs at eb389d1 with the following changes:

  • Cargo.toml metadata
  • Removal of .github, .gitignore, Cargo.lock

We'll need to integrate test-lib into our processes but that seemed more invasive, so I wanted to leave that for a future PR.

Additional information

Infra changes are being coordinated in https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Transfering.20.60build-rs.60.20crate.20to.20rust-lang/near/480779960

Context: per Cargo's charter, we approved this transfer in an FCP.

@rustbot
Copy link
Collaborator

rustbot commented Nov 5, 2024

r? @weihanglo

rustbot has assigned @weihanglo.
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-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2024
crates/build-rs/Cargo.toml Show resolved Hide resolved
[package]
name = "build-rs"
version = "0.2.0"
rust-version.workspace = true
Copy link
Member

Choose a reason for hiding this comment

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

Just want to call out that this MSRV seems way too high for this crate.
We may want to lower this in the future.

@epage epage force-pushed the build-rs branch 2 times, most recently from be583bc to d7e0567 Compare November 6, 2024 18:56
@CAD97
Copy link
Contributor

CAD97 commented Nov 6, 2024

FYI I didn't see this had been created already and finally added some cleanup and items I had missed in the v0.2 refactor that will want to be pulled into this as well.

build-rs-test-lib is just a package that hosts a buildscript that can smoke test invoking the API in a build script context; I don't think it should need anything special.

The changes from v0.1 to v0.2 are a simplification of implementation, removal of the glob reexports, and basic integration of how the crate can do whatever version smoothing is considered desirable.

@rustbot rustbot added the A-documenting-cargo-itself Area: Cargo's documentation label Nov 7, 2024
Copy link
Contributor

@CAD97 CAD97 left a comment

Choose a reason for hiding this comment

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

One relevant comment on API stability of the API for unstable cfg directives, and the rest is mostly just me boggling at code I wrote weirdly while transcribing my understanding of the buildscript protocol into code, and don't need to be addressed here.

Plus my explicit public 👍 to making build-rs an intentionally produced cargo artifact.

@@ -0,0 +1,2 @@
> This crate is maintained by the Cargo team for use by the wider
> ecosystem. This crate follows semver compatibility for its APIs.
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably want to explicitly exempt the unstable feature here, and/or migrate it to using a cfg (like procmacro2_semver_exempt) instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My assumption is that its fine as that feature is documented as unstable. I'm not even sure why that line is encouraged in the policy. Pretty much every lib is assumed to follow semver.

crates/build-rs/src/output.rs Show resolved Hide resolved
crates/build-rs/src/output.rs Show resolved Hide resolved
crates/build-rs/src/output.rs Show resolved Hide resolved
crates/build-rs/src/output.rs Show resolved Hide resolved
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

Looks good to me. Some areas may need to polish, but as Ed said we should defer them to separate PRs.

@weihanglo
Copy link
Member

Since the FCP was completed. Going to merge this now.

@bors r+

@bors
Copy link
Contributor

bors commented Nov 13, 2024

@weihanglo: 🔑 Insufficient privileges: Not in reviewers

@weihanglo weihanglo added this pull request to the merge queue Nov 13, 2024
Merged via the queue into rust-lang:master with commit e5ce5e5 Nov 13, 2024
22 checks passed
@epage epage deleted the build-rs branch November 13, 2024 17:54
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2024
Update cargo

15 commits in 4a2d8dc636445b276288543882e076f254b3ae95..69e595908e2c420e7f0d1be34e6c5b984c8cfb84
2024-11-09 19:10:33 +0000 to 2024-11-16 01:26:11 +0000
- refactor(fingerprint): Track the intent for each use of `UnitHash` (rust-lang/cargo#14826)
- fix(toml): Update frontmatter parser for RFC 3503 (rust-lang/cargo#14792)
- docs(unstable): Move -Zwarnings from stable to unstable section (rust-lang/cargo#14827)
- Simplify English used in guide (rust-lang/cargo#14825)
- feat(resolver): Stabilize resolver v3 (rust-lang/cargo#14754)
- docs: Clean up doc comments (rust-lang/cargo#14823)
- fix(remove): On error, suggest other dependencies  (rust-lang/cargo#14818)
- Always include Cargo.lock in published crates (rust-lang/cargo#14815)
- fix(build-rs)!: Updates from an audit (rust-lang/cargo#14817)
- feat(rustdoc): diplay env vars in extra verbose mode  (rust-lang/cargo#14812)
- Migrate build-rs to the Cargo repo (rust-lang/cargo#14786)
- chore(ci): Check for clippy `correctness` (rust-lang/cargo#14796)
- git: do not validate submodules of fresh checkouts (rust-lang/cargo#14605)
- refactor: clone-on-write when needed for InternedString (rust-lang/cargo#14808)
- fix(docs): typo in cargo-fmt.md (rust-lang/cargo#14805)
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 16, 2024
Update cargo

15 commits in 4a2d8dc636445b276288543882e076f254b3ae95..69e595908e2c420e7f0d1be34e6c5b984c8cfb84
2024-11-09 19:10:33 +0000 to 2024-11-16 01:26:11 +0000
- refactor(fingerprint): Track the intent for each use of `UnitHash` (rust-lang/cargo#14826)
- fix(toml): Update frontmatter parser for RFC 3503 (rust-lang/cargo#14792)
- docs(unstable): Move -Zwarnings from stable to unstable section (rust-lang/cargo#14827)
- Simplify English used in guide (rust-lang/cargo#14825)
- feat(resolver): Stabilize resolver v3 (rust-lang/cargo#14754)
- docs: Clean up doc comments (rust-lang/cargo#14823)
- fix(remove): On error, suggest other dependencies  (rust-lang/cargo#14818)
- Always include Cargo.lock in published crates (rust-lang/cargo#14815)
- fix(build-rs)!: Updates from an audit (rust-lang/cargo#14817)
- feat(rustdoc): diplay env vars in extra verbose mode  (rust-lang/cargo#14812)
- Migrate build-rs to the Cargo repo (rust-lang/cargo#14786)
- chore(ci): Check for clippy `correctness` (rust-lang/cargo#14796)
- git: do not validate submodules of fresh checkouts (rust-lang/cargo#14605)
- refactor: clone-on-write when needed for InternedString (rust-lang/cargo#14808)
- fix(docs): typo in cargo-fmt.md (rust-lang/cargo#14805)
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 17, 2024
Update cargo

15 commits in 4a2d8dc636445b276288543882e076f254b3ae95..69e595908e2c420e7f0d1be34e6c5b984c8cfb84
2024-11-09 19:10:33 +0000 to 2024-11-16 01:26:11 +0000
- refactor(fingerprint): Track the intent for each use of `UnitHash` (rust-lang/cargo#14826)
- fix(toml): Update frontmatter parser for RFC 3503 (rust-lang/cargo#14792)
- docs(unstable): Move -Zwarnings from stable to unstable section (rust-lang/cargo#14827)
- Simplify English used in guide (rust-lang/cargo#14825)
- feat(resolver): Stabilize resolver v3 (rust-lang/cargo#14754)
- docs: Clean up doc comments (rust-lang/cargo#14823)
- fix(remove): On error, suggest other dependencies  (rust-lang/cargo#14818)
- Always include Cargo.lock in published crates (rust-lang/cargo#14815)
- fix(build-rs)!: Updates from an audit (rust-lang/cargo#14817)
- feat(rustdoc): diplay env vars in extra verbose mode  (rust-lang/cargo#14812)
- Migrate build-rs to the Cargo repo (rust-lang/cargo#14786)
- chore(ci): Check for clippy `correctness` (rust-lang/cargo#14796)
- git: do not validate submodules of fresh checkouts (rust-lang/cargo#14605)
- refactor: clone-on-write when needed for InternedString (rust-lang/cargo#14808)
- fix(docs): typo in cargo-fmt.md (rust-lang/cargo#14805)
@weihanglo weihanglo added this to the 1.84.0 milestone Nov 28, 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-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Official API for build scripts
5 participants