Skip to content

Commit 2acd6b7

Browse files
committed
Remove windows TCB hack from rustdoc
1 parent 3b3d702 commit 2acd6b7

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

src/librustdoc/lib.rs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -89,47 +89,7 @@ local_data_key!(pub analysiskey: core::CrateAnalysis)
8989
type Output = (clean::Crate, Vec<plugins::PluginJson> );
9090

9191
pub fn main() {
92-
// Why run rustdoc in a separate task? That's a good question!
93-
//
94-
// We first begin our adventure at the ancient commit of e7c4fb69. In this
95-
// commit it was discovered that the stack limit frobbing on windows ended
96-
// up causing some syscalls to fail. This was worked around manually in the
97-
// relevant location.
98-
//
99-
// Our journey now continues with #13259 where it was discovered that this
100-
// stack limit frobbing has the ability to affect nearly any syscall. Note
101-
// that the key idea here is that there is currently no knowledge as to why
102-
// this is happening or how to preserve it, fun times!
103-
//
104-
// Now we continue along to #16275 where it was discovered that --test on
105-
// windows didn't work at all! Yet curiously rustdoc worked without --test.
106-
// The exact reason that #16275 cropped up is that during the expansion
107-
// phase the compiler attempted to open libstd to read out its macros. This
108-
// invoked the LLVMRustOpenArchive shim which in turned went to LLVM to go
109-
// open a file and read it. Lo and behold this function returned an error!
110-
// It was then discovered that when the same fix mentioned in #13259 was
111-
// applied, the error went away. The plot thickens!
112-
//
113-
// Remember that rustdoc works without --test, which raises the question of
114-
// how because the --test and non --test paths are almost identical. The
115-
// first thing both paths do is parse and expand a crate! It turns out that
116-
// the difference is that --test runs on the *main task* while the normal
117-
// path runs in subtask. It turns out that running --test in a sub task also
118-
// fixes the problem!
119-
//
120-
// So, in summary, it is unknown why this is necessary, what it is
121-
// preventing, or what the actual bug is. In the meantime, this allows
122-
// --test to work on windows, which seems good, right? Fun times.
123-
let (tx, rx) = channel();
124-
spawn(proc() {
125-
std::os::set_exit_status(main_args(std::os::args().as_slice()));
126-
tx.send(());
127-
});
128-
129-
// If the task failed, set an error'd exit status
130-
if rx.recv_opt().is_err() {
131-
std::os::set_exit_status(std::rt::DEFAULT_ERROR_CODE);
132-
}
92+
std::os::set_exit_status(main_args(std::os::args().as_slice()));
13393
}
13494

13595
pub fn opts() -> Vec<getopts::OptGroup> {

0 commit comments

Comments
 (0)