@@ -2220,6 +2220,8 @@ pub fn translate_dep_info(
2220
2220
#[ derive( Default ) ]
2221
2221
pub struct RustcDepInfo {
2222
2222
/// The list of files that the main target in the dep-info file depends on.
2223
+ ///
2224
+ /// The optional checksums are parsed from the special `# checksum:...` comments.
2223
2225
pub files : HashMap < PathBuf , Option < ( u64 , Checksum ) > > ,
2224
2226
/// The list of environment variables we found that the rustc compilation
2225
2227
/// depends on.
@@ -2228,6 +2230,8 @@ pub struct RustcDepInfo {
2228
2230
/// item is the value. `Some` means that the env var was set, and `None`
2229
2231
/// means that the env var wasn't actually set and the compilation depends
2230
2232
/// on it not being set.
2233
+ ///
2234
+ /// These are from the special `# env-var:...` comments.
2231
2235
pub env : Vec < ( String , Option < String > ) > ,
2232
2236
}
2233
2237
@@ -2236,6 +2240,33 @@ pub struct RustcDepInfo {
2236
2240
///
2237
2241
/// This is also stored in an optimized format to make parsing it fast because
2238
2242
/// Cargo will read it for crates on all future compilations.
2243
+ ///
2244
+ /// Currently the format looks like:
2245
+ ///
2246
+ /// ```text
2247
+ /// +------------+------------+---------------+---------------+
2248
+ /// | # of files | file paths | # of env vars | env var pairs |
2249
+ /// +------------+------------+---------------+---------------+
2250
+ /// ```
2251
+ ///
2252
+ /// Each field represents
2253
+ ///
2254
+ /// * _Number of files/envs_ --- A `u32` representing the number of things.
2255
+ /// * _File paths_ --- Zero or more paths of files the dep-info file depends on.
2256
+ /// Each path is encoded as the following:
2257
+ ///
2258
+ /// ```text
2259
+ /// +-----------+-------------+------------+---------------+-----------+-------+
2260
+ /// | Path type | len of path | path bytes | cksum exists? | file size | cksum |
2261
+ /// +-----------+-------------+------------+---------------+-----------+-------+
2262
+ /// ```
2263
+ /// * _Env var pairs_ --- Zero or more env vars the dep-info file depends on.
2264
+ /// Each env key-value pair is encoded as the following:
2265
+ /// ```text
2266
+ /// +------------+-----------+---------------+--------------+-------------+
2267
+ /// | len of key | key bytes | value exists? | len of value | value bytes |
2268
+ /// +------------+-----------+---------------+--------------+-------------+
2269
+ /// ```
2239
2270
#[ derive( Default ) ]
2240
2271
struct EncodedDepInfo {
2241
2272
files : Vec < ( DepInfoPathType , PathBuf , Option < ( u64 , String ) > ) > ,
0 commit comments