mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
WIP: scratch logging
This commit is contained in:
parent
2a240925f2
commit
b4bf74bdc2
3 changed files with 28 additions and 0 deletions
|
@ -156,9 +156,17 @@ impl GitResolver {
|
|||
source
|
||||
};
|
||||
|
||||
println!(
|
||||
"JACK thread {:?}: start fetch task",
|
||||
std::thread::current().id()
|
||||
);
|
||||
let fetch = tokio::task::spawn_blocking(move || source.fetch())
|
||||
.await?
|
||||
.map_err(GitResolverError::Git)?;
|
||||
println!(
|
||||
"JACK thread {:?}: join fetch task",
|
||||
std::thread::current().id()
|
||||
);
|
||||
|
||||
// Insert the resolved URL into the in-memory cache. This ensures that subsequent fetches
|
||||
// resolve to the same precise commit.
|
||||
|
|
|
@ -72,6 +72,10 @@ impl GitSource {
|
|||
/// Fetch the underlying Git repository at the given revision.
|
||||
#[instrument(skip(self), fields(repository = %self.git.repository(), rev = ?self.git.precise()))]
|
||||
pub fn fetch(self) -> Result<Fetch> {
|
||||
println!(
|
||||
"JACK thread {:?}: inside fetch task",
|
||||
std::thread::current().id()
|
||||
);
|
||||
// Compute the canonical URL for the repository.
|
||||
let canonical = RepositoryUrl::new(self.git.repository());
|
||||
|
||||
|
@ -111,6 +115,10 @@ impl GitSource {
|
|||
// This reference is an exact commit. Treat it like it's
|
||||
// locked.
|
||||
debug!("Using existing Git source `{}`", self.git.repository());
|
||||
println!(
|
||||
"JACK thread {:?}: skip checkout",
|
||||
std::thread::current().id()
|
||||
);
|
||||
return Ok((maybe_db.unwrap(), oid, None));
|
||||
}
|
||||
}
|
||||
|
@ -124,6 +132,10 @@ impl GitSource {
|
|||
|
||||
// Report the checkout operation to the reporter.
|
||||
let task = self.reporter.as_ref().map(|reporter| {
|
||||
println!(
|
||||
"JACK thread {:?}: on checkout start",
|
||||
std::thread::current().id()
|
||||
);
|
||||
reporter.on_checkout_start(git_remote.url(), self.git.reference().as_rev())
|
||||
});
|
||||
|
||||
|
@ -159,6 +171,10 @@ impl GitSource {
|
|||
if let Some(task) = maybe_task {
|
||||
if let Some(reporter) = self.reporter.as_ref() {
|
||||
reporter.on_checkout_complete(remote.as_ref(), actual_rev.as_str(), task);
|
||||
println!(
|
||||
"JACK thread {:?}: on checkout complete",
|
||||
std::thread::current().id()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -320,6 +320,10 @@ pub(crate) async fn resolve<InstalledPackages: InstalledPackagesProvider>(
|
|||
resolver.resolve().await?
|
||||
};
|
||||
|
||||
println!(
|
||||
"JACK thread {:?}: resolution complete",
|
||||
std::thread::current().id()
|
||||
);
|
||||
logger.on_complete(resolution.len(), start, printer)?;
|
||||
|
||||
Ok(resolution)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue