Skip to content

Commit 73369f3

Browse files
Hopefully fix rustdoc build
It's super unclear why this broke when we switched to beta but not previously -- but at least it's hopefully fixed now.
1 parent 22f4fa7 commit 73369f3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/bootstrap/builder.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,18 @@ impl<'a> Builder<'a> {
886886
// things still build right, please do!
887887
match mode {
888888
Mode::Std => metadata.push_str("std"),
889-
_ => {},
889+
// When we're building rustc tools, they're built with a search path
890+
// that contains things built during the rustc build. For example,
891+
// bitflags is built during the rustc build, and is a dependency of
892+
// rustdoc as well. We're building rustdoc in a different target
893+
// directory, though, which means that Cargo will rebuild the
894+
// dependency. When we go on to build rustdoc, we'll look for
895+
// bitflags, and find two different copies: one built during the
896+
// rustc step and one that we just built. This isn't always a
897+
// problem, somehow -- not really clear why -- but we know that this
898+
// fixes things.
899+
Mode::ToolRustc => metadata.push_str("tool-rustc"),
900+
_ => {}
890901
}
891902
cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);
892903

0 commit comments

Comments
 (0)