diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-03-07 23:11:05 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-03-08 11:52:11 -0800 |
| commit | f7b7535fd7cc4df3c137c5ce05bcd9817e8e006c (patch) | |
| tree | ef2be61e27138c1c0ada43a14790ae5c2e140720 /src/bootstrap/rustdoc.rs | |
| parent | 0788cd23ea6e3f1b05240d591870899b9d38f5f4 (diff) | |
| download | rust-f7b7535fd7cc4df3c137c5ce05bcd9817e8e006c.tar.gz rust-f7b7535fd7cc4df3c137c5ce05bcd9817e8e006c.zip | |
rustbuild: Fixup calling rustdoc in various stages
The stage0 rustdoc comes from the snapshot, and we need a shim like with `rustc` to pass `--cfg` for now.
Diffstat (limited to 'src/bootstrap/rustdoc.rs')
| -rw-r--r-- | src/bootstrap/rustdoc.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/bootstrap/rustdoc.rs b/src/bootstrap/rustdoc.rs new file mode 100644 index 00000000000..8c618196113 --- /dev/null +++ b/src/bootstrap/rustdoc.rs @@ -0,0 +1,31 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +//! Shim which is passed to Cargo as "rustdoc" when running the bootstrap. +//! +//! See comments in `src/bootstrap/rustc.rs` for more information. + +use std::env; +use std::process::Command; + +fn main() { + let args = env::args_os().skip(1).collect::<Vec<_>>(); + let rustdoc = env::var_os("RUSTDOC_REAL").unwrap(); + + let mut cmd = Command::new(rustdoc); + cmd.args(&args) + .arg("--cfg").arg(format!("stage{}", env::var("RUSTC_STAGE").unwrap())) + .arg("--cfg").arg("dox"); + std::process::exit(match cmd.status() { + Ok(s) => s.code().unwrap_or(1), + Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e), + }) +} + |
