Skip to content

Commit 16d9204

Browse files
authored
Rollup merge of rust-lang#44515 - tamird:clean-shims, r=alexcrichton
{compiler-builtins,libc} shim cleanup ~~Depends on rust-lang/libc#764; opening early for feedback.~~ r? @alexcrichton
2 parents 334da4a + 509982c commit 16d9204

File tree

5 files changed

+41
-48
lines changed

5 files changed

+41
-48
lines changed

src/rustc/compiler_builtins_shim/Cargo.toml

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# See libc_shim/Cargo.toml for why this exists
2-
31
[package]
42
name = "compiler_builtins"
53
authors = ["The Rust Project Developers"]
@@ -12,6 +10,23 @@ test = false
1210
doctest = false
1311

1412
[dependencies]
13+
# Specify the path to libcore; at the time of writing, removing this shim in
14+
# favor of using compiler-builtins from git results in a compilation failure:
15+
#
16+
# Building stage0 std artifacts (x86_64-apple-darwin -> x86_64-apple-darwin)
17+
# Compiling compiler_builtins v0.1.0 (https://github.com/rust-lang-nursery/compiler-builtins.git#23f14d3f)
18+
# error[E0463]: can't find crate for `core`
19+
#
20+
# error: aborting due to previous error
21+
#
22+
# error: Could not compile `compiler_builtins`.
23+
#
24+
# Caused by:
25+
# process didn't exit successfully: `/Users/tamird/src/rust/build/bootstrap/debug/rustc --crate-name compiler_builtins /Users/tamird/.cargo/git/checkouts/compiler-builtins-ec094dc45a0179c8/23f14d3/src/lib.rs --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 --cfg feature="c" --cfg feature="compiler-builtins" --cfg feature="default" --cfg feature="gcc" -C metadata=876d429e8d7eae1f -C extra-filename=-876d429e8d7eae1f --out-dir /Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/x86_64-apple-darwin/release/deps --target x86_64-apple-darwin -L dependency=/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/x86_64-apple-darwin/release/deps -L dependency=/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/release/deps --cap-lints allow -L native=/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/x86_64-apple-darwin/release/build/compiler_builtins-f18fab55928102ad/out -l static=compiler-rt` (exit code: 101)
26+
# thread 'main' panicked at 'command did not execute successfully: "/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-apple-darwin" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/Users/tamird/src/rust/src/libstd/Cargo.toml" "--message-format" "json"
27+
# expected success, got: exit code: 101', src/bootstrap/compile.rs:883:8
28+
#
29+
# See https://github.com/rust-lang/rfcs/pull/1133.
1530
core = { path = "../../libcore" }
1631

1732
[build-dependencies]

src/rustc/compiler_builtins_shim/build.rs

-18
This file was deleted.

src/rustc/libc_shim/Cargo.toml

+23-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
# This is a shim Cargo.toml over the "real Cargo.toml" found in the libc
2-
# repository itself. The purpose for this is to add a build script which prints
3-
# out `--cfg stdbuild` to mirror the makefiles' build system.
4-
#
5-
# Note that other than that this isn't actually needed, and we should probably
6-
# remove this shim in favor of just working with cargo features directly with
7-
# libc. That should make everything nicer!
8-
91
[package]
102
name = "libc"
113
version = "0.0.0"
124
authors = ["The Rust Project Developers"]
13-
build = "build.rs"
145

156
[lib]
167
name = "libc"
@@ -20,4 +11,27 @@ bench = false
2011
doc = false
2112

2213
[dependencies]
14+
# Specify the path to libcore; at the time of writing, removing this shim in
15+
# favor of using libc from git results in a compilation failure:
16+
#
17+
# Building stage0 std artifacts (x86_64-apple-darwin -> x86_64-apple-darwin)
18+
# Compiling libc v0.0.0 (file:///Users/tamird/src/rust/src/rustc/libc_shim)
19+
# error[E0463]: can't find crate for `core`
20+
#
21+
# error: aborting due to previous error
22+
#
23+
# error: Could not compile `libc`.
24+
#
25+
# Caused by:
26+
# process didn't exit successfully: `/Users/tamird/src/rust/build/bootstrap/debug/rustc --crate-name libc src/rustc/libc_shim/../../liblibc/src/lib.rs --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 --cfg feature="default" --cfg feature="no_std" --cfg feature="stdbuild" -C metadata=d758f87058112d7d -C extra-filename=-d758f87058112d7d --out-dir /Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/x86_64-apple-darwin/release/deps --target x86_64-apple-darwin -L dependency=/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/x86_64-apple-darwin/release/deps -L dependency=/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0-std/release/deps` (exit code: 101)
27+
# thread 'main' panicked at 'command did not execute successfully: "/Users/tamird/src/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-apple-darwin" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/Users/tamird/src/rust/src/libstd/Cargo.toml" "--message-format" "json"
28+
# expected success, got: exit code: 101', src/bootstrap/compile.rs:883:8
29+
#
30+
# See https://github.com/rust-lang/rfcs/pull/1133.
2331
core = { path = "../../libcore" }
32+
33+
[features]
34+
# Certain parts of libc are conditionally compiled differently than when used
35+
# outside rustc. See https://github.com/rust-lang/libc/search?l=Rust&q=stdbuild&type=&utf8=%E2%9C%93.
36+
stdbuild = []
37+
default = ["stdbuild"]

src/rustc/libc_shim/build.rs

-18
This file was deleted.

0 commit comments

Comments
 (0)