Skip to content

Commit cdfb735

Browse files
authored
Warn less (#3145)
We were accidentally warning on all of the paths to track, where we should only be warning on the _external_ paths to track.
1 parent c06feef commit cdfb735

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

crate_universe/src/cli/generate.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! The cli entrypoint for the `generate` subcommand
22
3+
use std::collections::BTreeSet;
34
use std::fs;
45
use std::path::{Path, PathBuf};
56
use std::sync::Arc;
@@ -233,14 +234,18 @@ fn write_paths_to_track<
233234
source_annotations: SourceAnnotations,
234235
unused_patches: UnusedPatches,
235236
) -> Result<()> {
236-
let paths_to_track: std::collections::BTreeSet<_> = source_annotations
237+
let source_annotation_manifests: BTreeSet<_> = source_annotations
237238
.filter_map(|v| {
238239
if let SourceAnnotation::Path { path } = v {
239240
Some(path.join("Cargo.toml"))
240241
} else {
241242
None
242243
}
243244
})
245+
.collect();
246+
let paths_to_track: BTreeSet<_> = source_annotation_manifests
247+
.iter()
248+
.cloned()
244249
.chain(manifests)
245250
.collect();
246251
std::fs::write(
@@ -250,8 +255,8 @@ fn write_paths_to_track<
250255
.context("Failed to write paths to track")?;
251256

252257
let mut warnings = Vec::new();
253-
for path_to_track in &paths_to_track {
254-
warnings.push(format!("Build is not hermetic - path dependency pulling in crate at {path_to_track} is being used."));
258+
for source_annotation_manifest in &source_annotation_manifests {
259+
warnings.push(format!("Build is not hermetic - path dependency pulling in crate at {source_annotation_manifest} is being used."));
255260
}
256261
for unused_patch in unused_patches {
257262
warnings.push(format!("You have a [patch] Cargo.toml entry that is being ignored by cargo. Unused patch: {} {}{}", unused_patch.name, unused_patch.version, if let Some(source) = unused_patch.source.as_ref() { format!(" ({})", source) } else { String::new() }));

0 commit comments

Comments
 (0)