Skip to content

Commit 22de970

Browse files
authored
Update publisher (#3110)
## Motivation and Context The publisher failed because a dependency was yanked. Update to use newer version of dep & support workspace-level settings in the future. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 53dcff3 commit 22de970

File tree

3 files changed

+89
-14
lines changed

3 files changed

+89
-14
lines changed

tools/ci-build/publisher/Cargo.lock

Lines changed: 83 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/ci-build/publisher/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ opt-level = 0
1717
anyhow = "1.0"
1818
async-recursion = "0.3.2"
1919
async-trait = "0.1.51"
20-
cargo_toml = "0.10.1"
20+
cargo_toml = "0.16.3"
2121
clap = { version = "~3.1.18", features = ["derive"] }
2222
crates_io_api = "0.7.3"
2323
dialoguer = "0.8"

tools/ci-build/publisher/src/package.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ fn read_dependencies<P: ParseIntoVersion>(
289289
result.push(PackageHandle::new(name, version));
290290
}
291291
}
292+
Dependency::Inherited(_) => panic!("workspace deps are unsupported"),
292293
}
293294
}
294295
Ok(result)
@@ -299,13 +300,14 @@ fn read_package<P: ParseIntoVersion>(
299300
path: &Path,
300301
manifest_bytes: &[u8],
301302
) -> Result<Option<Package>> {
302-
let manifest = Manifest::from_slice(manifest_bytes)
303+
let mut manifest = Manifest::from_slice(manifest_bytes)
303304
.with_context(|| format!("failed to load package manifest for {:?}", path))?;
305+
manifest.complete_from_path(path)?;
304306
if let Some(package) = manifest.package {
305307
let name = package.name;
306-
let version = parse_version::<P>(path, &package.version)?;
308+
let version = parse_version::<P>(path, &package.version.unwrap())?;
307309
let handle = PackageHandle::new(name, version);
308-
let publish = match package.publish {
310+
let publish = match package.publish.unwrap() {
309311
cargo_toml::Publish::Flag(true) => Publish::Allowed,
310312
_ => Publish::NotAllowed,
311313
};

0 commit comments

Comments
 (0)