mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Auto merge of #13545 - epage:trace, r=weihanglo
fix(cli): Add traces to clarify where time is going In looking at the traces, I had a couple of questions of where the time is going, like - Why does writing a package file take so long - How much of manifest parsing is TOML parsing vs target discovery vs other stuff This adds traces to help answer those.
This commit is contained in:
commit
b1b52aafe6
@ -637,6 +637,7 @@ impl<'de> de::Deserialize<'de> for EncodablePackageId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ser::Serialize for Resolve {
|
impl ser::Serialize for Resolve {
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
|
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
|
||||||
where
|
where
|
||||||
S: ser::Serializer,
|
S: ser::Serializer,
|
||||||
|
@ -31,6 +31,7 @@ struct Inner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Summary {
|
impl Summary {
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
pkg_id: PackageId,
|
pkg_id: PackageId,
|
||||||
dependencies: Vec<Dependency>,
|
dependencies: Vec<Dependency>,
|
||||||
|
@ -112,6 +112,7 @@ fn resolve_to_string_orig(
|
|||||||
(orig.ok(), out, lock_root)
|
(orig.ok(), out, lock_root)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
fn serialize_resolve(resolve: &Resolve, orig: Option<&str>) -> String {
|
fn serialize_resolve(resolve: &Resolve, orig: Option<&str>) -> String {
|
||||||
let toml = toml::Table::try_from(resolve).unwrap();
|
let toml = toml::Table::try_from(resolve).unwrap();
|
||||||
|
|
||||||
@ -194,6 +195,7 @@ fn serialize_resolve(resolve: &Resolve, orig: Option<&str>) -> String {
|
|||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
fn are_equal_lockfiles(orig: &str, current: &str, ws: &Workspace<'_>) -> bool {
|
fn are_equal_lockfiles(orig: &str, current: &str, ws: &Workspace<'_>) -> bool {
|
||||||
// If we want to try and avoid updating the lock file, parse both and
|
// If we want to try and avoid updating the lock file, parse both and
|
||||||
// compare them; since this is somewhat expensive, don't do it in the
|
// compare them; since this is somewhat expensive, don't do it in the
|
||||||
|
@ -424,6 +424,7 @@ pub fn prepare_for_publish(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
pub fn to_real_manifest(
|
pub fn to_real_manifest(
|
||||||
me: manifest::TomlManifest,
|
me: manifest::TomlManifest,
|
||||||
embedded: bool,
|
embedded: bool,
|
||||||
@ -723,6 +724,7 @@ pub fn to_real_manifest(
|
|||||||
root: package_root,
|
root: package_root,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[tracing::instrument(skip(manifest_ctx, new_deps, workspace_config, inherit_cell))]
|
||||||
fn process_dependencies(
|
fn process_dependencies(
|
||||||
manifest_ctx: &mut ManifestContext<'_, '_>,
|
manifest_ctx: &mut ManifestContext<'_, '_>,
|
||||||
new_deps: Option<&BTreeMap<manifest::PackageName, manifest::InheritableDependency>>,
|
new_deps: Option<&BTreeMap<manifest::PackageName, manifest::InheritableDependency>>,
|
||||||
@ -1531,6 +1533,7 @@ fn default_readme_from_package_root(package_root: &Path) -> Option<String> {
|
|||||||
|
|
||||||
/// Checks a list of build targets, and ensures the target names are unique within a vector.
|
/// Checks a list of build targets, and ensures the target names are unique within a vector.
|
||||||
/// If not, the name of the offending build target is returned.
|
/// If not, the name of the offending build target is returned.
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
fn unique_build_targets(
|
fn unique_build_targets(
|
||||||
targets: &[Target],
|
targets: &[Target],
|
||||||
package_root: &Path,
|
package_root: &Path,
|
||||||
|
@ -32,6 +32,7 @@ const DEFAULT_BENCH_DIR_NAME: &'static str = "benches";
|
|||||||
const DEFAULT_EXAMPLE_DIR_NAME: &'static str = "examples";
|
const DEFAULT_EXAMPLE_DIR_NAME: &'static str = "examples";
|
||||||
const DEFAULT_BIN_DIR_NAME: &'static str = "bin";
|
const DEFAULT_BIN_DIR_NAME: &'static str = "bin";
|
||||||
|
|
||||||
|
#[tracing::instrument(skip_all)]
|
||||||
pub(super) fn targets(
|
pub(super) fn targets(
|
||||||
features: &Features,
|
features: &Features,
|
||||||
manifest: &TomlManifest,
|
manifest: &TomlManifest,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user