Skip to content

Commit 9b0214d

Browse files
committed
Auto merge of #66255 - ehuss:update-cc, r=alexcrichton
Update cc, git2, num_cpus. This updates the `cc` crate, bringing in better parallel building support. Also updates `git2` which enables the parallel feature. (Note: I don't expect it will have a significant impact on build time, but seems good to update anyways.) The main thorn is that `cc` gained knowledge about RISC-V architectures (rust-lang/cc-rs#428, rust-lang/cc-rs#429, rust-lang/cc-rs#430), but the builders on CI do not have the riscv C compiler installed. This means that bootstraps' cc detection was finding a C compiler that isn't installed, and fails. The solution here is to override the cc detection to `false`. The C compiler isn't actually used on riscv platforms. AFAIK, the only location would be compiler_builtins, and it currently forces C support off (https://github.com/rust-lang/compiler-builtins/blob/a533ae9c5aa325db209659679535fe1f186eae81/build.rs#L49-L55). Other possible solutions: - Add the override in cc_detect for riscv (or any "no-C" platform like wasm32 and nvptx) - Install and use the appropriate c compiler. I tried this the `g++-riscv64-linux-gnu` package, but it failed missing some header file. Closes #66232
2 parents 1d8b6ce + a902383 commit 9b0214d

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

Cargo.lock

+12-9
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,13 @@ version = "0.1.0"
386386

387387
[[package]]
388388
name = "cc"
389-
version = "1.0.37"
389+
version = "1.0.47"
390390
source = "registry+https://github.com/rust-lang/crates.io-index"
391-
checksum = "39f75544d7bbaf57560d2168f28fd649ff9c76153874db88bdbdfd839b1a7e7d"
391+
checksum = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8"
392+
dependencies = [
393+
"jobserver",
394+
"num_cpus",
395+
]
392396

393397
[[package]]
394398
name = "cfg-if"
@@ -1255,9 +1259,9 @@ dependencies = [
12551259

12561260
[[package]]
12571261
name = "git2"
1258-
version = "0.10.0"
1262+
version = "0.10.1"
12591263
source = "registry+https://github.com/rust-lang/crates.io-index"
1260-
checksum = "327d698f86a7ebdfeb86a4238ccdb004828939d3a3555b6ead679541d14e36c0"
1264+
checksum = "39f27186fbb5ec67ece9a56990292bc5aed3c3fc51b9b07b0b52446b1dfb4a82"
12611265
dependencies = [
12621266
"bitflags",
12631267
"libc",
@@ -1785,9 +1789,9 @@ dependencies = [
17851789

17861790
[[package]]
17871791
name = "libgit2-sys"
1788-
version = "0.9.0"
1792+
version = "0.9.1"
17891793
source = "registry+https://github.com/rust-lang/crates.io-index"
1790-
checksum = "8c2078aec6f4b16d1b89f6a72e4f6eb1e75ffa85312023291e89c6d3087bc8fb"
1794+
checksum = "a30f8637eb59616ee3b8a00f6adff781ee4ddd8343a615b8238de756060cc1b3"
17911795
dependencies = [
17921796
"cc",
17931797
"libc",
@@ -2228,9 +2232,9 @@ checksum = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"
22282232

22292233
[[package]]
22302234
name = "num_cpus"
2231-
version = "1.8.0"
2235+
version = "1.10.1"
22322236
source = "registry+https://github.com/rust-lang/crates.io-index"
2233-
checksum = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30"
2237+
checksum = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
22342238
dependencies = [
22352239
"libc",
22362240
]
@@ -3130,7 +3134,6 @@ dependencies = [
31303134
"backtrace",
31313135
"bitflags",
31323136
"byteorder",
3133-
"cc",
31343137
"chalk-engine",
31353138
"fmt_macros",
31363139
"graphviz",

src/ci/docker/dist-various-1/Dockerfile

+9-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ ENV TARGETS=$TARGETS,armv7r-none-eabi
135135
ENV TARGETS=$TARGETS,armv7r-none-eabihf
136136
ENV TARGETS=$TARGETS,thumbv7neon-unknown-linux-gnueabihf
137137

138+
# riscv targets currently do not need a C compiler, as compiler_builtins
139+
# doesn't currently have it enabled, and the riscv gcc compiler is not
140+
# installed.
138141
ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
139142
CC_mips_unknown_linux_musl=mips-openwrt-linux-gcc \
140143
CC_mips64el_unknown_linux_muslabi64=mips64el-linux-gnuabi64-gcc \
@@ -143,7 +146,12 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
143146
CC_x86_64_unknown_redox=x86_64-unknown-redox-gcc \
144147
CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
145148
AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \
146-
CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++
149+
CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++ \
150+
CC_riscv32i_unknown_none_elf=false \
151+
CC_riscv32imc_unknown_none_elf=false \
152+
CC_riscv32imac_unknown_none_elf=false \
153+
CC_riscv64imac_unknown_none_elf=false \
154+
CC_riscv64gc_unknown_none_elf=false
147155

148156
ENV RUST_CONFIGURE_ARGS \
149157
--musl-root-armv5te=/musl-armv5te \

src/librustc/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ path = "lib.rs"
1010
doctest = false
1111

1212
[dependencies]
13-
# Prevent cc from upgrading all the way to 1.0.46,
14-
# which fails the build (see e.g. #65445.)
15-
cc = "=1.0.37"
16-
1713
arena = { path = "../libarena" }
1814
bitflags = "1.2.1"
1915
fmt_macros = { path = "../libfmt_macros" }

0 commit comments

Comments
 (0)