diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index 30445b8643f..7ccc6fc1ea1 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -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, @@ -372,6 +373,7 @@ fn local_deps(packages: impl Iterator) -> LocalDependenc } /// Performs pre-archiving checks and builds a list of files to archive. +#[tracing::instrument(skip_all)] fn prepare_archive( ws: &Workspace<'_>, pkg: &Package, @@ -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, @@ -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], @@ -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<'_>, @@ -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() diff --git a/src/cargo/sources/path.rs b/src/cargo/sources/path.rs index 1d4a533a3c4..7765906977f 100644 --- a/src/cargo/sources/path.rs +++ b/src/cargo/sources/path.rs @@ -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> { list_files(pkg, self.gctx) }