Skip to content
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

fix(cargo-package): add more traces #14960

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions src/cargo/ops/cargo_package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ struct GitVcsInfo {
}

// Builds a tarball and places it in the output directory.
#[tracing::instrument(skip_all)]
fn create_package(
ws: &Workspace<'_>,
pkg: &Package,
Expand Down Expand Up @@ -372,6 +373,7 @@ fn local_deps<T>(packages: impl Iterator<Item = (Package, T)>) -> LocalDependenc
}

/// Performs pre-archiving checks and builds a list of files to archive.
#[tracing::instrument(skip_all)]
fn prepare_archive(
ws: &Workspace<'_>,
pkg: &Package,
Expand Down Expand Up @@ -400,6 +402,7 @@ fn prepare_archive(
}

/// Builds list of files to archive.
#[tracing::instrument(skip_all)]
fn build_ar_list(
ws: &Workspace<'_>,
pkg: &Package,
Expand Down Expand Up @@ -730,6 +733,7 @@ fn check_metadata(pkg: &Package, gctx: &GlobalContext) -> CargoResult<()> {
/// has not been passed, then `bail!` with an informative message. Otherwise
/// return the sha1 hash of the current *HEAD* commit, or `None` if no repo is
/// found.
#[tracing::instrument(skip_all)]
fn check_repo_state(
p: &Package,
src_files: &[PathBuf],
Expand Down Expand Up @@ -780,7 +784,7 @@ fn check_repo_state(
return Ok(None);

fn git(
p: &Package,
pkg: &Package,
src_files: &[PathBuf],
repo: &git2::Repository,
opts: &PackageOpts<'_>,
Expand All @@ -803,7 +807,7 @@ fn check_repo_state(
.iter()
.filter(|src_file| dirty_files.iter().any(|path| src_file.starts_with(path)))
.map(|path| {
path.strip_prefix(p.root())
path.strip_prefix(pkg.root())
.unwrap_or(path)
.display()
.to_string()
Expand Down
1 change: 1 addition & 0 deletions src/cargo/sources/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ impl<'gctx> PathSource<'gctx> {
/// are relevant for building this package, but it also contains logic to
/// use other methods like `.gitignore`, `package.include`, or
/// `package.exclude` to filter the list of files.
#[tracing::instrument(skip_all)]
pub fn list_files(&self, pkg: &Package) -> CargoResult<Vec<PathBuf>> {
list_files(pkg, self.gctx)
}
Expand Down
Loading