Skip to content

Commit 4c3cc3c

Browse files
committed
try debugging proc-macro erro
1 parent 2bc2cab commit 4c3cc3c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/docbuilder/caching.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use std::{
66
time::SystemTime,
77
};
88
use sysinfo::{DiskExt, RefreshKind, System, SystemExt};
9-
use tracing::{debug, instrument, warn};
9+
use tracing::{debug, info, instrument, warn};
10+
use walkdir::WalkDir;
1011

1112
static LAST_ACCESSED_FILE_NAME: &str = "docsrs_last_accessed";
1213

@@ -153,6 +154,14 @@ impl ArtifactCache {
153154
Ok(())
154155
}
155156

157+
fn print_directory_contents<P: AsRef<Path>>(path: P) -> Result<()> {
158+
info!("directory contents of {}:", path.as_ref().display());
159+
for entry in WalkDir::new(path) {
160+
info!("\t{}", entry?.path().display());
161+
}
162+
Ok(())
163+
}
164+
156165
/// restore a cached target directory.
157166
///
158167
/// Will just move the cache folder into the rustwide
@@ -181,6 +190,7 @@ impl ArtifactCache {
181190
fs::create_dir_all(target_dir.parent().unwrap())?;
182191
fs::rename(cache_dir, target_dir).context("could not move cache directory to target")?;
183192
self.cleanup(target_dir)?;
193+
self.print_directory_contents(target_dir)?;
184194
Ok(())
185195
}
186196

src/docbuilder/rustwide_builder.rs

+6
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ impl RustwideBuilder {
105105
})
106106
}
107107

108+
pub fn init_for_test(context: &dyn Context) -> Result<Self> {
109+
let builder = Self::init(context)?;
110+
builder.artifact_cache.purge()?;
111+
Ok(builder)
112+
}
113+
108114
pub fn set_skip_build_if_exists(&mut self, should: bool) {
109115
self.skip_build_if_exists = should;
110116
}

0 commit comments

Comments
 (0)