Skip to content

Make search path debugging info! for easier debugging #36987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/librustc/session/filesearch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<'a> FileSearch<'a> {
visited_dirs.insert(path.to_path_buf());
}

debug!("filesearch: searching lib path");
info!("filesearch: searching lib path");
let tlib_path = make_target_lib_path(self.sysroot,
self.triple);
if !visited_dirs.contains(&tlib_path) {
Expand All @@ -65,8 +65,12 @@ impl<'a> FileSearch<'a> {
pub fn search<F>(&self, mut pick: F)
where F: FnMut(&Path, PathKind) -> FileMatch
{
info!("starting filesearch for target {} with sysroot {:?}", self.triple, self.sysroot);
self.for_each_lib_search_path(|lib_search_path, _| {
info!("going to search dir {}", lib_search_path.display());
});
self.for_each_lib_search_path(|lib_search_path, kind| {
debug!("searching {}", lib_search_path.display());
info!("searching {}", lib_search_path.display());
match fs::read_dir(lib_search_path) {
Ok(files) => {
let files = files.filter_map(|p| p.ok().map(|s| s.path()))
Expand All @@ -81,14 +85,14 @@ impl<'a> FileSearch<'a> {
let files1 = files.iter().filter(|p| is_rlib(p));
let files2 = files.iter().filter(|p| !is_rlib(p));
for path in files1.chain(files2) {
debug!("testing {}", path.display());
info!("testing {}", path.display());
let maybe_picked = pick(path, kind);
match maybe_picked {
FileMatches => {
debug!("picked {}", path.display());
info!("picked {}", path.display());
}
FileDoesntMatch => {
debug!("rejected {}", path.display());
info!("rejected {}", path.display());
}
}
}
Expand All @@ -102,7 +106,7 @@ impl<'a> FileSearch<'a> {
triple: &'a str,
search_paths: &'a SearchPaths,
kind: PathKind) -> FileSearch<'a> {
debug!("using sysroot = {}, triple = {}", sysroot.display(), triple);
info!("using sysroot = {}, triple = {}", sysroot.display(), triple);
FileSearch {
sysroot: sysroot,
search_paths: search_paths,
Expand Down