mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 19:22:33 +00:00
Fix a serialization error on publish
In TOML we have to emit all keys before we emit all sub-tables, so to handle that for dependencies just transform everything to an elaborated version. Closes #4081
This commit is contained in:
parent
483e0ab0e6
commit
d1e70e49b3
|
@ -656,7 +656,10 @@ impl TomlManifest {
|
||||||
TomlDependency::Detailed(d)
|
TomlDependency::Detailed(d)
|
||||||
}
|
}
|
||||||
TomlDependency::Simple(ref s) => {
|
TomlDependency::Simple(ref s) => {
|
||||||
TomlDependency::Simple(s.clone())
|
TomlDependency::Detailed(DetailedTomlDependency {
|
||||||
|
version: Some(s.clone()),
|
||||||
|
..Default::default()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use cargotest::{cargo_process, process};
|
use cargotest::{cargo_process, process};
|
||||||
use cargotest::support::{project, execs, paths, git, path2url, cargo_exe};
|
use cargotest::support::{project, execs, paths, git, path2url, cargo_exe};
|
||||||
|
use cargotest::support::registry::Package;
|
||||||
use flate2::read::GzDecoder;
|
use flate2::read::GzDecoder;
|
||||||
use hamcrest::{assert_that, existing_file, contains, equal_to};
|
use hamcrest::{assert_that, existing_file, contains, equal_to};
|
||||||
use tar::Archive;
|
use tar::Archive;
|
||||||
|
@ -663,6 +664,7 @@ fn ignore_workspace_specifier() {
|
||||||
[project]
|
[project]
|
||||||
name = "foo"
|
name = "foo"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
|
|
||||||
authors = []
|
authors = []
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
@ -714,3 +716,24 @@ version = "0.1.0"
|
||||||
authors = []
|
authors = []
|
||||||
"#));
|
"#));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn package_two_kinds_of_deps() {
|
||||||
|
Package::new("other", "1.0.0").publish();
|
||||||
|
Package::new("other1", "1.0.0").publish();
|
||||||
|
let p = project("foo")
|
||||||
|
.file("Cargo.toml", r#"
|
||||||
|
[project]
|
||||||
|
name = "foo"
|
||||||
|
version = "0.0.1"
|
||||||
|
authors = []
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
other = "1.0"
|
||||||
|
other1 = { version = "1.0" }
|
||||||
|
"#)
|
||||||
|
.file("src/main.rs", "");
|
||||||
|
|
||||||
|
assert_that(p.cargo_process("package").arg("--no-verify"),
|
||||||
|
execs().with_status(0));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue