Skip to content

Commit

Permalink
codegen: Improve handling of broken versions
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Mar 2, 2024
1 parent 2e3ebeb commit 41e81ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions manifests/cargo-rdme.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions tools/codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn main() -> Result<()> {
}
releases.append(&mut r);
}
let mut releases: BTreeMap<_, _> = releases
let releases: BTreeMap<_, _> = releases
.iter()
.filter_map(|release| {
if release.prerelease {
Expand All @@ -78,9 +78,6 @@ fn main() -> Result<()> {
Some((Reverse(semver_version.ok()?), (version, release)))
})
.collect();
for broken in &base_info.broken {
releases.remove(&Reverse(broken.clone()));
}

let mut crates_io_info = None;
base_info.rust_crate = base_info
Expand Down Expand Up @@ -377,6 +374,9 @@ fn main() -> Result<()> {
}
}
}
if base_info.broken.contains(version) {
continue;
}
if !(version.major == 0 && version.minor == 0) {
manifests.map.insert(
Reverse(Version::omitted(version.major, Some(version.minor))),
Expand Down Expand Up @@ -417,7 +417,8 @@ fn main() -> Result<()> {
{
bail!(
"platform list in base manifest for {package} contains {p:?}, \
but result manifest doesn't contain it"
but result manifest doesn't contain it; \
consider removing {p:?} from platform list in base manifest"
);
}
if latest_manifest.download_info.contains_key(&p) {
Expand All @@ -435,7 +436,8 @@ fn main() -> Result<()> {
}
bail!(
"platform list in base manifest for {package} contains {p:?}, \
but latest release ({latest_version}) doesn't contain it"
but latest release ({latest_version}) doesn't contain it; \
consider marking {latest_version} as broken by adding 'broken' field to base manifest"
);
}

Expand Down

0 comments on commit 41e81ec

Please sign in to comment.