File tree 2 files changed +16
-2
lines changed
bootstrap/src/core/build_steps
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,14 @@ impl<P: Step> Step for RustbookSrc<P> {
170
170
builder. add_rustc_lib_path ( compiler, & mut rustbook_cmd) ;
171
171
}
172
172
173
- rustbook_cmd. arg ( "build" ) . arg ( & src) . arg ( "-d" ) . arg ( & out) . run ( builder) ;
173
+ rustbook_cmd
174
+ . arg ( "build" )
175
+ . arg ( & src)
176
+ . arg ( "-d" )
177
+ . arg ( & out)
178
+ . arg ( "--rust-root" )
179
+ . arg ( & builder. src )
180
+ . run ( builder) ;
174
181
175
182
for lang in & self . languages {
176
183
let out = out. join ( lang) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ fn main() {
22
22
. required ( false )
23
23
. value_parser ( clap:: value_parser!( String ) ) ;
24
24
25
+ let root_arg = arg ! ( --"rust-root" <ROOT_DIR >
26
+ "Path to the root of the rust source tree" )
27
+ . required ( false )
28
+ . value_parser ( clap:: value_parser!( PathBuf ) ) ;
29
+
25
30
let dir_arg = arg ! ( [ dir] "Root directory for the book\n \
26
31
(Defaults to the current directory when omitted)")
27
32
. value_parser ( clap:: value_parser!( PathBuf ) ) ;
@@ -37,6 +42,7 @@ fn main() {
37
42
. about ( "Build the book from the markdown files" )
38
43
. arg ( d_arg)
39
44
. arg ( l_arg)
45
+ . arg ( root_arg)
40
46
. arg ( & dir_arg) ,
41
47
)
42
48
. subcommand (
@@ -96,7 +102,8 @@ pub fn build(args: &ArgMatches) -> Result3<()> {
96
102
}
97
103
98
104
if book. config . get_preprocessor ( "spec" ) . is_some ( ) {
99
- book. with_preprocessor ( Spec :: new ( ) ) ;
105
+ let rust_root = args. get_one :: < PathBuf > ( "rust-root" ) . cloned ( ) ;
106
+ book. with_preprocessor ( Spec :: new ( rust_root) ?) ;
100
107
}
101
108
102
109
book. build ( ) ?;
You can’t perform that action at this time.
0 commit comments