You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/utils/extern_args.rs
+35-6Lines changed: 35 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
//! Get "compiler" args from cargo
2
2
3
3
usecrate::errors::*;
4
-
use log::info;
4
+
use log::{info, warn};
5
5
use std::fs::File;
6
6
use std::path::{Path,PathBuf};
7
7
use std::process::Command;
@@ -29,7 +29,7 @@ use std::process::Command;
29
29
/// extern_args.load(&proj_root)?;
30
30
///
31
31
/// // then, when actually invoking rustdoc or some other compiler-like tool...
32
-
///
32
+
///
33
33
/// assert!(extern_args.get_args().iter().any(|e| e == "-L")); // args contains "-L".to_string()
34
34
/// assert!(extern_args.get_args().iter().any(|e| e == "--extern"));
35
35
/// # Ok(())
@@ -86,6 +86,7 @@ impl ExternArgs {
86
86
87
87
/// Parse response stdout+stderr response from `cargo build`
88
88
/// into arguments we can use to invoke rustdoc.
89
+
/// Stop at first line that traces a compiler invocation.
89
90
///
90
91
/// >>> This parser is broken, doesn't handle arg values with embedded spaces (single quoted).
91
92
/// Fortunately, the args we care about (so far) don't have those kinds of values.
@@ -105,9 +106,15 @@ impl ExternArgs {
105
106
_ => {}
106
107
}
107
108
}
109
+
110
+
returnOk(());
108
111
};
109
112
}
110
113
114
+
ifself.suffix_args.len() < 1{
115
+
warn!("Couldn't extract --extern args from Cargo, is current directory == cargo project root?");
116
+
}
117
+
111
118
Ok(())
112
119
}
113
120
@@ -123,12 +130,34 @@ mod test {
123
130
124
131
#[test]
125
132
fnparse_response_parses_string() -> Result<()>{
126
-
let resp = std::fs::read_to_string("tests/t1.txt")?;
133
+
let test_str = r###"
134
+
Fresh unicode-ident v1.0.14
135
+
Fresh cfg-if v1.0.0
136
+
Fresh memchr v2.7.4
137
+
Fresh autocfg v1.4.0
138
+
Fresh version_check v0.9.5
139
+
--- clip ---
140
+
Fresh bytecount v0.6.8
141
+
Fresh leptos_router v0.7.0
142
+
Fresh leptos_meta v0.7.0
143
+
Fresh console_error_panic_hook v0.1.7
144
+
Fresh mdbook-keeper v0.5.0
145
+
Dirty leptos-book v0.1.0 (/home/bobhy/src/localdep/book): the file `src/lib.rs` has changed (1733758773.052514835s, 10h 32m 29s after last build at 1733720824.458358565s)
0 commit comments