Skip to content

Commit 0f970e4

Browse files
committed
Check target documentation directory before add
1 parent d38e747 commit 0f970e4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/docbuilder/chroot_builder.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,19 @@ impl DocBuilder {
183183
package.manifest().version(),
184184
target);
185185
if let Ok(_) = self.chroot_command(cmd) {
186-
successfuly_targets.push(target.to_string());
186+
// Cargo is not giving any error and not generating documentation of some crates
187+
// when we use a target compile options. Check documentation exists before
188+
// adding target to successfully_targets.
189+
// FIXME: Need to figure out why some docs are not generated with target option
190+
let target_doc_path = PathBuf::from(&self.options.chroot_path)
191+
.join("home")
192+
.join(&self.options.chroot_user)
193+
.join(canonical_name(&package))
194+
.join(&target)
195+
.join("doc");
196+
if target_doc_path.exists() {
197+
successfuly_targets.push(target.to_string());
198+
}
187199
}
188200
}
189201
successfuly_targets

0 commit comments

Comments
 (0)