-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Official API for build scripts #12432
Comments
fix: Set MSRV for internal packages ### What does this PR try to resolve? Correctly communicates the MSRV we support to our users. For packages that are more generally mean to be used by other people, I've punted on for now (see ehuss' comment on this PR). We'll likely need to figure this out for #12432 though ### Additional information This is prep for a future change which will have us use a fixed rust version for the semver tests with a PR updating them.
fix: Set MSRV for internal packages ### What does this PR try to resolve? Correctly communicates the MSRV we support to our users. For packages that are more generally mean to be used by other people, I've punted on for now (see ehuss' comment on this PR). We'll likely need to figure this out for #12432 though ### Additional information This is prep for a future change which will have us use a fixed rust version for the semver tests with a PR updating them.
Set and verify all MSRVs in CI ### What does this PR try to resolve? Allow us to advertise an MSRV for all public packages, unblocking #12432. Packages are broken down into two MSRV policies - Internal packages: `rust-version=stable` - Public packages: `rust-version=stable-2` To support this - RenovateBot will automatically update all MSRVs - CI will verify all packages build according to their MSRV Since this takes the "single workspace" approach, the downside is that common dependencies are subject to each package's MSRV. We also can't rely on `-Zmsrv-policy` to help us generate a lockfile because it breaks down when trying to support multiple MSRVs in a workspace ### How should we test and review this PR? Per commit ### Additional information #12381 skipped setting some MSRVs because we weren't sure how to handle it. For `cargo-credential`, we needed to do something and did one-off verification (#12623). `cargo-hack` recently gained the ability to automatically select MSRVs for each package allowing us to scale this up to the entire workspace. I don't know if we consciously chose an MSRV policy for `cargo-credential` but it looked like N-2 so that is what I stuck with and propagated out. - Without an aggressive sliding MSRV, we discourage people from using newer features because they will feel like they need permission which means it needs to be justified - Without an aggressive sliding MSRV, if the MSRV at one point in time works for someone, they tend to assume it will always work, leading to frustration at unmet expectations. I switched the MSRV check to `cargo check` from `cargo test` because I didn't want to deal with the out-of-diskspace issues and `check` will catch 99% of MSRV issues. Potential future improvements to `cargo-hack` - Allow `--version-range ..stable` so we can verify all MSRVs that aren't stable which would bypass the diskspace issues and allow us to more easily use `cargo test` again - Verify on a `cargo package` version of a crate (taiki-e/cargo-hack#216)
FYI we now have an MSRV policy as of #12654 |
I'm the person who wrote The content of A Some encouragement on increasing the scope though: I'd worry that not providing some API for external info not known to cargo that is still target specific means that the ecosystem of crates will continue to have various inconsistent ways of providing configuration that is (sometimes) target specific to build scripts. As long as env variables are the only really way to communicate that info (ie: until/unless target specs or some target spec adjacent thing exists to do something similar), we're going to want some pattern in env variable naming that tries to obtain consistency. Given that cargo has its own pattern here ( Also: just having something that reads an env var and emits the |
Could we consider providing such a crate with rustup? Similarly to how we have the built-in |
rust-lang/compiler-team#659 could allow optional packages in the sysroot but I don't think thats a route we should go. Being in the sysroot / distributed with rustup means we can't break compatibility. There are some existing packages in this space but I'm not ready to lock us down for 1.0 for ever at this point, if for no other reason. |
Totally get that, we'd likely need years of experimentation first, I'm mostly arguing considering that as the end goal. Just speaking personally, I wouldn't use such a crate, since I'm very wary about compile-times, and the extra dependency doesn't seem worth it for a (percieved) small usability improvement. But if I knew that it was on the way to being part of the standard distribution, I'd be willing to take the compile-time perf hit in the meantime. |
Hi, at the risk of overstepping my boundaries, I’d like to initiate a repo for this. If I develop an API crate under my own repo could we arrange for it to be subject to code review and if accepted, transferred to the rust-lang organization? |
Or alternatively we could just add a folder to the cargo repo. |
We have a crate name / implementation that was planned to be donated but its stuck in the current owner being busy and me being unfamiliar with the process for migrating something like that. |
Well build-rs, the crate that you seem to be talking about, does have extremely permissive licensing. With that being the case I doubt they'd be upset about me taking the initiative and adding it to the @CAD97 I'm pinging you to give you an opportunity to give us some input here. It's not my intent to override your will or governance of your project, but I do think my proposal is in line with your goals. |
I'm fully on board with cargo adopting build-rs directly. I've put a small amount of effort into trying to figure out what that'd look like but hadn't really gotten anywhere with that yet. |
Some people can use crates.io admin privileges to magically move ownership for you if and only if you make it clear that you want it. If you explicitly state that you would like to give published permission to the cargo team we (can probably) talk crates.io admins into making that happen without more intervention on your part. |
Uh, wow. I just came across the official policy for the team to take on a crate like this (created new or transfered). As this would be an "intentional artifact", apparently, this requires an RFC (rust-lang/rfcs#3505 is how I found out abut this). Starting a thread on zulip about this. |
Per the updated team charter, the addition of new Intentional artifacts does not need an RFC, only an FCP. |
I proposed we adopt
@rfcbot fcp merge |
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. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
I am now an owner of |
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 seemeed more invasive, so I wanted to leave that for a future PR. 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](https://doc.crates.io/contrib/team.html#decision-process), we approved this transfer in an [FCP](rust-lang#12432 (comment)). Fixes rust-lang#12432
### 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](https://doc.crates.io/contrib/team.html#decision-process), we approved this transfer in an [FCP](#12432 (comment)).
Problem
Having a Rust API would help with several problems
Proposed Solution
A crate that provides an API for working with build scripts
Notes
Things to work out
How do we handle the MSRV because the cargo repo currently only handles "latest" (see also fix: Set MSRV for internal packages #12381)see Set and verify all MSRVs in CI #12654As for timing, it'd help if we had this to recommend before we fully resolve #11461 so we can tell people to migrate once, rather than twice
FCP
The text was updated successfully, but these errors were encountered: