]> git.proxmox.com Git - cargo.git/commit
Auto merge of #9365 - jyn514:rustc-bootstrap-crate-name, r=ehuss
authorbors <bors@rust-lang.org>
Tue, 20 Apr 2021 23:43:12 +0000 (23:43 +0000)
committerbors <bors@rust-lang.org>
Tue, 20 Apr 2021 23:43:12 +0000 (23:43 +0000)
commitfb0130cdb33cd6eac2de026a4d8eeda0da137e86
tree623b1bc9f5874a7a8df0979514ddad2ce4986cf3
parenta18936b14cdc39fa3bee22f42fd32568391195b1
parent5a7149683f8c61292d8d524304e9c248f683d993
Auto merge of #9365 - jyn514:rustc-bootstrap-crate-name, r=ehuss

Don't give a hard error when the end-user specifies RUSTC_BOOTSTRAP=crate_name

Fixes https://github.com/rust-lang/cargo/issues/9362.
The whole point of https://github.com/rust-lang/rust/pull/77802/ was to allow specifying this granularly, giving a hard error defeats the point.

I didn't know how to check what targets were reverse-dependencies of build.rs, so I just unconditionally use the library name (and give a hard error for anything else, even if it's the name of one of the binaries). End-users can still opt-in with RUSTC_BOOTSTRAP=1, and no public binaries use RUSTC_BOOTSTRAP=1, so I don't think this a big deal in practice.

<details><summary>Script to verify all crates using RUSTC_BOOTSTRAP=1 have a library</summary>

```sh
curl https://pastebin.com/raw/fGQ97xP6 | cut -d / -f1 | grep -v shnatsel | grep -v cargo- | sed 's#-\([0-9]\)#/\1#' | xargs -i curl -s -I -L "https://docs.rs/{}/" -w "%{http_code}\n" -o/dev/null
```

It should output 20 200s in a row.

</details>

r? `@ehuss` cc `@mark-simulacrum`

I don't know what cargo's policy is for backports, but this should be backported to 1.52.