Skip to content

Commit 9a372ca

Browse files
connernilsenfacebook-github-bot
authored andcommitted
Add logging around querying buck for source DB
Reviewed By: grievejia Differential Revision: D83354555 fbshipit-source-id: 1029055a07e55c4efa567021826d252b1bca8203
1 parent c4b5833 commit 9a372ca

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

crates/pyrefly_build/src/buck/bxl.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ use pyrefly_util::lock::Mutex;
1616
use pyrefly_util::lock::RwLock;
1717
use starlark_map::small_map::SmallMap;
1818
use starlark_map::small_set::SmallSet;
19+
use tracing::debug;
20+
use tracing::info;
1921

2022
use crate::buck::query::Include;
2123
use crate::buck::query::PythonLibraryManifest;
@@ -72,6 +74,7 @@ impl BuckSourceDatabase {
7274
let new_db = raw_db.produce_map();
7375
let read = self.inner.read();
7476
if new_db == read.db {
77+
debug!("No source DB changes from Buck query");
7578
return false;
7679
}
7780
drop(read);
@@ -88,6 +91,7 @@ impl BuckSourceDatabase {
8891
}
8992
}
9093
write.db = new_db;
94+
debug!("Finished updating source DB with Buck response");
9195
true
9296
}
9397
}
@@ -151,10 +155,13 @@ impl SourceDatabase for BuckSourceDatabase {
151155
let new_includes = files.into_iter().map(Include::path).collect();
152156
let mut includes = self.includes.lock();
153157
if *includes == new_includes {
158+
debug!("Not querying Buck source DB, since no inputs have changed");
154159
return Ok(false);
155160
}
156161
*includes = new_includes;
162+
info!("Querying Buck for source DB");
157163
let raw_db = query_source_db(includes.iter(), &self.cwd)?;
164+
info!("Finished querying Buck for source DB");
158165
Ok(self.update_with_target_manifest(raw_db))
159166
}
160167
}

test/basic.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ $ echo -e "from typing import reveal_type\nreveal_type(1)" > $TMPDIR/empty.py &&
2020

2121
```scrut {output_stream: stderr}
2222
$ $PYREFLY check $TEST_PY
23+
INFO Querying Buck for source DB (glob?)
24+
INFO Finished querying Buck for source DB (glob?)
2325
INFO 0 errors
2426
[0]
2527
```

0 commit comments

Comments
 (0)