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

Forward cargo package --list warnings #2186

Merged
merged 1 commit into from
Aug 21, 2024
Merged
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: 7 additions & 1 deletion src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use ignore::overrides::Override;
use normpath::PathExt as _;
use path_slash::PathExt as _;
use std::collections::HashMap;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::str;
Expand Down Expand Up @@ -153,8 +154,9 @@ fn add_crate_to_source_distribution(
skip_cargo_toml: bool,
) -> Result<()> {
let manifest_path = manifest_path.as_ref();
let args = ["package", "--list", "--allow-dirty", "--manifest-path"];
let output = Command::new("cargo")
.args(["package", "--list", "--allow-dirty", "--manifest-path"])
.args(args)
.arg(manifest_path)
.output()
.with_context(|| {
Expand All @@ -172,6 +174,10 @@ fn add_crate_to_source_distribution(
String::from_utf8_lossy(&output.stderr),
);
}
if !output.stderr.is_empty() {
eprintln!("From `cargo {}`:", args.join(" "));
std::io::stderr().write_all(&output.stderr)?;
}

let file_list: Vec<&Path> = str::from_utf8(&output.stdout)
.context("Cargo printed invalid utf-8 ಠ_ಠ")?
Expand Down
Loading