Change verification order during packaging.

Once we support packaging workspaces with dependencies, dependency
packages need to be built before anything is verified. In addition to a
little refactoring, this commit reorders the console messages so that
package metadata (archive size, etc.) is reported before verification
results.

Co-Authored-By: Tor Hovland <55164+torhovland@users.noreply.github.com>
This commit is contained in:
Joe Neeman 2024-06-13 12:57:18 -05:00
parent 4dcbca118a
commit c0287bec8d
13 changed files with 211 additions and 193 deletions

View File

@ -28,6 +28,7 @@ use tar::{Archive, Builder, EntryType, Header, HeaderMode};
use tracing::debug;
use unicase::Ascii as UncasedAscii;
#[derive(Clone)]
pub struct PackageOpts<'gctx> {
pub gctx: &'gctx GlobalContext,
pub list: bool,
@ -82,11 +83,142 @@ struct GitVcsInfo {
sha1: String,
}
/// Packages a single package in a workspace, returning the resulting tar file.
///
/// # Panics
/// Panics if `opts.list` is true. In that case you probably don't want to
/// actually build the package tarball; you should just make and print the list
/// of files. (We don't currently provide a public API for that, but see how
/// [`package`] does it.)
pub fn package_one(
ws: &Workspace<'_>,
pkg: &Package,
opts: &PackageOpts<'_>,
) -> CargoResult<Option<FileLock>> {
) -> CargoResult<FileLock> {
assert!(!opts.list);
let ar_files = prepare_archive(ws, pkg, opts)?;
let tarball = create_package(ws, pkg, ar_files)?;
if opts.verify {
run_verify(ws, pkg, &tarball, opts)?;
}
Ok(tarball)
}
// Builds a tarball and places it in the output directory.
fn create_package(
ws: &Workspace<'_>,
pkg: &Package,
ar_files: Vec<ArchiveFile>,
) -> CargoResult<FileLock> {
let gctx = ws.gctx();
let filecount = ar_files.len();
// Check that the package dependencies are safe to deploy.
for dep in pkg.dependencies() {
super::check_dep_has_version(dep, false)?;
}
let filename = pkg.package_id().tarball_name();
let dir = ws.target_dir().join("package");
let mut dst = {
let tmp = format!(".{}", filename);
dir.open_rw_exclusive_create(&tmp, gctx, "package scratch space")?
};
// Package up and test a temporary tarball and only move it to the final
// location if it actually passes all our tests. Any previously existing
// tarball can be assumed as corrupt or invalid, so we just blow it away if
// it exists.
gctx.shell()
.status("Packaging", pkg.package_id().to_string())?;
dst.file().set_len(0)?;
let uncompressed_size = tar(ws, pkg, ar_files, dst.file(), &filename)
.with_context(|| "failed to prepare local package for uploading")?;
dst.seek(SeekFrom::Start(0))?;
let src_path = dst.path();
let dst_path = dst.parent().join(&filename);
fs::rename(&src_path, &dst_path)
.with_context(|| "failed to move temporary tarball into final location")?;
let dst_metadata = dst
.file()
.metadata()
.with_context(|| format!("could not learn metadata for: `{}`", dst_path.display()))?;
let compressed_size = dst_metadata.len();
let uncompressed = human_readable_bytes(uncompressed_size);
let compressed = human_readable_bytes(compressed_size);
let message = format!(
"{} files, {:.1}{} ({:.1}{} compressed)",
filecount, uncompressed.0, uncompressed.1, compressed.0, compressed.1,
);
// It doesn't really matter if this fails.
drop(gctx.shell().status("Packaged", message));
return Ok(dst);
}
pub fn package(ws: &Workspace<'_>, opts: &PackageOpts<'_>) -> CargoResult<Option<Vec<FileLock>>> {
let specs = &opts.to_package.to_package_id_specs(ws)?;
// If -p is used, we should check spec is matched with the members (See #13719)
if let ops::Packages::Packages(_) = opts.to_package {
for spec in specs.iter() {
let member_ids = ws.members().map(|p| p.package_id());
spec.query(member_ids)?;
}
}
let pkgs = ws.members_with_features(specs, &opts.cli_features)?;
let mut dsts = Vec::with_capacity(pkgs.len());
if ws.root().join("Cargo.lock").exists() {
// Make sure the Cargo.lock is up-to-date and valid.
let dry_run = false;
let _ = ops::resolve_ws(ws, dry_run)?;
// If Cargo.lock does not exist, it will be generated by `build_lock`
// below, and will be validated during the verification step.
}
for (pkg, cli_features) in pkgs {
let opts = PackageOpts {
to_package: ops::Packages::Default,
cli_features,
..opts.clone()
};
let ar_files = prepare_archive(ws, pkg, &opts)?;
if opts.list {
for ar_file in ar_files {
drop_println!(ws.gctx(), "{}", ar_file.rel_str);
}
} else {
let tarball = create_package(ws, pkg, ar_files)?;
if opts.verify {
run_verify(ws, pkg, &tarball, &opts)
.with_context(|| "failed to verify package tarball")?;
}
dsts.push(tarball);
}
}
if opts.list {
// We're just listing, so there's no file output
Ok(None)
} else {
Ok(Some(dsts))
}
}
/// Performs pre-archiving checks and builds a list of files to archive.
fn prepare_archive(
ws: &Workspace<'_>,
pkg: &Package,
opts: &PackageOpts<'_>,
) -> CargoResult<Vec<ArchiveFile>> {
let gctx = ws.gctx();
let mut src = PathSource::new(pkg.root(), pkg.package_id().source_id(), gctx);
src.update()?;
@ -112,119 +244,7 @@ pub fn package_one(
None
};
let ar_files = build_ar_list(ws, pkg, src_files, vcs_info)?;
let filecount = ar_files.len();
if opts.list {
for ar_file in ar_files {
drop_println!(gctx, "{}", ar_file.rel_str);
}
return Ok(None);
}
// Check that the package dependencies are safe to deploy.
for dep in pkg.dependencies() {
super::check_dep_has_version(dep, false)?;
}
let filename = pkg.package_id().tarball_name();
let dir = ws.target_dir().join("package");
let mut dst = {
let tmp = format!(".{}", filename);
dir.open_rw_exclusive_create(&tmp, gctx, "package scratch space")?
};
// Package up and test a temporary tarball and only move it to the final
// location if it actually passes all our tests. Any previously existing
// tarball can be assumed as corrupt or invalid, so we just blow it away if
// it exists.
gctx.shell()
.status("Packaging", pkg.package_id().to_string())?;
dst.file().set_len(0)?;
let uncompressed_size = tar(ws, pkg, ar_files, dst.file(), &filename)
.with_context(|| "failed to prepare local package for uploading")?;
if opts.verify {
dst.seek(SeekFrom::Start(0))?;
run_verify(ws, pkg, &dst, opts).with_context(|| "failed to verify package tarball")?
}
dst.seek(SeekFrom::Start(0))?;
let src_path = dst.path();
let dst_path = dst.parent().join(&filename);
fs::rename(&src_path, &dst_path)
.with_context(|| "failed to move temporary tarball into final location")?;
let dst_metadata = dst
.file()
.metadata()
.with_context(|| format!("could not learn metadata for: `{}`", dst_path.display()))?;
let compressed_size = dst_metadata.len();
let uncompressed = human_readable_bytes(uncompressed_size);
let compressed = human_readable_bytes(compressed_size);
let message = format!(
"{} files, {:.1}{} ({:.1}{} compressed)",
filecount, uncompressed.0, uncompressed.1, compressed.0, compressed.1,
);
// It doesn't really matter if this fails.
drop(gctx.shell().status("Packaged", message));
return Ok(Some(dst));
}
pub fn package(ws: &Workspace<'_>, opts: &PackageOpts<'_>) -> CargoResult<Option<Vec<FileLock>>> {
let specs = &opts.to_package.to_package_id_specs(ws)?;
// If -p is used, we should check spec is matched with the members (See #13719)
if let ops::Packages::Packages(_) = opts.to_package {
for spec in specs.iter() {
let member_ids = ws.members().map(|p| p.package_id());
spec.query(member_ids)?;
}
}
let pkgs = ws.members_with_features(specs, &opts.cli_features)?;
let mut dsts = Vec::with_capacity(pkgs.len());
if ws.root().join("Cargo.lock").exists() {
// Make sure the Cargo.lock is up-to-date and valid.
let dry_run = false;
let _ = ops::resolve_ws(ws, dry_run)?;
// If Cargo.lock does not exist, it will be generated by `build_lock`
// below, and will be validated during the verification step.
}
for (pkg, cli_features) in pkgs {
let result = package_one(
ws,
pkg,
&PackageOpts {
gctx: opts.gctx,
list: opts.list,
check_metadata: opts.check_metadata,
allow_dirty: opts.allow_dirty,
verify: opts.verify,
jobs: opts.jobs.clone(),
keep_going: opts.keep_going,
to_package: ops::Packages::Default,
targets: opts.targets.clone(),
cli_features: cli_features,
},
)?;
if !opts.list {
dsts.push(result.unwrap());
}
}
if opts.list {
// We're just listing, so there's no file output
Ok(None)
} else {
Ok(Some(dsts))
}
build_ar_list(ws, pkg, src_files, vcs_info)
}
/// Builds list of files to archive.
@ -236,7 +256,6 @@ fn build_ar_list(
) -> CargoResult<Vec<ArchiveFile>> {
let mut result = HashMap::new();
let root = pkg.root();
for src_file in &src_files {
let rel_path = src_file.strip_prefix(&root)?;
check_filename(rel_path, &mut ws.gctx().shell())?;

View File

@ -156,8 +156,7 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
keep_going: opts.keep_going,
cli_features,
},
)?
.unwrap();
)?;
if !opts.dry_run {
let hash = cargo_util::Sha256::new()

View File

@ -346,13 +346,13 @@ fn publish_with_registry_dependency() {
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
[PACKAGING] foo v0.0.1 ([ROOT]/foo)
[UPDATING] `alternative` index
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[VERIFYING] foo v0.0.1 ([ROOT]/foo)
[DOWNLOADING] crates ...
[DOWNLOADED] bar v0.0.1 (registry `alternative`)
[COMPILING] bar v0.0.1 (registry `alternative`)
[COMPILING] foo v0.0.1 ([ROOT]/foo/target/package/foo-0.0.1)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[UPLOADING] foo v0.0.1 ([ROOT]/foo)
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting for `foo v0.0.1` to be available at registry `alternative`.
@ -512,10 +512,10 @@ fn publish_to_alt_registry() {
[WARNING] manifest has no description, license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
[PACKAGING] foo v0.0.1 ([ROOT]/foo)
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[VERIFYING] foo v0.0.1 ([ROOT]/foo)
[COMPILING] foo v0.0.1 ([ROOT]/foo/target/package/foo-0.0.1)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[UPLOADING] foo v0.0.1 ([ROOT]/foo)
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting for `foo v0.0.1` to be available at registry `alternative`.
@ -591,13 +591,13 @@ fn publish_with_crates_io_dep() {
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
[PACKAGING] foo v0.0.1 ([ROOT]/foo)
[UPDATING] `dummy-registry` index
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[VERIFYING] foo v0.0.1 ([ROOT]/foo)
[DOWNLOADING] crates ...
[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`)
[COMPILING] bar v0.0.1
[COMPILING] foo v0.0.1 ([ROOT]/foo/target/package/foo-0.0.1)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[UPLOADING] foo v0.0.1 ([ROOT]/foo)
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting for `foo v0.0.1` to be available at registry `alternative`.

View File

@ -664,10 +664,10 @@ fn publish_allowed() {
[WARNING] [..]
[..]
[PACKAGING] a v0.0.1 [..]
[PACKAGED] [..]
[VERIFYING] a v0.0.1 [..]
[COMPILING] a v0.0.1 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] a v0.0.1 [..]
[UPLOADED] a v0.0.1 to registry `crates-io`
[NOTE] waiting for `a v0.0.1` to be available at registry `crates-io`.

View File

@ -46,10 +46,10 @@ fn simple_cross_package() {
.with_stderr(
"\
[PACKAGING] foo v0.0.0 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.0 ([CWD])
[COMPILING] foo v0.0.0 ([CWD]/target/package/foo-0.0.0)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -111,10 +111,10 @@ fn publish_with_target() {
"\
[UPDATING] crates.io index
[PACKAGING] foo v0.0.0 ([CWD])
[PACKAGED] [..]
[VERIFYING] foo v0.0.0 ([CWD])
[COMPILING] foo v0.0.0 ([CWD]/target/package/foo-0.0.0)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..]
[UPLOADING] foo v0.0.0 ([CWD])
[UPLOADED] foo v0.0.0 to registry `crates-io`
[NOTE] waiting [..]

View File

@ -1055,11 +1055,11 @@ fn publish() {
"\
[UPDATING] [..]
[PACKAGING] foo v0.1.0 [..]
[PACKAGED] [..]
[VERIFYING] foo v0.1.0 [..]
[UPDATING] [..]
[COMPILING] foo v0.1.0 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] foo v0.1.0 [..]
[UPLOADED] foo v0.1.0 [..]
[NOTE] waiting [..]

View File

@ -164,10 +164,10 @@ fn inherit_own_workspace_fields() {
[UPDATING] [..]
[WARNING] [..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v1.2.3 [..]
[COMPILING] foo v1.2.3 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] foo v1.2.3 [..]
[UPLOADED] foo v1.2.3 to registry `crates-io`
[NOTE] waiting for `foo v1.2.3` to be available at registry `crates-io`.
@ -319,11 +319,11 @@ fn inherit_own_dependencies() {
[..]
[PACKAGING] bar v0.2.0 [..]
[UPDATING] [..]
[PACKAGED] [..]
[VERIFYING] bar v0.2.0 [..]
[COMPILING] dep v0.1.2
[COMPILING] bar v0.2.0 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] bar v0.2.0 [..]
[UPLOADED] bar v0.2.0 to registry `crates-io`
[NOTE] waiting for `bar v0.2.0` to be available at registry `crates-io`.
@ -478,11 +478,11 @@ fn inherit_own_detailed_dependencies() {
[..]
[PACKAGING] bar v0.2.0 [..]
[UPDATING] [..]
[PACKAGED] [..]
[VERIFYING] bar v0.2.0 [..]
[COMPILING] dep v0.1.2
[COMPILING] bar v0.2.0 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] bar v0.2.0 [..]
[UPLOADED] bar v0.2.0 to registry `crates-io`
[NOTE] waiting for `bar v0.2.0` to be available at registry `crates-io`.
@ -726,6 +726,7 @@ fn inherit_workspace_fields() {
[UPDATING] [..]
[WARNING] [..]
[..]
[PACKAGED] [..]
[VERIFYING] bar v1.2.3 [..]
[WARNING] [..]
[..]
@ -733,7 +734,6 @@ fn inherit_workspace_fields() {
[..]
[COMPILING] bar v1.2.3 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] bar v1.2.3 [..]
[UPLOADED] bar v1.2.3 to registry `crates-io`
[NOTE] waiting for `bar v1.2.3` to be available at registry `crates-io`.
@ -892,11 +892,11 @@ fn inherit_dependencies() {
[..]
[PACKAGING] bar v0.2.0 [..]
[UPDATING] [..]
[PACKAGED] [..]
[VERIFYING] bar v0.2.0 [..]
[COMPILING] dep v0.1.2
[COMPILING] bar v0.2.0 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] bar v0.2.0 [..]
[UPLOADED] bar v0.2.0 to registry `crates-io`
[NOTE] waiting for `bar v0.2.0` to be available at registry `crates-io`.

View File

@ -40,10 +40,10 @@ fn simple() {
[WARNING] manifest has no documentation[..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -64,10 +64,10 @@ src/main.rs
[WARNING] manifest has no documentation[..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -91,10 +91,10 @@ warning: manifest has no description, license, license-file, documentation, \
homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -119,10 +119,10 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
warning: manifest has no description, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -147,10 +147,10 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -260,10 +260,10 @@ fn package_verification() {
[WARNING] manifest has no description[..]
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -740,10 +740,10 @@ fn ignore_nested() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -762,10 +762,10 @@ src/main.rs
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -818,10 +818,10 @@ fn repackage_on_source_change() {
[WARNING] [..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 5 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 5 files, [..] ([..] compressed)
",
)
.run();
@ -2198,10 +2198,10 @@ src/lib.rs
.with_stderr(
"\
[PACKAGING] foo v1.0.0 [..]
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v1.0.0 [..]
[COMPILING] foo v1.0.0 [..]
[FINISHED] [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -2258,10 +2258,10 @@ src/lib.rs
"\
[WARNING] license-file `../LICENSE` appears to be [..]
[PACKAGING] foo v1.0.0 [..]
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v1.0.0 [..]
[COMPILING] foo v1.0.0 [..]
[FINISHED] [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -2306,9 +2306,9 @@ fn package_restricted_windows() {
[WARNING] file src/aux/mod.rs is a reserved Windows filename, it will not work on Windows platforms
[WARNING] file src/con.rs is a reserved Windows filename, it will not work on Windows platforms
[PACKAGING] foo [..]
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo [..]
[COMPILING] foo [..]
[PACKAGED] [..] files, [..] ([..] compressed)
[FINISHED] [..]
",
)
@ -2735,17 +2735,17 @@ fn in_workspace() {
[WARNING] manifest has no documentation, [..]
See [..]
[PACKAGING] bar v0.0.1 ([CWD]/bar)
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] bar v0.0.1 ([CWD]/bar)
[COMPILING] bar v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
[WARNING] manifest has no documentation, [..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -2788,10 +2788,10 @@ fn workspace_noconflict_readme() {
.with_stderr(
"\
[PACKAGING] bar v0.0.1 ([CWD]/bar)
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] bar v0.0.1 ([CWD]/bar)
[COMPILING] bar v0.0.1 ([CWD]/[..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -2832,10 +2832,10 @@ fn workspace_conflict_readme() {
"\
warning: readme `../README.md` appears to be a path outside of the package, but there is already a file named `README.md` in the root of the package. The archived crate will contain the copy in the root of the package. Update the readme to point to the path relative to the root of the package to remove this warning.
[PACKAGING] bar v0.0.1 ([CWD]/bar)
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] bar v0.0.1 ([CWD]/bar)
[COMPILING] bar v0.0.1 ([CWD]/[..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -3034,10 +3034,10 @@ src/main.rs
.with_stderr(
"\
[PACKAGING] foo v0.0.1 [..]
[PACKAGED] 4 files[..]
[VERIFYING] foo v0.0.1 [..]
[COMPILING] foo v0.0.1 [..]
[FINISHED] [..]
[PACKAGED] 4 files[..]
",
)
.run();
@ -3140,10 +3140,10 @@ src/main.rs
.with_stderr(
"\
[PACKAGING] foo v0.0.1 [..]
[PACKAGED] 5 files, [..]
[VERIFYING] foo v0.0.1 [..]
[COMPILING] foo v0.0.1 [..]
[FINISHED] [..]
[PACKAGED] 5 files, [..]
",
)
.run();
@ -3262,10 +3262,10 @@ src/main.rs.bak
.with_stderr(
"\
[PACKAGING] foo v0.0.1 [..]
[PACKAGED] 7 files, [..]
[VERIFYING] foo v0.0.1 [..]
[COMPILING] foo v0.0.1 [..]
[FINISHED] [..]
[PACKAGED] 7 files, [..]
",
)
.run();
@ -3340,10 +3340,10 @@ See [..]
[WARNING] ignoring example `ExampleFoo` as `examples/ExampleFoo.rs` is not included in the published package
[WARNING] ignoring test `ExplicitPath` as `tests/ExplicitPath.rs` is not included in the published package
[WARNING] ignoring test `explicitpath` as `tests/explicitpath.rs` is not included in the published package
[PACKAGED] 8 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 8 files, [..] ([..] compressed)
",
)
.run();
@ -3373,10 +3373,10 @@ See [..]
[WARNING] ignoring example `ExampleFoo` as `examples/ExampleFoo.rs` is not included in the published package
[WARNING] ignoring test `ExplicitPath` as `tests/ExplicitPath.rs` is not included in the published package
[WARNING] ignoring test `explicitpath` as `tests/explicitpath.rs` is not included in the published package
[PACKAGED] 8 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 8 files, [..] ([..] compressed)
",
)
.run();
@ -3450,10 +3450,10 @@ fn mixed_case() {
[WARNING] manifest has no documentation[..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -3474,10 +3474,10 @@ src/main.rs
[WARNING] manifest has no documentation[..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -3511,11 +3511,11 @@ fn versionless_package() {
"\
warning: manifest has no license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
Packaging foo v0.0.0 ([CWD])
Verifying foo v0.0.0 ([CWD])
Compiling foo v0.0.0 ([CWD]/target/package/foo-0.0.0)
Finished `dev` profile [unoptimized + debuginfo] target(s) in [..]s
Packaged 4 files, [..]B ([..]B compressed)
[PACKAGING] foo v0.0.0 ([CWD])
[PACKAGED] 4 files, [..]B ([..]B compressed)
[VERIFYING] foo v0.0.0 ([CWD])
[COMPILING] foo v0.0.0 ([CWD]/target/package/foo-0.0.0)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
",
)
.run();
@ -3777,10 +3777,10 @@ fn normalize_paths() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 11 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 11 files, [..] ([..] compressed)
",
)
.run();
@ -3880,10 +3880,10 @@ fn discovery_inferred_build_rs_included() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -3960,10 +3960,10 @@ fn discovery_inferred_build_rs_excluded() {
"\
[PACKAGING] foo v0.0.1 ([CWD])
[WARNING] ignoring `package.build` as `build.rs` is not included in the published package
[PACKAGED] 3 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 3 files, [..] ([..] compressed)
",
)
.run();
@ -4037,10 +4037,10 @@ fn discovery_explicit_build_rs_included() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -4118,10 +4118,10 @@ fn discovery_explicit_build_rs_excluded() {
"\
[PACKAGING] foo v0.0.1 ([CWD])
[WARNING] ignoring `package.build` as `build.rs` is not included in the published package
[PACKAGED] 3 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 3 files, [..] ([..] compressed)
",
)
.run();
@ -4194,10 +4194,10 @@ fn discovery_inferred_lib_included() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 5 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 5 files, [..] ([..] compressed)
",
)
.run();
@ -4284,10 +4284,10 @@ fn discovery_inferred_lib_excluded() {
"\
[PACKAGING] foo v0.0.1 ([CWD])
[WARNING] ignoring library `foo` as `src/lib.rs` is not included in the published package
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -4363,10 +4363,10 @@ fn discovery_explicit_lib_included() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 5 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 5 files, [..] ([..] compressed)
",
)
.run();
@ -4456,10 +4456,10 @@ fn discovery_explicit_lib_excluded() {
"\
[PACKAGING] foo v0.0.1 ([CWD])
[WARNING] ignoring library `foo` as `src/lib.rs` is not included in the published package
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -4535,10 +4535,10 @@ fn discovery_inferred_other_included() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 8 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 8 files, [..] ([..] compressed)
",
)
.run();
@ -4649,10 +4649,10 @@ fn discovery_inferred_other_excluded() {
[WARNING] ignoring example `example_foo` as `examples/example_foo.rs` is not included in the published package
[WARNING] ignoring test `test_foo` as `tests/test_foo.rs` is not included in the published package
[WARNING] ignoring benchmark `bench_foo` as `benches/bench_foo.rs` is not included in the published package
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -4740,10 +4740,10 @@ fn discovery_explicit_other_included() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 8 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 8 files, [..] ([..] compressed)
",
)
.run();
@ -4866,10 +4866,10 @@ fn discovery_explicit_other_excluded() {
[WARNING] ignoring example `example_foo` as `examples/example_foo.rs` is not included in the published package
[WARNING] ignoring test `test_foo` as `tests/test_foo.rs` is not included in the published package
[WARNING] ignoring benchmark `bench_foo` as `benches/bench_foo.rs` is not included in the published package
[PACKAGED] 4 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..] ([..] compressed)
",
)
.run();
@ -4955,10 +4955,10 @@ fn deterministic_build_targets() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 10 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 10 files, [..] ([..] compressed)
",
)
.run();

View File

@ -511,10 +511,10 @@ fn publish_clean() {
"\
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -561,10 +561,10 @@ fn publish_in_sub_repo() {
"\
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -611,10 +611,10 @@ fn publish_when_ignored() {
"\
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -660,10 +660,10 @@ fn ignore_when_crate_ignored() {
"\
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -740,10 +740,10 @@ fn dry_run() {
[WARNING] manifest has no documentation, [..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
[UPLOADING] foo v0.0.1 ([CWD])
[WARNING] aborting upload due to dry run
",
@ -854,10 +854,10 @@ fn publish_allowed_registry() {
"\
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting for `foo v0.0.1` to be available at registry `alternative`.
@ -916,10 +916,10 @@ fn publish_implicitly_to_only_allowed_registry() {
[NOTE] found `alternative` as only allowed registry. Publishing to it automatically.
[UPDATING] `alternative` index
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `alternative`
[NOTE] waiting [..]
@ -1091,10 +1091,10 @@ The registry `alternative` is not listed in the `package.publish` value in Cargo
[WARNING] [..]
[..]
[PACKAGING] [..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -1143,10 +1143,10 @@ fn publish_with_select_features() {
[..]
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -1195,10 +1195,10 @@ fn publish_with_all_features() {
[..]
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -1301,11 +1301,11 @@ fn publish_with_patch() {
[..]
[..]
[UPDATING] crates.io index
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]
@ -1392,10 +1392,10 @@ fn publish_checks_for_token_before_verify() {
[..]
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 [..]
[WARNING] aborting upload due to dry run
",
@ -2831,10 +2831,10 @@ fn http_api_not_noop() {
[..]
[..]
[..]
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[..]
[..]
[..]
[UPLOADING] foo v0.0.1 ([CWD])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting [..]

View File

@ -78,10 +78,10 @@ fn package_lockfile() {
.with_stderr(
"\
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] [..] files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] [..] files, [..] ([..] compressed)
",
)
.run();
@ -100,10 +100,10 @@ src/main.rs
.with_stderr(
"\
[PACKAGING] foo v0.0.1 [..]
[PACKAGED] 4 files, [..]
[VERIFYING] foo v0.0.1 [..]
[COMPILING] foo v0.0.1 [..]
[FINISHED] [..]
[PACKAGED] 4 files, [..]
",
)
.run();
@ -146,11 +146,11 @@ src/main.rs
[ARCHIVING] Cargo.toml
[ARCHIVING] Cargo.toml.orig
[ARCHIVING] src/main.rs
[PACKAGED] 5 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([..])
[COMPILING] foo v0.0.1 ([..])
[RUNNING] `rustc --crate-name foo --edition=2015 src/main.rs [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 5 files, [..] ([..] compressed)
",
)
.run();
@ -473,11 +473,11 @@ src/main.rs
[ARCHIVING] Cargo.toml
[ARCHIVING] Cargo.toml.orig
[ARCHIVING] src/main.rs
[PACKAGED] 5 files, [..] ([..] compressed)
[VERIFYING] foo v0.0.1 ([..])
[COMPILING] foo v0.0.1 ([..])
[RUNNING] `rustc --crate-name foo --edition=2015 src/main.rs [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 5 files, [..] ([..] compressed)
",
)
.run();
@ -570,21 +570,21 @@ fn use_workspace_root_lockfile() {
See [..]
[PACKAGING] bar v0.0.1 ([CWD]/bar)
[UPDATING] `dummy-registry` index
[PACKAGED] 4 files, [..]
[VERIFYING] bar v0.0.1 ([CWD]/bar)
[DOWNLOADING] crates ...
[DOWNLOADED] serde v0.2.0 ([..])
[COMPILING] serde v0.2.0
[COMPILING] bar v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..]
[WARNING] manifest has no documentation, [..]
See [..]
[PACKAGING] foo v0.0.1 ([CWD])
[PACKAGED] 4 files, [..]
[VERIFYING] foo v0.0.1 ([CWD])
[COMPILING] serde v0.2.0
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]
[PACKAGED] 4 files, [..]
",
)
.run();

View File

@ -506,13 +506,13 @@ Caused by:
"\
[PACKAGING] foo v0.0.1 ([CWD])
[UPDATING] `[..]` index
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([CWD])
[DOWNLOADING] crates ...
[DOWNLOADED] notyet v0.0.1 (registry `dummy-registry`)
[COMPILING] notyet v0.0.1
[COMPILING] foo v0.0.1 ([CWD][..])
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [..]s
[PACKAGED] [..]
",
)
.run();

View File

@ -215,6 +215,7 @@ fn publish_with_replacement() {
[WARNING] manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
[PACKAGING] foo v0.0.1 ([..])
[PACKAGED] [..]
[VERIFYING] foo v0.0.1 ([..])
[UPDATING] `alternative` index
[DOWNLOADING] crates ...
@ -222,7 +223,6 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[COMPILING] bar v1.0.0
[COMPILING] foo v0.0.1 ([..]foo-0.0.1)
[FINISHED] `dev` profile [..]
[PACKAGED] [..]
[UPLOADING] foo v0.0.1 ([..])
[UPLOADED] foo v0.0.1 to registry `crates-io`
[NOTE] waiting for `foo v0.0.1` to be available at registry `crates-io`.

View File

@ -573,11 +573,11 @@ fn publish() {
"\
[UPDATING] [..]
[PACKAGING] foo v0.1.0 [..]
[PACKAGED] [..]
[VERIFYING] foo v0.1.0 [..]
[UPDATING] [..]
[COMPILING] foo v0.1.0 [..]
[FINISHED] [..]
[PACKAGED] [..]
[UPLOADING] foo v0.1.0 [..]
[UPLOADED] foo v0.1.0 to registry `crates-io`
[NOTE] waiting for `foo v0.1.0` to be available at registry `crates-io`.