guppy-summaries
Facilities to serialize, deserialize and compare build summaries.
A build summary is a record of what packages and features are built on the target and host platforms. A summary file can be checked into a repository, kept up to date and compared in CI, and allow for tracking results of builds over time.
guppy-summaries
is designed to be small and independent of the main guppy
crate.
Examples
use ;
use assert_eq;
use Version;
use BTreeSet;
use Value;
// A summary is a TOML file that has this format:
static SUMMARY: &str = r#"
[[target-package]]
name = "foo"
version = "1.2.3"
workspace-path = "foo"
status = 'initial'
features = ["feature-a", "feature-c"]
[[host-package]]
name = "proc-macro"
version = "0.1.2"
workspace-path = "proc-macros/macro"
status = 'workspace'
features = ["macro-expand"]
[[host-package]]
name = "bar"
version = "0.4.5"
crates-io = true
status = 'direct'
features = []
"#;
// The summary can be deserialized:
let summary = parse.expect;
// ... and a package and its features can be looked up.
let summary_id = new;
let info = &summary.target_packages;
assert_eq!;
assert_eq!;
// Another summary.
static SUMMARY2: &str = r#"
[[target-package]]
name = "foo"
version = "1.2.4"
workspace-path = "new-location/foo"
status = 'initial'
features = ["feature-a", "feature-b"]
[[target-package]]
name = "once_cell"
version = "1.4.0"
source = "git+https://github.com/matklad/once_cell?tag=v1.4.0"
status = 'transitive'
features = ["std"]
[[host-package]]
name = "bar"
version = "0.4.5"
crates-io = true
status = 'direct'
features = []
"#;
let summary2 = parse.expect;
// Diff summary and summary2.
let diff = summary.diff;
// Pretty-print a report generated from the diff.
let diff_str = format!;
assert_eq!;
Contributing
See the CONTRIBUTING file for how to help out.
License
This project is available under the terms of either the Apache 2.0 license or the MIT license.