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

"There are too many unrelated apps" message can be repetitive #1547

Closed
duckinator opened this issue Nov 11, 2024 · 1 comment
Closed

"There are too many unrelated apps" message can be repetitive #1547

duckinator opened this issue Nov 11, 2024 · 1 comment

Comments

@duckinator
Copy link
Contributor

cargo_dist::announce::tag_help() has a loop of for &pkg_id in packages { ... } that is sometimes very redundant.

My suspicion is it's printing each target for each platform, or something along those lines. Not verified that yet, though.

Relevant code:

for (version, packages) in &versions {
write!(help, "--tag=v{version} will Announce: ").unwrap();
let mut multi_package = false;
for &pkg_id in packages {
let info = graph.workspaces.package(pkg_id);
if multi_package {
write!(help, ", ").unwrap();
} else {
multi_package = true;
}
write!(help, "{}", info.name).unwrap();
}
writeln!(help).unwrap();
}

Example in the wild:
image

Potential solution:

Instead of printing everything immediately, put the names into a HashSet and print the contents of that. That way each name is guaranteed to only be printed once.

@duckinator
Copy link
Contributor Author

Closing in favor of #1550, which includes the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant