├── .ignore ├── clippy.toml ├── .gitignore ├── workspace-hack ├── src │ └── lib.rs ├── build.rs ├── .gitattributes └── README.md ├── fixtures ├── workspace │ └── inside-outside │ │ ├── workspace │ │ ├── .gitignore │ │ ├── main │ │ │ ├── build.rs │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ └── Cargo.toml │ │ ├── internal-macro │ │ │ ├── build.rs │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ └── Cargo.toml │ │ ├── src │ │ │ └── lib.rs │ │ ├── side │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ └── Cargo.toml │ │ ├── internal │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ └── Cargo.toml │ │ └── Cargo.toml │ │ ├── external │ │ ├── .gitignore │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ │ ├── inactive │ │ ├── .gitignore │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ │ ├── transitive │ │ ├── .gitignore │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ │ ├── x86-active │ │ ├── .gitignore │ │ ├── src │ │ │ └── lib.rs │ │ └── Cargo.toml │ │ └── aarch64-active │ │ ├── .gitignore │ │ ├── src │ │ └── lib.rs │ │ └── Cargo.toml ├── determinator-paths │ ├── git-diff.out │ └── README.md ├── Cargo.toml ├── src │ └── lib.rs ├── guppy │ ├── package-rules.toml │ ├── hakari │ │ ├── metadata_guppy_44b62fa-2.toml │ │ ├── metadata_guppy_44b62fa-3.toml │ │ └── metadata_guppy_44b62fa-0.toml │ ├── summaries │ │ ├── metadata_guppy_44b62fa-3.toml │ │ ├── metadata_guppy_44b62fa-5.toml │ │ ├── metadata_guppy_44b62fa-4.toml │ │ ├── metadata_guppy_44b62fa-6.toml │ │ └── metadata_guppy_44b62fa-2.toml │ └── path-rules.toml ├── small │ ├── hakari │ │ ├── metadata_build_targets1-2.toml │ │ ├── metadata_build_targets1-1.toml │ │ ├── metadata_cycle2-1.toml │ │ ├── metadata_cycle_features-3.toml │ │ ├── metadata_cycle2-2.toml │ │ ├── metadata1-0.toml │ │ ├── metadata_build_targets1-0.toml │ │ ├── metadata_cycle1-2.toml │ │ ├── metadata_build_targets1-3.toml │ │ ├── metadata_cycle1-3.toml │ │ ├── metadata_targets1-3.toml │ │ ├── metadata_builddep-2.toml │ │ ├── metadata_builddep-1.toml │ │ ├── metadata_cycle_features-0.toml │ │ ├── metadata_builddep-3.toml │ │ ├── metadata_cycle_features-2.toml │ │ ├── metadata_cycle1-1.toml │ │ ├── metadata_dups-1.toml │ │ ├── metadata_weak_namespaced_features-1.toml │ │ ├── metadata_cycle1-0.toml │ │ ├── metadata_weak_namespaced_features-2.toml │ │ ├── metadata_builddep-0.toml │ │ ├── metadata_targets1-2.toml │ │ ├── metadata_proc_macro1-1.toml │ │ ├── metadata_cycle_features-1.toml │ │ ├── metadata_proc_macro1-0.toml │ │ ├── metadata_weak_namespaced_features-3.toml │ │ ├── metadata_dups-3.toml │ │ ├── metadata_alternate_registries-0.toml │ │ ├── metadata_weak_namespaced_features-0.toml │ │ ├── metadata_cycle2-3.toml │ │ ├── metadata_dups-0.toml │ │ ├── metadata_proc_macro1-3.toml │ │ ├── metadata_proc_macro1-2.toml │ │ ├── metadata_dups-2.toml │ │ ├── metadata_alternate_registries-3.toml │ │ ├── metadata_cycle2-0.toml │ │ ├── metadata_targets1-1.toml │ │ ├── metadata_targets1-0.toml │ │ ├── metadata2-1.toml │ │ └── metadata1-2.toml │ └── summaries │ │ ├── metadata_build_targets1-3.toml │ │ ├── metadata_cycle1-2.toml │ │ ├── metadata_weak_namespaced_features-5.toml │ │ ├── metadata_build_targets1-4.toml │ │ ├── metadata_cycle1-4.toml │ │ ├── metadata_builddep-6.toml │ │ ├── metadata_build_targets1-0.toml │ │ ├── metadata2-4.toml │ │ ├── metadata_builddep-7.toml │ │ ├── metadata_cycle_features-0.toml │ │ ├── metadata_build_targets1-2.toml │ │ ├── metadata_build_targets1-7.toml │ │ ├── metadata_build_targets1-6.toml │ │ ├── metadata_cycle1-5.toml │ │ ├── metadata_build_targets1-1.toml │ │ ├── metadata_build_targets1-5.toml │ │ ├── metadata_cycle1-1.toml │ │ ├── metadata_weak_namespaced_features-6.toml │ │ ├── metadata_dups-1.toml │ │ ├── metadata_cycle1-7.toml │ │ ├── metadata_alternate_registries-2.toml │ │ ├── metadata_dups-6.toml │ │ ├── metadata_alternate_registries-7.toml │ │ ├── metadata_cycle_features-7.toml │ │ ├── metadata_weak_namespaced_features-4.toml │ │ ├── metadata_builddep-4.toml │ │ ├── metadata_cycle1-6.toml │ │ ├── metadata_builddep-1.toml │ │ ├── metadata_builddep-3.toml │ │ ├── metadata_cycle1-3.toml │ │ ├── metadata_cycle2-4.toml │ │ ├── metadata_proc_macro1-3.toml │ │ ├── metadata_proc_macro1-6.toml │ │ ├── metadata_alternate_registries-0.toml │ │ ├── metadata_dups-4.toml │ │ ├── metadata_cycle1-0.toml │ │ ├── metadata_weak_namespaced_features-2.toml │ │ ├── metadata_alternate_registries-6.toml │ │ ├── metadata_builddep-2.toml │ │ ├── metadata_cycle_features-2.toml │ │ ├── metadata_cycle_features-5.toml │ │ ├── metadata_dups-5.toml │ │ ├── metadata_proc_macro1-0.toml │ │ ├── metadata_weak_namespaced_features-1.toml │ │ ├── metadata_cycle2-1.toml │ │ ├── metadata_dups-0.toml │ │ ├── metadata_builddep-5.toml │ │ ├── metadata_dups-2.toml │ │ ├── metadata_cycle2-6.toml │ │ ├── metadata_targets1-5.toml │ │ ├── metadata_dups-7.toml │ │ ├── metadata_builddep-0.toml │ │ ├── metadata_cycle_features-4.toml │ │ ├── metadata_cycle2-7.toml │ │ ├── metadata_alternate_registries-3.toml │ │ ├── metadata_proc_macro1-2.toml │ │ ├── metadata_proc_macro1-7.toml │ │ ├── metadata_proc_macro1-5.toml │ │ ├── metadata_targets1-0.toml │ │ ├── metadata_cycle_features-3.toml │ │ ├── metadata_proc_macro1-4.toml │ │ ├── metadata_cycle2-5.toml │ │ ├── metadata_dups-3.toml │ │ ├── metadata_weak_namespaced_features-3.toml │ │ ├── metadata_alternate_registries-5.toml │ │ ├── metadata_cycle_features-6.toml │ │ ├── metadata_cycle2-0.toml │ │ ├── metadata_cycle2-3.toml │ │ ├── metadata_targets1-1.toml │ │ ├── metadata_cycle_features-1.toml │ │ ├── metadata_targets1-7.toml │ │ ├── metadata_targets1-6.toml │ │ ├── metadata_alternate_registries-4.toml │ │ ├── metadata_targets1-3.toml │ │ ├── metadata_proc_macro1-1.toml │ │ ├── metadata_targets1-2.toml │ │ ├── metadata_cycle2-2.toml │ │ ├── metadata_targets1-4.toml │ │ └── metadata_alternate_registries-1.toml └── README.md ├── rustfmt.toml ├── tools ├── hakari │ ├── templates │ │ ├── crate │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ ├── build.rs │ │ │ ├── .gitattributes │ │ │ └── Cargo.toml-in │ │ └── hakari.toml-in │ ├── src │ │ └── cli_ops │ │ │ └── mod.rs │ └── README.tpl ├── cargo-hakari │ ├── screenshots │ │ ├── init.png │ │ ├── manage-deps.png │ │ └── remove-deps.png │ ├── src │ │ ├── docs │ │ │ └── mod.rs │ │ └── main.rs │ ├── README.tpl │ └── Cargo.toml └── determinator │ ├── README.tpl │ ├── Cargo.toml │ └── default-rules.toml ├── .gitattributes ├── .cargo └── config.toml ├── internal-tools ├── benchmarks │ ├── .gitignore │ └── Cargo.toml ├── cargo-compare │ ├── src │ │ ├── tests │ │ │ ├── mod.rs │ │ │ └── workspace_tests.rs │ │ ├── main.rs │ │ └── type_conversions.rs │ ├── Cargo.toml │ └── proptest-regressions │ │ └── tests │ │ └── workspace_tests.txt ├── fixture-manager │ ├── src │ │ └── main.rs │ └── Cargo.toml └── proptest-ext │ └── Cargo.toml ├── guppy ├── src │ ├── unit_tests │ │ └── mod.rs │ ├── graph │ │ ├── cargo │ │ │ └── mod.rs │ │ └── feature │ │ │ └── mod.rs │ ├── macros.rs │ ├── petgraph_support │ │ └── edge_ref.rs │ ├── debug_ignore.rs │ ├── platform │ │ └── proptest_helpers.rs │ ├── package_id.rs │ └── dependency_kind.rs ├── tests │ └── graph-tests │ │ ├── main.rs │ │ └── feature_helpers.rs ├── README.tpl └── examples │ └── topo_sort.rs ├── guppy-summaries ├── src │ └── unit_tests │ │ └── mod.rs ├── README.tpl └── Cargo.toml ├── CODE_OF_CONDUCT.md ├── .github ├── dependabot.yml └── workflows │ ├── docs.yml │ └── hakari.yml ├── scripts ├── regenerate-readmes.sh └── fix-readmes.awk ├── Cargo.toml ├── guppy-cmdlib └── Cargo.toml ├── cargo-guppy ├── README.tpl └── Cargo.toml ├── target-spec ├── README.tpl ├── Cargo.toml └── build.rs ├── LICENSE-MIT ├── .config └── hakari.toml └── CONTRIBUTING.md /.ignore: -------------------------------------------------------------------------------- 1 | /fixtures/ 2 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | msrv = "1.56" 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | -------------------------------------------------------------------------------- /workspace-hack/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This is a stub lib.rs. 2 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2018" 2 | use_field_init_shorthand = true 3 | -------------------------------------------------------------------------------- /tools/hakari/templates/crate/src/lib.rs: -------------------------------------------------------------------------------- 1 | // This is a stub lib.rs. 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Disable all CRLF conversions throughout the repo. 2 | * -text 3 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/external/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/inactive/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/transitive/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/main/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | } 3 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/x86-active/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xfmt = "fmt -- --config imports_granularity=Crate" 3 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/aarch64-active/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/internal-macro/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | } 3 | -------------------------------------------------------------------------------- /workspace-hack/build.rs: -------------------------------------------------------------------------------- 1 | // A build script is required for cargo to consider build dependencies. 2 | fn main() {} 3 | -------------------------------------------------------------------------------- /internal-tools/benchmarks/.gitignore: -------------------------------------------------------------------------------- 1 | # Criterion benchmarks generate a target folder within this directory. 2 | /target/ 3 | -------------------------------------------------------------------------------- /tools/hakari/templates/crate/build.rs: -------------------------------------------------------------------------------- 1 | // A build script is required for cargo to consider build dependencies. 2 | fn main() {} 3 | -------------------------------------------------------------------------------- /tools/cargo-hakari/screenshots/init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/cargo-guppy/HEAD/tools/cargo-hakari/screenshots/init.png -------------------------------------------------------------------------------- /guppy/src/unit_tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | mod dot_tests; 5 | -------------------------------------------------------------------------------- /tools/cargo-hakari/screenshots/manage-deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/cargo-guppy/HEAD/tools/cargo-hakari/screenshots/manage-deps.png -------------------------------------------------------------------------------- /tools/cargo-hakari/screenshots/remove-deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/cargo-guppy/HEAD/tools/cargo-hakari/screenshots/remove-deps.png -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/external/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/inactive/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/transitive/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/x86-active/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/aarch64-active/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/main/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/side/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/internal/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/internal-macro/src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | #[test] 4 | fn it_works() { 5 | assert_eq!(2 + 2, 4); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tools/cargo-hakari/src/docs/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | pub mod about; 5 | pub mod config; 6 | pub mod publishing; 7 | -------------------------------------------------------------------------------- /guppy-summaries/src/unit_tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Unit tests for guppy-summaries. 5 | 6 | mod basic_tests; 7 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Please see Diem's [Code of Conduct](https://developers.diem.com/docs/policies/code-of-conduct/), which describes the expectations for interactions within the community. 4 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["main", "internal", "internal-macro", "side"] 3 | # The cargo-compare tests will add resolver = "1" or "2" to the end of this 4 | # file. 5 | -------------------------------------------------------------------------------- /internal-tools/cargo-compare/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | mod fixtures; 5 | #[macro_use] 6 | mod proptest_helpers; 7 | mod workspace_tests; 8 | -------------------------------------------------------------------------------- /workspace-hack/.gitattributes: -------------------------------------------------------------------------------- 1 | # Avoid putting conflict markers in the generated Cargo.toml file, since their presence breaks 2 | # Cargo. 3 | # Also do not check out the file as CRLF on Windows, as that's what hakari needs. 4 | Cargo.toml merge=binary -crlf 5 | -------------------------------------------------------------------------------- /internal-tools/cargo-compare/src/tests/workspace_tests.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | proptest_suite!(inside_outside_v1); 5 | proptest_suite!(inside_outside_v2); 6 | proptest_suite!(cargo_guppy); 7 | -------------------------------------------------------------------------------- /tools/hakari/templates/crate/.gitattributes: -------------------------------------------------------------------------------- 1 | # Avoid putting conflict markers in the generated Cargo.toml file, since their presence breaks 2 | # Cargo. 3 | # Also do not check out the file as CRLF on Windows, as that's what hakari needs. 4 | Cargo.toml merge=binary -crlf 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Reference: 2 | # https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates 3 | 4 | version: 2 5 | updates: 6 | - package-ecosystem: "cargo" 7 | directory: "/" 8 | schedule: 9 | interval: "daily" 10 | allow: 11 | - dependency-type: all 12 | -------------------------------------------------------------------------------- /fixtures/determinator-paths/git-diff.out: -------------------------------------------------------------------------------- 1 | Cargo.lockcargo-guppy/Cargo.tomlguppy/CHANGELOG.mdguppy/Cargo.tomlguppy/src/graph/cargo/cargo_api.rstarget-spec/CHANGELOG.mdtarget-spec/Cargo.tomltools/determinator/CHANGELOG.mdtools/determinator/Cargo.tomltools/determinator/src/determinator.rstools/hakari/CHANGELOG.mdtools/hakari/Cargo.toml -------------------------------------------------------------------------------- /internal-tools/fixture-manager/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use anyhow::Result; 5 | use fixture_manager::FixtureManager; 6 | use structopt::StructOpt; 7 | 8 | fn main() -> Result<()> { 9 | let args = FixtureManager::from_args(); 10 | args.exec() 11 | } 12 | -------------------------------------------------------------------------------- /internal-tools/cargo-compare/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use cargo_compare::CargoCompare; 5 | use clap::Parser; 6 | use color_eyre::eyre::Result; 7 | 8 | fn main() -> Result<()> { 9 | color_eyre::install()?; 10 | 11 | let args = CargoCompare::parse(); 12 | args.exec() 13 | } 14 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/side/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "side" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | external = { path = "../../external", features = ["side-feature"] } 11 | -------------------------------------------------------------------------------- /fixtures/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fixtures" 3 | version = "0.1.0" 4 | authors = ["Rain "] 5 | publish = false 6 | edition = "2018" 7 | 8 | [dependencies] 9 | camino = "1.0.9" 10 | guppy = { path = "../guppy" } 11 | once_cell = "1.12.0" 12 | pathdiff = "0.2.1" 13 | pretty_assertions = "1.2.1" 14 | guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } 15 | -------------------------------------------------------------------------------- /fixtures/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Test fixtures for guppy. 5 | 6 | pub mod dep_helpers; 7 | pub mod details; 8 | pub mod json; 9 | 10 | use guppy::PackageId; 11 | 12 | /// Helper for creating `PackageId` instances in test code. 13 | pub fn package_id(s: impl Into>) -> PackageId { 14 | PackageId::new(s) 15 | } 16 | -------------------------------------------------------------------------------- /guppy/src/graph/cargo/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Simulations of Cargo behavior. 5 | //! 6 | //! Cargo comes with a set of algorithms to figure out what packages or features are built. This 7 | //! module reimplements those algorithms using `guppy`'s data structures. 8 | 9 | pub(super) mod build; 10 | mod cargo_api; 11 | 12 | pub use cargo_api::*; 13 | -------------------------------------------------------------------------------- /fixtures/determinator-paths/README.md: -------------------------------------------------------------------------------- 1 | # determinator paths fixtures 2 | 3 | This fixture is used to test that path matching works correctly across platforms. 4 | 5 | * `git-diff.out`: The output of `git diff -z --name-only f9ddae14671073f9fe847f8c6190de596f87a119^ f9ddae14671073f9fe847f8c6190de596f87a119`, identical on Windows and Linux. 6 | * `guppy-win.json`: `cargo metadata` output on Windows. 7 | * `guppy-linux.json`: `cargo metadata` output on Linux. 8 | -------------------------------------------------------------------------------- /workspace-hack/README.md: -------------------------------------------------------------------------------- 1 | # workspace-hack 2 | 3 | This is a stub crate that will never contain any code or have any dependencies. 4 | 5 | It is intended for the [`cargo hakari`](https://crates.io/crates/cargo-hakari) workspace-hack manager, but 6 | anyone is welcome to use it for any purpose. 7 | 8 | For more about why this crate has been published, see the 9 | [`cargo hakari` publishing docs](https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing). 10 | -------------------------------------------------------------------------------- /guppy/src/macros.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Test and helper macros. 5 | 6 | /// Assert that a struct with a single lifetime parameter is covariant. 7 | macro_rules! assert_covariant { 8 | ($i:ident) => { 9 | const _: () = { 10 | fn assert_covariant<'a, 'b: 'a>(x: $i<'b>) -> $i<'a> { 11 | x 12 | } 13 | }; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /internal-tools/proptest-ext/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "proptest-ext" 3 | version = "0.1.0" 4 | authors = ["Rain "] 5 | edition = "2018" 6 | publish = false # this is a private crate 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | proptest = "1.0.0" 12 | twox-hash = { version = "1.6.3", default-features = false } 13 | guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } 14 | -------------------------------------------------------------------------------- /tools/hakari/src/cli_ops/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Command-line operations for `hakari`. 5 | //! 6 | //! These are primarily intended for use with `cargo hakari`, but may be used by other command-line 7 | //! frontends. 8 | //! 9 | //! Requires the `cli-support` feature to be enabled. 10 | 11 | mod initialize; 12 | mod manage_deps; 13 | mod workspace_ops; 14 | 15 | pub use initialize::*; 16 | pub use workspace_ops::*; 17 | -------------------------------------------------------------------------------- /guppy/tests/graph-tests/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | #[cfg(feature = "proptest1")] 5 | #[macro_use] 6 | mod proptest_helpers; 7 | 8 | #[cfg(not(feature = "proptest1"))] 9 | macro_rules! proptest_suite { 10 | ($name: ident) => { 11 | // Empty macro to skip proptests if the proptest feature is disabled. 12 | }; 13 | } 14 | 15 | mod feature_helpers; 16 | mod graph_tests; 17 | mod invalid_tests; 18 | mod weak_namespaced; 19 | -------------------------------------------------------------------------------- /tools/hakari/templates/crate/Cargo.toml-in: -------------------------------------------------------------------------------- 1 | %CARGO_TOML_COMMENT% 2 | 3 | [package] 4 | name = "%PACKAGE_NAME%" 5 | version = "0.1.0" 6 | description = "workspace-hack package, managed by hakari" 7 | # You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing. 8 | publish = false 9 | 10 | # The parts of the file between the BEGIN HAKARI SECTION and END HAKARI SECTION comments 11 | # are managed by hakari. 12 | 13 | ### BEGIN HAKARI SECTION 14 | 15 | ### END HAKARI SECTION 16 | -------------------------------------------------------------------------------- /fixtures/guppy/package-rules.toml: -------------------------------------------------------------------------------- 1 | # This file lists out determinator package rules that can be used in tests. 2 | 3 | use-default-rules = false 4 | 5 | # This path rule means guppy is triggered, which causes guppy-benchmark to be changed, which causes 6 | # everything to change. 7 | [[path-rule]] 8 | globs = ["**/fake-trigger"] 9 | mark-changed = ["proptest-ext"] 10 | 11 | [[package-rule]] 12 | on-affected = ["fixtures"] 13 | mark-changed = ["guppy-cmdlib"] 14 | 15 | [[package-rule]] 16 | on-affected = ["guppy-benchmarks"] 17 | mark-changed = "all" 18 | 19 | -------------------------------------------------------------------------------- /scripts/regenerate-readmes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Copyright (c) The cargo-guppy Contributors 4 | # SPDX-License-Identifier: MIT OR Apache-2.0 5 | 6 | # Regenerate readme files in this repository. 7 | 8 | set -eo pipefail 9 | 10 | cd "$(git rev-parse --show-toplevel)" 11 | git ls-files | grep README.tpl$ | while read -r readme; do 12 | dir=$(dirname "$readme") 13 | cargo readme --project-root "$dir" > "$dir/README.md.tmp" 14 | gawk -f "scripts/fix-readmes.awk" "$dir/README.md.tmp" > "$dir/README.md" 15 | rm "$dir/README.md.tmp" 16 | done 17 | -------------------------------------------------------------------------------- /internal-tools/benchmarks/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "guppy-benchmarks" 3 | version = "0.1.0" 4 | authors = ["Rain ", "Brandon Williams "] 5 | edition = "2018" 6 | publish = false # this is a private crate 7 | 8 | [dependencies] 9 | guppy = { path = "../../guppy", features = ["proptest1"] } 10 | proptest = "1.0.0" 11 | proptest-ext = { path = "../proptest-ext" } 12 | guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } 13 | 14 | [dev-dependencies] 15 | criterion = "0.3.5" 16 | 17 | [[bench]] 18 | name = "package_graph" 19 | harness = false 20 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_build_targets1-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_build_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'none' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcrate' 12 | # version = '0.1.0' 13 | # workspace-path = '' 14 | # 15 | # [final-excludes] 16 | 17 | ### END HAKARI SECTION 18 | 19 | # This part of the file should be preserved at the end. 20 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'powerpc-unknown-openbsd' 14 | target-features = ['ssse3'] 15 | 16 | [[target-package]] 17 | name = 'testcrate' 18 | version = '0.1.0' 19 | workspace-path = '' 20 | status = 'initial' 21 | features = [] 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_build_targets1-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_build_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # 11 | # [traversal-excludes] 12 | # [[final-excludes.ids]] 13 | # name = 'testcrate' 14 | # version = '0.1.0' 15 | # workspace-path = '' 16 | 17 | ### END HAKARI SECTION 18 | 19 | # This part of the file should be preserved at the end. 20 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'aarch64-unknown-none-softfloat' 11 | target-features = [] 12 | flags = ['flag-test'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | 17 | [[host-package]] 18 | name = 'testcycles-base' 19 | version = '0.1.0' 20 | workspace-path = '' 21 | status = 'initial' 22 | features = [] 23 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle2-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle2 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'none' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['armv7-unknown-linux-gnueabihf'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'lower-a' 12 | # version = '0.1.0' 13 | # workspace-path = 'lower-a' 14 | # 15 | # [final-excludes] 16 | 17 | ### END HAKARI SECTION 18 | 19 | # This part of the file should be preserved at the end. 20 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/internal-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "internal-macro" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | [lib] 8 | proc-macro = true 9 | 10 | [dependencies] 11 | external = { path = "../../external", features = ["macro-normal-feature"] } 12 | 13 | [build-dependencies] 14 | external = { path = "../../external", features = ["macro-build-feature"] } 15 | 16 | [dev-dependencies] 17 | external = { path = "../../external", features = ["macro-dev-feature"] } 18 | 19 | [features] 20 | main-build-feature = [] 21 | internal-normal-feature = [] 22 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_weak_namespaced_features-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_weak_namespaced_features 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'armv6k-nintendo-3ds' 14 | target-features = 'unknown' 15 | flags = ['abc', 'cargo_web'] 16 | 17 | [[host-package]] 18 | name = 'namespaced-weak' 19 | version = '0.1.0' 20 | workspace-path = '' 21 | status = 'initial' 22 | features = [] 23 | -------------------------------------------------------------------------------- /internal-tools/cargo-compare/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo-compare" 3 | version = "0.1.0" 4 | authors = ["Rain "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | anyhow = "1.0.57" 9 | cargo = "0.60.0" 10 | clap = { version = "3.1.18", features = ["derive"] } 11 | color-eyre = { version = "0.6.1", default-features = false } 12 | diffus = "0.10.0" 13 | either = "1.6.1" 14 | fs_extra = "1.2.0" 15 | itertools = "0.10.3" 16 | guppy = { path = "../../guppy" } 17 | guppy-cmdlib = { path = "../../guppy-cmdlib", features = ["proptest1"] } 18 | tempfile = "3.3.0" 19 | once_cell = "1.12.0" 20 | pathdiff = "0.2.1" 21 | proptest = "1.0.0" 22 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'testcrate' 16 | version = '0.1.0' 17 | workspace-path = '' 18 | 19 | [[target-package]] 20 | name = 'testcrate' 21 | version = '0.1.0' 22 | workspace-path = '' 23 | status = 'initial' 24 | features = [] 25 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | 15 | [[metadata.features-only]] 16 | name = 'testcycles-base' 17 | version = '0.1.0' 18 | workspace-path = '' 19 | features = [] 20 | 21 | [[host-package]] 22 | name = 'testcycles-base' 23 | version = '0.1.0' 24 | workspace-path = '' 25 | status = 'initial' 26 | features = [] 27 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/transitive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "transitive" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [features] 10 | build-feature = [] 11 | dev-feature = [] 12 | inactive-normal = [] 13 | inactive-build = [] 14 | inactive-dev = [] 15 | extra = [] 16 | inactive2-normal = [] 17 | inactive2-build = [] 18 | inactive2-dev = [] 19 | inactive2-extra = [] 20 | inactive3-normal = [] 21 | inactive3-build = [] 22 | inactive3-dev = [] 23 | inactive3-extra = [] 24 | 25 | [workspace] 26 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/inactive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "inactive" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | transitive = { path = "../transitive", features = ["inactive-normal"] } 11 | 12 | [build-dependencies] 13 | transitive = { path = "../transitive", features = ["inactive-build"] } 14 | 15 | [dev-dependencies] 16 | transitive = { path = "../transitive", features = ["inactive-dev"] } 17 | 18 | [features] 19 | extra = ["transitive/extra"] 20 | 21 | [workspace] 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle_features-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['x86_64-unknown-none', 'armv6k-nintendo-3ds'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcycles-base' 12 | # version = '0.1.0' 13 | # workspace-path = 'testcycles-base' 14 | # 15 | # [final-excludes] 16 | 17 | ### END HAKARI SECTION 18 | 19 | # This part of the file should be preserved at the end. 20 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | members = [ 4 | "cargo-guppy", 5 | "fixtures", 6 | "guppy", 7 | "guppy-cmdlib", 8 | "guppy-summaries", 9 | "internal-tools/benchmarks", 10 | "internal-tools/cargo-compare", 11 | "internal-tools/fixture-manager", 12 | "internal-tools/proptest-ext", 13 | "target-spec", 14 | "tools/cargo-hakari", 15 | "tools/determinator", 16 | "tools/hakari", 17 | "workspace-hack", 18 | ] 19 | 20 | # Recommended for color-eyre 21 | [profile.dev.package.backtrace] 22 | opt-level = 3 23 | 24 | # Build guppy in opt mode for tests, speeding up test runs 25 | [profile.test.package.guppy] 26 | opt-level = 3 27 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/x86-active/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "x86-active" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | transitive = { path = "../transitive", features = ["inactive2-normal"] } 11 | 12 | [build-dependencies] 13 | transitive = { path = "../transitive", features = ["inactive2-build"] } 14 | 15 | [dev-dependencies] 16 | transitive = { path = "../transitive", features = ["inactive2-dev"] } 17 | 18 | [features] 19 | extra = ["transitive/inactive2-extra"] 20 | 21 | [workspace] 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle2-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle2 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['mipsisa64r6-unknown-linux-gnuabi64', 'aarch64-apple-tvos', 'wasm32-unknown-unknown'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'lower-b' 12 | # version = '0.1.0' 13 | # workspace-path = 'lower-b' 14 | # 15 | # [final-excludes] 16 | 17 | ### END HAKARI SECTION 18 | 19 | # This part of the file should be preserved at the end. 20 | -------------------------------------------------------------------------------- /fixtures/guppy/hakari/metadata_guppy_44b62fa-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_guppy_44b62fa 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['aarch64-unknown-linux-gnu_ilp32', 'armv7-unknown-linux-gnueabi'] 10 | # 11 | # [traversal-excludes] 12 | # [[final-excludes.ids]] 13 | # name = 'guppy-cmdlib' 14 | # version = '0.1.0' 15 | # workspace-path = 'guppy-cmdlib' 16 | 17 | ### END HAKARI SECTION 18 | 19 | # This part of the file should be preserved at the end. 20 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/aarch64-active/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "aarch64-active" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | transitive = { path = "../transitive", features = ["inactive3-normal"] } 11 | 12 | [build-dependencies] 13 | transitive = { path = "../transitive", features = ["inactive3-build"] } 14 | 15 | [dev-dependencies] 16 | transitive = { path = "../transitive", features = ["inactive3-dev"] } 17 | 18 | [features] 19 | extra = ["transitive/inactive3-extra"] 20 | 21 | [workspace] 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata1-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['riscv64imac-unknown-none-elf', 'armv7s-apple-ios'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'linked-hash-map' 12 | # version = '0.5.2' 13 | # crates-io = true 14 | # [[final-excludes.ids]] 15 | # name = 'regex-syntax' 16 | # version = '0.6.12' 17 | # crates-io = true 18 | 19 | ### END HAKARI SECTION 20 | 21 | # This part of the file should be preserved at the end. 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_build_targets1-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_build_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcrate' 12 | # version = '0.1.0' 13 | # workspace-path = '' 14 | # [[final-excludes.ids]] 15 | # name = 'testcrate' 16 | # version = '0.1.0' 17 | # workspace-path = '' 18 | 19 | ### END HAKARI SECTION 20 | 21 | # This part of the file should be preserved at the end. 22 | -------------------------------------------------------------------------------- /scripts/fix-readmes.awk: -------------------------------------------------------------------------------- 1 | # Fix up readmes: 2 | # * Replace ## with # in code blocks. 3 | # * Remove [] without a following () from output. 4 | 5 | BEGIN { 6 | true = 1 7 | false = 0 8 | in_block = false 9 | } 10 | 11 | { 12 | if (!in_block && $0 ~ /^\s*```/) { 13 | in_block = true 14 | } else if (in_block && $0 ~ /^\s*```$/) { 15 | in_block = false 16 | } 17 | 18 | if (in_block) { 19 | sub(/## /, "# ") 20 | print $0 21 | } else { 22 | # Strip [] without a ( or [ that immediately follows them from 23 | # the output. 24 | subbed = gensub(/\[([^\[]+)]([^\(\[]|$)/, "\\1\\2", "g") 25 | print subbed 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle1-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # 11 | # [traversal-excludes] 12 | # [[final-excludes.ids]] 13 | # name = 'testcycles-base' 14 | # version = '0.1.0' 15 | # workspace-path = '' 16 | # 17 | # [[final-excludes.ids]] 18 | # name = 'testcycles-helper' 19 | # version = '0.1.0' 20 | # path = '../testcycles-helper' 21 | 22 | ### END HAKARI SECTION 23 | 24 | # This part of the file should be preserved at the end. 25 | -------------------------------------------------------------------------------- /guppy-cmdlib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "guppy-cmdlib" 3 | version = "0.1.0" 4 | authors = ["Rain "] 5 | description = "CLI library for guppy" 6 | edition = "2018" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | # disable tracing integration since we don't use it 12 | clap = { version = "3.1.18", features = ["derive"] } 13 | color-eyre = { version = "0.6.1", default-features = false } 14 | guppy = { path = "../guppy" } 15 | proptest = { version = "1.0.0", optional = true } 16 | guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } 17 | 18 | [features] 19 | proptest1 = ["proptest", "guppy/proptest1"] 20 | -------------------------------------------------------------------------------- /fixtures/guppy/summaries/metadata_guppy_44b62fa-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_guppy_44b62fa 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'mipsisa32r6-unknown-linux-gnu' 11 | target-features = ['sse2', 'sse3'] 12 | flags = ['abc', 'cargo_web'] 13 | 14 | [metadata.target-platform] 15 | triple = 'x86_64-apple-tvos' 16 | target-features = 'unknown' 17 | flags = ['foo'] 18 | 19 | [[target-package]] 20 | name = 'cargo-hakari' 21 | version = '0.9.11' 22 | workspace-path = 'tools/cargo-hakari' 23 | status = 'initial' 24 | features = [] 25 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_build_targets1-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_build_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['thumbv7neon-unknown-linux-gnueabihf'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcrate' 12 | # version = '0.1.0' 13 | # workspace-path = '' 14 | # [[final-excludes.ids]] 15 | # name = 'testcrate' 16 | # version = '0.1.0' 17 | # workspace-path = '' 18 | 19 | ### END HAKARI SECTION 20 | 21 | # This part of the file should be preserved at the end. 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle1-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcycles-base' 12 | # version = '0.1.0' 13 | # workspace-path = '' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'testcycles-helper' 17 | # version = '0.1.0' 18 | # path = '../testcycles-helper' 19 | # 20 | # [final-excludes] 21 | 22 | ### END HAKARI SECTION 23 | 24 | # This part of the file should be preserved at the end. 25 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'arm-unknown-linux-gnueabihf' 11 | target-features = 'all' 12 | flags = ['cargo_web', 'foo'] 13 | 14 | [metadata.target-platform] 15 | spec = 'any' 16 | 17 | [[host-package]] 18 | name = 'builddep' 19 | version = '0.1.0' 20 | workspace-path = 'builddep' 21 | status = 'initial' 22 | features = [] 23 | 24 | [[host-package]] 25 | name = 'main' 26 | version = '0.1.0' 27 | workspace-path = 'main' 28 | status = 'initial' 29 | features = [] 30 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'testcrate' 16 | version = '0.1.0' 17 | workspace-path = '' 18 | 19 | [[metadata.features-only]] 20 | name = 'testcrate' 21 | version = '0.1.0' 22 | workspace-path = '' 23 | features = [] 24 | 25 | [[host-package]] 26 | name = 'testcrate' 27 | version = '0.1.0' 28 | workspace-path = '' 29 | status = 'initial' 30 | features = [] 31 | -------------------------------------------------------------------------------- /guppy/tests/graph-tests/feature_helpers.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use guppy::{ 5 | graph::feature::{FeatureLabel, FeatureSet}, 6 | PackageId, 7 | }; 8 | 9 | pub(super) fn assert_features_for_package( 10 | feature_set: &FeatureSet<'_>, 11 | package_id: &PackageId, 12 | expected: Option<&[FeatureLabel<'_>]>, 13 | msg: &str, 14 | ) { 15 | let actual = feature_set 16 | .features_for(package_id) 17 | .expect("valid package ID"); 18 | 19 | assert_eq!( 20 | actual.as_ref().map(|list| list.labels()), 21 | expected, 22 | "{}: for package {}, features in feature set match", 23 | msg, 24 | package_id 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/external/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "external" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | [dependencies] 8 | transitive = { path = "../transitive" } 9 | bytes = { version = "0.5", optional = true } 10 | 11 | [dev-dependencies] 12 | transitive = { path = "../transitive", features = ["dev-feature"] } 13 | 14 | [build-dependencies] 15 | transitive = { path = "../transitive", features = ["build-feature"] } 16 | 17 | [features] 18 | internal-dev-feature = [] 19 | internal-build-feature = [] 20 | main-dev-feature = [] 21 | main-build-feature = [] 22 | macro-normal-feature = [] 23 | macro-build-feature = [] 24 | macro-dev-feature = [] 25 | side-feature = ["bytes"] 26 | 27 | [workspace] 28 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_targets1-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'lazy_static' 12 | # version = '0.1.16' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'testcrate-targets' 17 | # version = '0.1.0' 18 | # workspace-path = '' 19 | # [[final-excludes.ids]] 20 | # name = 'lazy_static' 21 | # version = '1.4.0' 22 | # crates-io = true 23 | 24 | ### END HAKARI SECTION 25 | 26 | # This part of the file should be preserved at the end. 27 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_builddep-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_builddep 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'builddep' 12 | # version = '0.1.0' 13 | # workspace-path = 'builddep' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'main' 17 | # version = '0.1.0' 18 | # workspace-path = 'main' 19 | # [[final-excludes.ids]] 20 | # name = 'main' 21 | # version = '0.1.0' 22 | # workspace-path = 'main' 23 | 24 | ### END HAKARI SECTION 25 | 26 | # This part of the file should be preserved at the end. 27 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata2-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata2 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | 15 | [[metadata.features-only]] 16 | name = 'testworkspace-crate' 17 | version = '0.1.0' 18 | workspace-path = 'testcrate' 19 | features = [] 20 | 21 | [[metadata.features-only]] 22 | name = 'walkdir' 23 | version = '2.2.9' 24 | workspace-path = 'walkdir' 25 | features = [] 26 | 27 | [[host-package]] 28 | name = 'walkdir' 29 | version = '2.2.9' 30 | workspace-path = 'walkdir' 31 | status = 'initial' 32 | features = [] 33 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | 15 | [[metadata.features-only]] 16 | name = 'main' 17 | version = '0.1.0' 18 | workspace-path = 'main' 19 | features = [] 20 | 21 | [[host-package]] 22 | name = 'builddep' 23 | version = '0.1.0' 24 | workspace-path = 'builddep' 25 | status = 'initial' 26 | features = [] 27 | 28 | [[host-package]] 29 | name = 'main' 30 | version = '0.1.0' 31 | workspace-path = 'main' 32 | status = 'initial' 33 | features = [] 34 | -------------------------------------------------------------------------------- /cargo-guppy/README.tpl: -------------------------------------------------------------------------------- 1 | # {{crate}} 2 | 3 | [![Documentation (main)](https://img.shields.io/badge/docs-main-brightgreen)](https://facebookincubator.github.io/cargo-guppy/rustdoc/cargo_guppy/) 4 | [![License](https://img.shields.io/badge/license-Apache-green.svg)](../LICENSE-APACHE) 5 | [![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE-MIT) 6 | 7 | {{readme}} 8 | 9 | ## Contributing 10 | 11 | See the [CONTRIBUTING](../CONTRIBUTING.md) file for how to help out. 12 | 13 | ## License 14 | 15 | This project is available under the terms of either the [Apache 2.0 license](../LICENSE-APACHE) or the [MIT 16 | license](../LICENSE-MIT). 17 | 18 | 24 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_builddep-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_builddep 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['wasm64-unknown-unknown', 'armv5te-unknown-linux-uclibceabi', 's390x-unknown-linux-gnu'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'builddep' 12 | # version = '0.1.0' 13 | # workspace-path = 'builddep' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'main' 17 | # version = '0.1.0' 18 | # workspace-path = 'main' 19 | # 20 | # [final-excludes] 21 | 22 | ### END HAKARI SECTION 23 | 24 | # This part of the file should be preserved at the end. 25 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | 15 | [[target-package]] 16 | name = 'testcycles-base' 17 | version = '0.1.0' 18 | workspace-path = 'testcycles-base' 19 | status = 'initial' 20 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 21 | 22 | [[target-package]] 23 | name = 'testcycles-helper' 24 | version = '0.1.0' 25 | workspace-path = 'testcycles-helper' 26 | status = 'initial' 27 | features = [] 28 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | triple = 'riscv64gc-unknown-linux-gnu' 14 | target-features = 'all' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'testcrate' 17 | version = '0.1.0' 18 | workspace-path = '' 19 | 20 | [[metadata.features-only]] 21 | name = 'testcrate' 22 | version = '0.1.0' 23 | workspace-path = '' 24 | features = [] 25 | 26 | [[target-package]] 27 | name = 'testcrate' 28 | version = '0.1.0' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = [] 32 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'sparc64-unknown-openbsd' 11 | target-features = 'all' 12 | flags = ['cargo_web'] 13 | 14 | [metadata.target-platform] 15 | triple = 'i686-wrs-vxworks' 16 | target-features = ['bmi1', 'sse', 'sse3', 'sse4.1', 'ssse3', 'xsavec'] 17 | [[metadata.omitted-packages.ids]] 18 | name = 'testcrate' 19 | version = '0.1.0' 20 | workspace-path = '' 21 | 22 | [[target-package]] 23 | name = 'testcrate' 24 | version = '0.1.0' 25 | workspace-path = '' 26 | status = 'initial' 27 | features = [] 28 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle_features-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['armv7-unknown-linux-gnueabi', 'riscv32gc-unknown-linux-gnu', 'x86_64-apple-ios-macabi'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcycles-helper' 12 | # version = '0.1.0' 13 | # workspace-path = 'testcycles-helper' 14 | # [[final-excludes.ids]] 15 | # name = 'testcycles-base' 16 | # version = '0.1.0' 17 | # workspace-path = 'testcycles-base' 18 | 19 | ### END HAKARI SECTION 20 | 21 | # This part of the file should be preserved at the end. 22 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'powerpc64-unknown-linux-gnu' 14 | target-features = 'all' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'testcrate' 17 | version = '0.1.0' 18 | workspace-path = '' 19 | 20 | [[metadata.features-only]] 21 | name = 'testcrate' 22 | version = '0.1.0' 23 | workspace-path = '' 24 | features = [] 25 | 26 | [[target-package]] 27 | name = 'testcrate' 28 | version = '0.1.0' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = [] 32 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'mipsel-sony-psp' 11 | target-features = 'unknown' 12 | 13 | [metadata.target-platform] 14 | spec = 'any' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'testcycles-helper' 17 | version = '0.1.0' 18 | path = '../testcycles-helper' 19 | 20 | [[metadata.features-only]] 21 | name = 'testcycles-base' 22 | version = '0.1.0' 23 | workspace-path = '' 24 | features = [] 25 | 26 | [[host-package]] 27 | name = 'testcycles-base' 28 | version = '0.1.0' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = [] 32 | -------------------------------------------------------------------------------- /internal-tools/fixture-manager/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "fixture-manager" 3 | version = "0.1.0" 4 | authors = ["Rain "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | anyhow = "1.0.57" 11 | camino = "1.0.9" 12 | clap = "2.34.0" 13 | guppy = { path = "../../guppy", features = ["proptest1", "summaries"] } 14 | guppy-cmdlib = { path = "../../guppy-cmdlib", features = ["proptest1"] } 15 | fixtures = { path = "../../fixtures" } 16 | hakari = { path = "../../tools/hakari", features = ["cli-support", "proptest1"] } 17 | once_cell = "1.12.0" 18 | proptest = "1.0.0" 19 | proptest-ext = { path = "../proptest-ext" } 20 | structopt = "0.3.26" 21 | guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } 22 | -------------------------------------------------------------------------------- /fixtures/guppy/summaries/metadata_guppy_44b62fa-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_guppy_44b62fa 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'hakari' 16 | version = '0.8.1' 17 | workspace-path = 'tools/hakari' 18 | 19 | [[target-package]] 20 | name = 'guppy-summaries' 21 | version = '0.6.1' 22 | workspace-path = 'guppy-summaries' 23 | status = 'initial' 24 | features = [] 25 | 26 | [[target-package]] 27 | name = 'proptest-ext' 28 | version = '0.1.0' 29 | workspace-path = 'internal-tools/proptest-ext' 30 | status = 'initial' 31 | features = [] 32 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_builddep-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_builddep 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['i686-unknown-linux-gnu', 's390x-unknown-linux-gnu'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'builddep' 12 | # version = '0.1.0' 13 | # workspace-path = 'builddep' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'main' 17 | # version = '0.1.0' 18 | # workspace-path = 'main' 19 | # [[final-excludes.ids]] 20 | # name = 'builddep' 21 | # version = '0.1.0' 22 | # workspace-path = 'builddep' 23 | 24 | ### END HAKARI SECTION 25 | 26 | # This part of the file should be preserved at the end. 27 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'avr-unknown-gnu-atmega328' 14 | target-features = 'all' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'testcrate' 17 | version = '0.1.0' 18 | workspace-path = '' 19 | 20 | [[metadata.features-only]] 21 | name = 'testcrate' 22 | version = '0.1.0' 23 | workspace-path = '' 24 | features = [] 25 | 26 | [[target-package]] 27 | name = 'testcrate' 28 | version = '0.1.0' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = [] 32 | -------------------------------------------------------------------------------- /cargo-guppy/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo-guppy" 3 | version = "0.1.0" 4 | authors = ["Rain ", "Brandon Williams "] 5 | license = "MIT OR Apache-2.0" 6 | edition = "2018" 7 | 8 | [dependencies] 9 | camino = "1.0.9" 10 | # disable tracing integration since we don't use it 11 | color-eyre = { version = "0.6.1", default-features = false } 12 | clap = { version = "3.1.18", features = ["derive"] } 13 | dialoguer = "0.10.1" 14 | guppy = { version = "0.14.0", path = "../guppy", features = ["summaries"] } 15 | guppy-cmdlib = { path = "../guppy-cmdlib" } 16 | itertools = "0.10.3" 17 | pathdiff = { version = "0.2.1", features = ["camino"] } 18 | serde = { version = "1.0.137", features = ["derive"] } 19 | serde_json = "1.0.81" 20 | toml_edit = "0.14.4" 21 | guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } 22 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_build_targets1-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_build_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'powerpc-wrs-vxworks-spe' 11 | target-features = 'all' 12 | flags = ['abc'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'testcrate' 18 | version = '0.1.0' 19 | workspace-path = '' 20 | 21 | [[metadata.features-only]] 22 | name = 'testcrate' 23 | version = '0.1.0' 24 | workspace-path = '' 25 | features = [] 26 | 27 | [[target-package]] 28 | name = 'testcrate' 29 | version = '0.1.0' 30 | workspace-path = '' 31 | status = 'initial' 32 | features = [] 33 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-unknown-haiku' 11 | target-features = 'unknown' 12 | flags = ['abc', 'bar'] 13 | 14 | [metadata.target-platform] 15 | spec = 'any' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'testcycles-base' 18 | version = '0.1.0' 19 | workspace-path = '' 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'testcycles-helper' 23 | version = '0.1.0' 24 | path = '../testcycles-helper' 25 | 26 | [[host-package]] 27 | name = 'testcycles-base' 28 | version = '0.1.0' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = [] 32 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_weak_namespaced_features-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_weak_namespaced_features 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'mipsel-unknown-linux-uclibc' 14 | target-features = 'all' 15 | flags = ['cargo_web'] 16 | [[metadata.omitted-packages.ids]] 17 | name = 'arrayvec' 18 | version = '0.7.2' 19 | crates-io = true 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'smallvec' 23 | version = '1.8.0' 24 | crates-io = true 25 | 26 | [[target-package]] 27 | name = 'namespaced-weak' 28 | version = '0.1.0' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = [] 32 | -------------------------------------------------------------------------------- /fixtures/guppy/path-rules.toml: -------------------------------------------------------------------------------- 1 | # This file lists out determinator path rules that can be used in tests. 2 | 3 | [[path-rule]] 4 | # Ignore README files. 5 | globs = ["**/README.md", "**/README.tpl"] 6 | mark-changed = [] 7 | post-rule = "skip" 8 | 9 | [[path-rule]] 10 | # This is a test rule to ensure that marking packages changed works. 11 | globs = ["CODE_OF_CONDUCT.md", "CONTRIBUTING.md"] 12 | mark-changed = ["cargo-guppy"] 13 | post-rule = "fallthrough" 14 | 15 | [[path-rule]] 16 | # Ensure fallthrough works from above. 17 | globs = ["CODE_OF_CONDUCT.md"] 18 | mark-changed = ["guppy"] 19 | 20 | [[path-rule]] 21 | # Test for skip-rules. 22 | globs = ["**/foo"] 23 | mark-changed = ["cargo-compare"] 24 | post-rule = "skip-rules" 25 | 26 | [[path-rule]] 27 | # The above rule should mean this never gets applied. 28 | globs = ["**/foo"] 29 | mark-changed = ["target-spec"] 30 | -------------------------------------------------------------------------------- /fixtures/README.md: -------------------------------------------------------------------------------- 1 | # Fixtures for cargo-guppy 2 | 3 | This directory contains interesting test corpuses used within the cargo-guppy codebase. 4 | 5 | The fixtures are organized into several folders. 6 | 7 | ## `cargo metadata` output 8 | 9 | * `determinator-paths`: determinator path matching across platforms. 10 | * `small`: relatively simple examples that cover basic and some edge case functionality 11 | * `large`: complex examples pulled from real-world Rust repositories, that test a variety of edge cases 12 | * `invalid`: examples that are [*representable*](https://oleb.net/blog/2018/03/making-illegal-states-unrepresentable/) 13 | as cargo metadata (i.e. they are valid JSON and follow the general schema) but are *invalid* in some way; `cargo 14 | metadata` should never be able to generate these 15 | * `workspace`: real workspaces, used for comparison testing with Cargo 16 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle_features-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcycles-helper' 12 | # version = '0.1.0' 13 | # workspace-path = 'testcycles-helper' 14 | # [[final-excludes.ids]] 15 | # name = 'testcycles-base' 16 | # version = '0.1.0' 17 | # workspace-path = 'testcycles-base' 18 | # 19 | # [[final-excludes.ids]] 20 | # name = 'testcycles-helper' 21 | # version = '0.1.0' 22 | # workspace-path = 'testcycles-helper' 23 | 24 | ### END HAKARI SECTION 25 | 26 | # This part of the file should be preserved at the end. 27 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | triple = 'aarch64-unknown-none' 14 | target-features = [] 15 | flags = ['test-flag'] 16 | 17 | [[host-package]] 18 | name = 'testcrate-dups' 19 | version = '0.1.0' 20 | workspace-path = '' 21 | status = 'initial' 22 | features = [] 23 | 24 | [[host-package]] 25 | name = 'bytes' 26 | version = '0.5.4' 27 | crates-io = true 28 | status = 'direct' 29 | features = ['default', 'std'] 30 | 31 | [[host-package]] 32 | name = 'lazy_static' 33 | version = '1.4.0' 34 | crates-io = true 35 | status = 'direct' 36 | features = [] 37 | -------------------------------------------------------------------------------- /guppy/src/graph/feature/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Graph analysis for individual features within a package. 5 | //! 6 | //! `FeatureGraph` can be used to do a more precise analysis than is possible at the package level. 7 | //! For example, an optional feature not included a default build can potentially pull in a large 8 | //! number of extra dependencies. This module allows for those subgraphs to be filtered out. 9 | 10 | mod build; 11 | mod cycles; 12 | pub mod feature_list; 13 | mod graph_impl; 14 | #[cfg(feature = "proptest1")] 15 | mod proptest_helpers; 16 | mod query; 17 | mod resolve; 18 | mod weak; 19 | 20 | pub(self) use build::*; 21 | pub use cycles::*; 22 | pub use feature_list::FeatureList; 23 | pub use graph_impl::*; 24 | pub use query::*; 25 | pub use resolve::*; 26 | pub use weak::*; 27 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle1-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['s390x-unknown-linux-musl', 'x86_64-apple-ios-macabi', 'mips64el-unknown-linux-gnuabi64'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcycles-base' 12 | # version = '0.1.0' 13 | # workspace-path = '' 14 | # [[final-excludes.ids]] 15 | # name = 'testcycles-base' 16 | # version = '0.1.0' 17 | # workspace-path = '' 18 | # 19 | # [[final-excludes.ids]] 20 | # name = 'testcycles-helper' 21 | # version = '0.1.0' 22 | # path = '../testcycles-helper' 23 | 24 | ### END HAKARI SECTION 25 | 26 | # This part of the file should be preserved at the end. 27 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'riscv32gc-unknown-linux-gnu' 11 | target-features = ['bmi1', 'sha', 'sse4.2', 'xsaveopt'] 12 | flags = ['flag-test'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'testcycles-helper' 18 | version = '0.1.0' 19 | path = '../testcycles-helper' 20 | 21 | [[metadata.features-only]] 22 | name = 'testcycles-base' 23 | version = '0.1.0' 24 | workspace-path = '' 25 | features = [] 26 | 27 | [[host-package]] 28 | name = 'testcycles-base' 29 | version = '0.1.0' 30 | workspace-path = '' 31 | status = 'initial' 32 | features = [] 33 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'mips-unknown-linux-gnu' 11 | target-features = 'all' 12 | 13 | [metadata.target-platform] 14 | spec = 'any' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'syn' 17 | version = '1.0.80' 18 | source = 'registry+https://github.com/fakeorg/crates.io-index' 19 | 20 | [[target-package]] 21 | name = 'debug-ignore' 22 | version = '1.0.1' 23 | workspace-path = '' 24 | status = 'initial' 25 | features = [] 26 | 27 | [[target-package]] 28 | name = 'unicode-xid' 29 | version = '0.2.2' 30 | crates-io = true 31 | status = 'direct' 32 | features = ['default'] 33 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'bytes' 16 | version = '0.3.0' 17 | crates-io = true 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'lazy_static' 21 | version = '1.4.0' 22 | crates-io = true 23 | 24 | [[target-package]] 25 | name = 'testcrate-dups' 26 | version = '0.1.0' 27 | workspace-path = '' 28 | status = 'initial' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'bytes' 33 | version = '0.5.4' 34 | crates-io = true 35 | status = 'direct' 36 | features = ['default', 'std'] 37 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_dups-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_dups 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'none' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['i586-unknown-linux-gnu', 'riscv32imc-unknown-none-elf', 'armv5te-unknown-linux-uclibceabi'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'lazy_static' 12 | # version = '0.2.11' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'lazy_static' 17 | # version = '1.4.0' 18 | # crates-io = true 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'testcrate-dups' 22 | # version = '0.1.0' 23 | # workspace-path = '' 24 | # 25 | # [final-excludes] 26 | 27 | ### END HAKARI SECTION 28 | 29 | # This part of the file should be preserved at the end. 30 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'mips-unknown-linux-musl' 11 | target-features = 'all' 12 | flags = ['flag-test', 'foo'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | 17 | [[metadata.features-only]] 18 | name = 'debug-ignore' 19 | version = '1.0.1' 20 | workspace-path = '' 21 | features = [] 22 | 23 | [[host-package]] 24 | name = 'debug-ignore' 25 | version = '1.0.1' 26 | workspace-path = '' 27 | status = 'initial' 28 | features = [] 29 | 30 | [[host-package]] 31 | name = 'unicode-xid' 32 | version = '0.2.2' 33 | crates-io = true 34 | status = 'direct' 35 | features = ['default'] 36 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-uwp-windows-gnu' 11 | target-features = 'all' 12 | 13 | [metadata.target-platform] 14 | triple = 'armv6-unknown-netbsd-eabihf' 15 | target-features = 'all' 16 | 17 | [[target-package]] 18 | name = 'testcycles-base' 19 | version = '0.1.0' 20 | workspace-path = 'testcycles-base' 21 | status = 'initial' 22 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 23 | 24 | [[target-package]] 25 | name = 'testcycles-helper' 26 | version = '0.1.0' 27 | workspace-path = 'testcycles-helper' 28 | status = 'initial' 29 | features = [] 30 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_weak_namespaced_features-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_weak_namespaced_features 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'arrayvec' 16 | version = '0.7.2' 17 | crates-io = true 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'tinyvec' 21 | version = '1.5.1' 22 | crates-io = true 23 | 24 | [[metadata.features-only]] 25 | name = 'namespaced-weak' 26 | version = '0.1.0' 27 | workspace-path = '' 28 | features = [] 29 | 30 | [[target-package]] 31 | name = 'namespaced-weak' 32 | version = '0.1.0' 33 | workspace-path = '' 34 | status = 'initial' 35 | features = [] 36 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | 15 | [[metadata.features-only]] 16 | name = 'builddep' 17 | version = '0.1.0' 18 | workspace-path = 'builddep' 19 | features = [] 20 | 21 | [[metadata.features-only]] 22 | name = 'main' 23 | version = '0.1.0' 24 | workspace-path = 'main' 25 | features = [] 26 | 27 | [[host-package]] 28 | name = 'builddep' 29 | version = '0.1.0' 30 | workspace-path = 'builddep' 31 | status = 'initial' 32 | features = [] 33 | 34 | [[host-package]] 35 | name = 'main' 36 | version = '0.1.0' 37 | workspace-path = 'main' 38 | status = 'initial' 39 | features = [] 40 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'armv5te-unknown-linux-musleabi' 11 | target-features = 'all' 12 | flags = ['foo'] 13 | 14 | [metadata.target-platform] 15 | triple = 'aarch64-unknown-freebsd' 16 | target-features = 'all' 17 | flags = ['foo'] 18 | [[metadata.omitted-packages.ids]] 19 | name = 'testcycles-helper' 20 | version = '0.1.0' 21 | path = '../testcycles-helper' 22 | 23 | [[metadata.features-only]] 24 | name = 'testcycles-base' 25 | version = '0.1.0' 26 | workspace-path = '' 27 | features = [] 28 | 29 | [[host-package]] 30 | name = 'testcycles-base' 31 | version = '0.1.0' 32 | workspace-path = '' 33 | status = 'initial' 34 | features = [] 35 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | 15 | [[metadata.features-only]] 16 | name = 'builddep' 17 | version = '0.1.0' 18 | workspace-path = 'builddep' 19 | features = [] 20 | 21 | [[metadata.features-only]] 22 | name = 'main' 23 | version = '0.1.0' 24 | workspace-path = 'main' 25 | features = [] 26 | 27 | [[host-package]] 28 | name = 'builddep' 29 | version = '0.1.0' 30 | workspace-path = 'builddep' 31 | status = 'initial' 32 | features = [] 33 | 34 | [[host-package]] 35 | name = 'main' 36 | version = '0.1.0' 37 | workspace-path = 'main' 38 | status = 'initial' 39 | features = [] 40 | -------------------------------------------------------------------------------- /guppy/src/petgraph_support/edge_ref.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use petgraph::{ 5 | graph::{EdgeReference, IndexType}, 6 | prelude::*, 7 | visit::ReversedEdgeReference, 8 | }; 9 | 10 | /// Provides a way to obtain graph::EdgeReference instances from arbitrary EdgeRef ones. 11 | pub trait GraphEdgeRef<'a, E, Ix: IndexType>: EdgeRef { 12 | fn into_edge_reference(self) -> EdgeReference<'a, E, Ix>; 13 | } 14 | 15 | impl<'a, E, Ix: IndexType> GraphEdgeRef<'a, E, Ix> for EdgeReference<'a, E, Ix> { 16 | fn into_edge_reference(self) -> EdgeReference<'a, E, Ix> { 17 | self 18 | } 19 | } 20 | 21 | impl<'a, E, Ix: IndexType> GraphEdgeRef<'a, E, Ix> 22 | for ReversedEdgeReference> 23 | { 24 | fn into_edge_reference(self) -> EdgeReference<'a, E, Ix> { 25 | self.into_unreversed() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tools/hakari/templates/hakari.toml-in: -------------------------------------------------------------------------------- 1 | %CONFIG_COMMENT% 2 | 3 | hakari-package = "%PACKAGE_NAME%" 4 | 5 | # Format for `workspace-hack = ...` lines in other Cargo.tomls. Requires cargo-hakari 0.9.8 or above. 6 | dep-format-version = "2" 7 | 8 | # Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended. 9 | # Hakari works much better with the new feature resolver. 10 | # For more about the new feature resolver, see: 11 | # https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver 12 | resolver = "2" 13 | 14 | # Add triples corresponding to platforms commonly used by developers here. 15 | # https://doc.rust-lang.org/rustc/platform-support.html 16 | platforms = [ 17 | # "x86_64-unknown-linux-gnu", 18 | # "x86_64-apple-darwin", 19 | # "x86_64-pc-windows-msvc", 20 | ] 21 | 22 | # Write out exact versions rather than a semver range. (Defaults to false.) 23 | # exact-versions = true 24 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_weak_namespaced_features-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_weak_namespaced_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'none' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'arrayvec' 12 | # version = '0.7.2' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'pathdiff' 17 | # version = '0.2.1' 18 | # crates-io = true 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'smallvec' 22 | # version = '1.8.0' 23 | # crates-io = true 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'tinyvec' 27 | # version = '1.5.1' 28 | # crates-io = true 29 | # 30 | # [final-excludes] 31 | 32 | ### END HAKARI SECTION 33 | 34 | # This part of the file should be preserved at the end. 35 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'armv6k-nintendo-3ds' 14 | target-features = 'unknown' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'builddep' 17 | version = '0.1.0' 18 | workspace-path = 'builddep' 19 | 20 | [[metadata.omitted-packages.ids]] 21 | name = 'main' 22 | version = '0.1.0' 23 | workspace-path = 'main' 24 | 25 | [[host-package]] 26 | name = 'builddep' 27 | version = '0.1.0' 28 | workspace-path = 'builddep' 29 | status = 'initial' 30 | features = [] 31 | 32 | [[host-package]] 33 | name = 'main' 34 | version = '0.1.0' 35 | workspace-path = 'main' 36 | status = 'initial' 37 | features = [] 38 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'armv7s-apple-ios' 14 | target-features = 'all' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'testcycles-base' 17 | version = '0.1.0' 18 | workspace-path = '' 19 | 20 | [[metadata.omitted-packages.ids]] 21 | name = 'testcycles-helper' 22 | version = '0.1.0' 23 | path = '../testcycles-helper' 24 | 25 | [[metadata.features-only]] 26 | name = 'testcycles-base' 27 | version = '0.1.0' 28 | workspace-path = '' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'testcycles-base' 33 | version = '0.1.0' 34 | workspace-path = '' 35 | status = 'initial' 36 | features = [] 37 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle1-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'none' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['wasm32-unknown-unknown', 'x86_64-apple-tvos'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcycles-base' 12 | # version = '0.1.0' 13 | # workspace-path = '' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'testcycles-helper' 17 | # version = '0.1.0' 18 | # path = '../testcycles-helper' 19 | # [[final-excludes.ids]] 20 | # name = 'testcycles-base' 21 | # version = '0.1.0' 22 | # workspace-path = '' 23 | # 24 | # [[final-excludes.ids]] 25 | # name = 'testcycles-helper' 26 | # version = '0.1.0' 27 | # path = '../testcycles-helper' 28 | 29 | ### END HAKARI SECTION 30 | 31 | # This part of the file should be preserved at the end. 32 | -------------------------------------------------------------------------------- /guppy/README.tpl: -------------------------------------------------------------------------------- 1 | # {{crate}} 2 | 3 | [![guppy on crates.io](https://img.shields.io/crates/v/guppy)](https://crates.io/crates/guppy) [![Documentation (latest release)](https://docs.rs/guppy/badge.svg)](https://docs.rs/guppy/) [![Documentation (main)](https://img.shields.io/badge/docs-main-brightgreen)](https://facebookincubator.github.io/cargo-guppy/rustdoc/guppy/) [![License](https://img.shields.io/badge/license-Apache-green.svg)](../LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE-MIT) 4 | 5 | {{readme}} 6 | 7 | ## Contributing 8 | 9 | See the [CONTRIBUTING](../CONTRIBUTING.md) file for how to help out. 10 | 11 | ## License 12 | 13 | This project is available under the terms of either the [Apache 2.0 license](../LICENSE-APACHE) or the [MIT 14 | license](../LICENSE-MIT). 15 | 16 | 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_weak_namespaced_features-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_weak_namespaced_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['x86_64-apple-ios', 'mips64el-unknown-linux-muslabi64'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'arrayvec' 12 | # version = '0.7.2' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'namespaced-weak' 17 | # version = '0.1.0' 18 | # workspace-path = '' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'pathdiff' 22 | # version = '0.2.1' 23 | # crates-io = true 24 | # [[final-excludes.ids]] 25 | # name = 'arrayvec' 26 | # version = '0.7.2' 27 | # crates-io = true 28 | 29 | ### END HAKARI SECTION 30 | 31 | # This part of the file should be preserved at the end. 32 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-unknown-linux-musl' 11 | target-features = 'all' 12 | 13 | [metadata.target-platform] 14 | spec = 'any' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'lower-a' 17 | version = '0.1.0' 18 | workspace-path = 'lower-a' 19 | 20 | [[metadata.features-only]] 21 | name = 'upper-b' 22 | version = '0.1.0' 23 | workspace-path = 'upper-b' 24 | features = [] 25 | 26 | [[target-package]] 27 | name = 'upper-a' 28 | version = '0.1.0' 29 | workspace-path = 'upper-a' 30 | status = 'initial' 31 | features = [] 32 | 33 | [[target-package]] 34 | name = 'upper-b' 35 | version = '0.1.0' 36 | workspace-path = 'upper-b' 37 | status = 'initial' 38 | features = [] 39 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_builddep-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_builddep 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['powerpc-unknown-netbsd', 'mipsisa64r6el-unknown-linux-gnuabi64', 'i686-unknown-openbsd'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'builddep' 12 | # version = '0.1.0' 13 | # workspace-path = 'builddep' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'main' 17 | # version = '0.1.0' 18 | # workspace-path = 'main' 19 | # [[final-excludes.ids]] 20 | # name = 'builddep' 21 | # version = '0.1.0' 22 | # workspace-path = 'builddep' 23 | # 24 | # [[final-excludes.ids]] 25 | # name = 'main' 26 | # version = '0.1.0' 27 | # workspace-path = 'main' 28 | 29 | ### END HAKARI SECTION 30 | 31 | # This part of the file should be preserved at the end. 32 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_targets1-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['i686-unknown-haiku', 'armv5te-unknown-linux-gnueabi', 'powerpc-wrs-vxworks-spe'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'dep-a' 12 | # version = '0.1.0' 13 | # path = '../dep-a' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'lazy_static' 17 | # version = '1.4.0' 18 | # crates-io = true 19 | # [[final-excludes.ids]] 20 | # name = 'lazy_static' 21 | # version = '0.2.11' 22 | # crates-io = true 23 | 24 | [dependencies] 25 | bytes = { version = "0.5", features = ["serde", "std"] } 26 | serde = { version = "1", features = ["std"] } 27 | 28 | ### END HAKARI SECTION 29 | 30 | # This part of the file should be preserved at the end. 31 | -------------------------------------------------------------------------------- /tools/hakari/README.tpl: -------------------------------------------------------------------------------- 1 | # {{crate}} 2 | 3 | [![hakari on crates.io](https://img.shields.io/crates/v/hakari)](https://crates.io/crates/hakari) [![Documentation (latest release)](https://docs.rs/hakari/badge.svg)](https://docs.rs/hakari/) [![Documentation (main)](https://img.shields.io/badge/docs-main-brightgreen)](https://facebookincubator.github.io/cargo-guppy/rustdoc/hakari/) [![License](https://img.shields.io/badge/license-Apache-green.svg)](../../LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-green.svg)](../../LICENSE-MIT) 4 | 5 | {{readme}} 6 | 7 | ## Contributing 8 | 9 | See the [CONTRIBUTING](../../CONTRIBUTING.md) file for how to help out. 10 | 11 | ## License 12 | 13 | This project is available under the terms of either the [Apache 2.0 license](../../LICENSE-APACHE) or the [MIT 14 | license](../../LICENSE-MIT). 15 | 16 | 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_proc_macro1-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_proc_macro1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['x86_64-fortanix-unknown-sgx', 'armv7r-none-eabi', 'armv7-wrs-vxworks-eabihf'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'dev-user' 12 | # version = '0.1.0' 13 | # workspace-path = 'dev-user' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'macro' 17 | # version = '0.1.0' 18 | # workspace-path = 'macro' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'normal-user' 22 | # version = '0.1.0' 23 | # workspace-path = 'normal-user' 24 | # [[final-excludes.ids]] 25 | # name = 'macro' 26 | # version = '0.1.0' 27 | # workspace-path = 'macro' 28 | 29 | ### END HAKARI SECTION 30 | 31 | # This part of the file should be preserved at the end. 32 | -------------------------------------------------------------------------------- /internal-tools/cargo-compare/src/type_conversions.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Type conversions between cargo and guppy. 5 | 6 | use std::collections::BTreeSet; 7 | 8 | pub trait ToGuppy { 9 | type Guppy; 10 | 11 | fn to_guppy(&self) -> Self::Guppy; 12 | } 13 | 14 | impl ToGuppy for cargo::core::PackageId { 15 | type Guppy = guppy::PackageId; 16 | 17 | fn to_guppy(&self) -> Self::Guppy { 18 | // This is the same format as the Serialize impl of cargo's PackageId. 19 | guppy::PackageId::new(format!( 20 | "{} {} ({})", 21 | self.name(), 22 | self.version(), 23 | self.source_id().as_url(), 24 | )) 25 | } 26 | } 27 | 28 | impl ToGuppy for Vec { 29 | type Guppy = BTreeSet; 30 | 31 | fn to_guppy(&self) -> Self::Guppy { 32 | self.iter().map(|s| s.to_string()).collect() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-pc-solaris' 11 | target-features = [] 12 | flags = ['abc'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | 17 | [[metadata.features-only]] 18 | name = 'macro' 19 | version = '0.1.0' 20 | workspace-path = 'macro' 21 | features = [] 22 | 23 | [[host-package]] 24 | name = 'build-user' 25 | version = '0.1.0' 26 | workspace-path = 'build-user' 27 | status = 'initial' 28 | features = [] 29 | 30 | [[host-package]] 31 | name = 'dev-user' 32 | version = '0.1.0' 33 | workspace-path = 'dev-user' 34 | status = 'initial' 35 | features = [] 36 | 37 | [[host-package]] 38 | name = 'macro' 39 | version = '0.1.0' 40 | workspace-path = 'macro' 41 | status = 'initial' 42 | features = [] 43 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-uwp-windows-msvc' 11 | target-features = 'all' 12 | 13 | [metadata.target-platform] 14 | spec = 'any' 15 | 16 | [[metadata.features-only]] 17 | name = 'normal-user' 18 | version = '0.1.0' 19 | workspace-path = 'normal-user' 20 | features = [] 21 | 22 | [[host-package]] 23 | name = 'dev-user' 24 | version = '0.1.0' 25 | workspace-path = 'dev-user' 26 | status = 'initial' 27 | features = [] 28 | 29 | [[host-package]] 30 | name = 'macro' 31 | version = '0.1.0' 32 | workspace-path = 'macro' 33 | status = 'initial' 34 | features = [] 35 | 36 | [[host-package]] 37 | name = 'normal-user' 38 | version = '0.1.0' 39 | workspace-path = 'normal-user' 40 | status = 'initial' 41 | features = [] 42 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle_features-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['x86_64-fuchsia', 'mips64-openwrt-linux-musl'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'testcycles-base' 12 | # version = '0.1.0' 13 | # workspace-path = 'testcycles-base' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'testcycles-helper' 17 | # version = '0.1.0' 18 | # workspace-path = 'testcycles-helper' 19 | # [[final-excludes.ids]] 20 | # name = 'testcycles-base' 21 | # version = '0.1.0' 22 | # workspace-path = 'testcycles-base' 23 | # 24 | # [[final-excludes.ids]] 25 | # name = 'testcycles-helper' 26 | # version = '0.1.0' 27 | # workspace-path = 'testcycles-helper' 28 | 29 | ### END HAKARI SECTION 30 | 31 | # This part of the file should be preserved at the end. 32 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'riscv64gc-unknown-freebsd' 11 | target-features = 'all' 12 | 13 | [metadata.target-platform] 14 | spec = 'always' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'proc-macro2' 17 | version = '1.0.29' 18 | source = 'registry+https://github.com/fakeorg/crates.io-index' 19 | 20 | [[metadata.features-only]] 21 | name = 'debug-ignore' 22 | version = '1.0.1' 23 | workspace-path = '' 24 | features = [] 25 | 26 | [[host-package]] 27 | name = 'debug-ignore' 28 | version = '1.0.1' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = [] 32 | 33 | [[host-package]] 34 | name = 'unicode-xid' 35 | version = '0.2.2' 36 | crates-io = true 37 | status = 'direct' 38 | features = ['default'] 39 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'm68k-unknown-linux-gnu' 11 | target-features = 'unknown' 12 | flags = ['cargo_web'] 13 | 14 | [metadata.target-platform] 15 | triple = 'x86_64-unknown-dragonfly' 16 | target-features = 'all' 17 | [[metadata.omitted-packages.ids]] 18 | name = 'lazy_static' 19 | version = '1.4.0' 20 | crates-io = true 21 | 22 | [[metadata.features-only]] 23 | name = 'testcrate-dups' 24 | version = '0.1.0' 25 | workspace-path = '' 26 | features = [] 27 | 28 | [[host-package]] 29 | name = 'testcrate-dups' 30 | version = '0.1.0' 31 | workspace-path = '' 32 | status = 'initial' 33 | features = [] 34 | 35 | [[host-package]] 36 | name = 'bytes' 37 | version = '0.5.4' 38 | crates-io = true 39 | status = 'direct' 40 | features = ['default', 'std'] 41 | -------------------------------------------------------------------------------- /guppy-summaries/README.tpl: -------------------------------------------------------------------------------- 1 | # {{crate}} 2 | 3 | [![guppy-summaries on crates.io](https://img.shields.io/crates/v/guppy-summaries)](https://crates.io/crates/guppy-summaries) [![Documentation (latest release)](https://docs.rs/guppy-summaries/badge.svg)](https://docs.rs/guppy-summaries/) [![Documentation (main)](https://img.shields.io/badge/docs-main-brightgreen)](https://facebookincubator.github.io/cargo-guppy/rustdoc/guppy_summaries/) [![License](https://img.shields.io/badge/license-Apache-green.svg)](../LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE-MIT) 4 | 5 | {{readme}} 6 | 7 | ## Contributing 8 | 9 | See the [CONTRIBUTING](../CONTRIBUTING.md) file for how to help out. 10 | 11 | ## License 12 | 13 | This project is available under the terms of either the [Apache 2.0 license](../LICENSE-APACHE) or the [MIT 14 | license](../LICENSE-MIT). 15 | 16 | 22 | -------------------------------------------------------------------------------- /tools/cargo-hakari/README.tpl: -------------------------------------------------------------------------------- 1 | # {{crate}} 2 | 3 | [![cargo-hakari on crates.io](https://img.shields.io/crates/v/cargo-hakari)](https://crates.io/crates/cargo-hakari) [![Documentation (latest release)](https://docs.rs/cargo-hakari/badge.svg)](https://docs.rs/cargo-hakari/) [![Documentation (main)](https://img.shields.io/badge/docs-main-brightgreen)](https://facebookincubator.github.io/cargo-guppy/rustdoc/cargo_hakari/) [![License](https://img.shields.io/badge/license-Apache-green.svg)](../../LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-green.svg)](../../LICENSE-MIT) 4 | 5 | {{readme}} 6 | 7 | ## Contributing 8 | 9 | See the [CONTRIBUTING](../../CONTRIBUTING.md) file for how to help out. 10 | 11 | ## License 12 | 13 | This project is available under the terms of either the [Apache 2.0 license](../../LICENSE-APACHE) or the [MIT 14 | license](../../LICENSE-MIT). 15 | 16 | 22 | -------------------------------------------------------------------------------- /tools/determinator/README.tpl: -------------------------------------------------------------------------------- 1 | # {{crate}} 2 | 3 | [![determinator on crates.io](https://img.shields.io/crates/v/determinator)](https://crates.io/crates/determinator) [![Documentation (latest release)](https://docs.rs/determinator/badge.svg)](https://docs.rs/determinator/) [![Documentation (main)](https://img.shields.io/badge/docs-main-brightgreen)](https://facebookincubator.github.io/cargo-guppy/rustdoc/determinator/) [![License](https://img.shields.io/badge/license-Apache-green.svg)](../../LICENSE-APACHE) [![License](https://img.shields.io/badge/license-MIT-green.svg)](../../LICENSE-MIT) 4 | 5 | {{readme}} 6 | 7 | ## Contributing 8 | 9 | See the [CONTRIBUTING](../../CONTRIBUTING.md) file for how to help out. 10 | 11 | ## License 12 | 13 | This project is available under the terms of either the [Apache 2.0 license](../../LICENSE-APACHE) or the [MIT 14 | license](../../LICENSE-MIT). 15 | 16 | 22 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_proc_macro1-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_proc_macro1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['aarch64-wrs-vxworks', 'x86_64-wrs-vxworks', 'powerpc-wrs-vxworks'] 10 | # 11 | # [traversal-excludes] 12 | # [[final-excludes.ids]] 13 | # name = 'build-user' 14 | # version = '0.1.0' 15 | # workspace-path = 'build-user' 16 | # 17 | # [[final-excludes.ids]] 18 | # name = 'dev-user' 19 | # version = '0.1.0' 20 | # workspace-path = 'dev-user' 21 | # 22 | # [[final-excludes.ids]] 23 | # name = 'macro' 24 | # version = '0.1.0' 25 | # workspace-path = 'macro' 26 | # 27 | # [[final-excludes.ids]] 28 | # name = 'normal-user' 29 | # version = '0.1.0' 30 | # workspace-path = 'normal-user' 31 | 32 | ### END HAKARI SECTION 33 | 34 | # This part of the file should be preserved at the end. 35 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle1-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-apple-darwin' 11 | target-features = 'unknown' 12 | flags = ['cargo_web'] 13 | 14 | [metadata.target-platform] 15 | triple = 'riscv32i-unknown-none-elf' 16 | target-features = [] 17 | flags = ['foo'] 18 | [[metadata.omitted-packages.ids]] 19 | name = 'testcycles-base' 20 | version = '0.1.0' 21 | workspace-path = '' 22 | 23 | [[metadata.omitted-packages.ids]] 24 | name = 'testcycles-helper' 25 | version = '0.1.0' 26 | path = '../testcycles-helper' 27 | 28 | [[metadata.features-only]] 29 | name = 'testcycles-base' 30 | version = '0.1.0' 31 | workspace-path = '' 32 | features = [] 33 | 34 | [[target-package]] 35 | name = 'testcycles-base' 36 | version = '0.1.0' 37 | workspace-path = '' 38 | status = 'initial' 39 | features = [] 40 | -------------------------------------------------------------------------------- /fixtures/guppy/summaries/metadata_guppy_44b62fa-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_guppy_44b62fa 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'powerpc-unknown-openbsd' 11 | target-features = ['avx2', 'bmi2', 'fma', 'sse', 'sse3', 'xsaveopt'] 12 | flags = ['foo'] 13 | 14 | [metadata.target-platform] 15 | triple = 'riscv32imc-esp-espidf' 16 | target-features = 'unknown' 17 | flags = ['abc', 'foo'] 18 | 19 | [[metadata.features-only]] 20 | name = 'guppy-benchmarks' 21 | version = '0.1.0' 22 | workspace-path = 'internal-tools/benchmarks' 23 | features = [] 24 | 25 | [[metadata.features-only]] 26 | name = 'guppy-summaries' 27 | version = '0.6.1' 28 | workspace-path = 'guppy-summaries' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'cargo-guppy' 33 | version = '0.1.0' 34 | workspace-path = 'cargo-guppy' 35 | status = 'initial' 36 | features = [] 37 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/main/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "main" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | build = "build.rs" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | external = { path = "../../external" } 12 | internal = { path = "../internal" } 13 | 14 | [build-dependencies] 15 | external = { path = "../../external", features = ["main-build-feature"] } 16 | internal = { path = "../internal", features = ["build-feature"] } 17 | internal-macro = { path = "../internal-macro", features = ["main-build-feature"] } 18 | 19 | [dev-dependencies] 20 | external = { path = "../../external", features = ["main-dev-feature"] } 21 | internal = { path = "../internal", features = ["dev-feature"] } 22 | 23 | [target.'cfg(all(unix, not(unix)))'.build-dependencies] 24 | inactive = { path = "../../inactive", optional = true } 25 | 26 | [features] 27 | default = ["inactive"] 28 | inactive-extra = ["inactive/extra"] 29 | -------------------------------------------------------------------------------- /guppy/src/debug_ignore.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Contains `DebugIgnore`, a newtype wrapper that causes a field to be ignored while printing 5 | //! out `Debug` output. 6 | 7 | use std::{ 8 | fmt, 9 | ops::{Deref, DerefMut}, 10 | }; 11 | 12 | /// A newtype wrapper that causes this field to be ignored while printing out `Debug` output. 13 | /// 14 | /// Similar to `#[derivative(ignore)]`, but avoids an extra dependency. 15 | #[derive(Copy, Clone, Eq, Hash, Ord, PartialEq, PartialOrd)] 16 | pub struct DebugIgnore(pub T); 17 | 18 | impl Deref for DebugIgnore { 19 | type Target = T; 20 | 21 | fn deref(&self) -> &Self::Target { 22 | &self.0 23 | } 24 | } 25 | 26 | impl DerefMut for DebugIgnore { 27 | fn deref_mut(&mut self) -> &mut Self::Target { 28 | &mut self.0 29 | } 30 | } 31 | 32 | impl fmt::Debug for DebugIgnore { 33 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 34 | write!(f, "...") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_weak_namespaced_features-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_weak_namespaced_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['sparcv9-sun-solaris', 'riscv32imc-unknown-none-elf', 'powerpc64le-unknown-linux-gnu'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'arrayvec' 12 | # version = '0.7.2' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'smallvec' 17 | # version = '1.8.0' 18 | # crates-io = true 19 | # [[final-excludes.ids]] 20 | # name = 'smallvec' 21 | # version = '1.8.0' 22 | # crates-io = true 23 | 24 | [dependencies] 25 | pathdiff = { version = "0.2", default-features = false } 26 | 27 | [build-dependencies] 28 | pathdiff = { version = "0.2", default-features = false } 29 | 30 | ### END HAKARI SECTION 31 | 32 | # This part of the file should be preserved at the end. 33 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_weak_namespaced_features-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_weak_namespaced_features 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'x86_64-pc-windows-msvc' 14 | target-features = ['avx2'] 15 | [[metadata.omitted-packages.ids]] 16 | name = 'namespaced-weak' 17 | version = '0.1.0' 18 | workspace-path = '' 19 | 20 | [[metadata.omitted-packages.ids]] 21 | name = 'pathdiff' 22 | version = '0.2.1' 23 | crates-io = true 24 | 25 | [[metadata.omitted-packages.ids]] 26 | name = 'tinyvec' 27 | version = '1.5.1' 28 | crates-io = true 29 | 30 | [[metadata.features-only]] 31 | name = 'namespaced-weak' 32 | version = '0.1.0' 33 | workspace-path = '' 34 | features = [] 35 | 36 | [[host-package]] 37 | name = 'namespaced-weak' 38 | version = '0.1.0' 39 | workspace-path = '' 40 | status = 'initial' 41 | features = [] 42 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | 6 | name: Docs 7 | 8 | jobs: 9 | docs: 10 | name: Build and deploy documentation 11 | concurrency: ci-${{ github.ref }} 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions-rs/toolchain@v1 16 | with: 17 | toolchain: nightly 18 | override: true 19 | - uses: Swatinem/rust-cache@c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c 20 | - name: Build rustdoc 21 | # cargo-compare currently pulls in cargo which bloats build times massively 22 | run: | 23 | RUSTDOCFLAGS='--cfg=doc_cfg' cargo doc --all-features --workspace --exclude cargo-compare 24 | - name: Organize 25 | run: | 26 | rm -rf target/gh-pages 27 | mkdir target/gh-pages 28 | mv target/doc target/gh-pages/rustdoc 29 | - name: Deploy 30 | uses: JamesIves/github-pages-deploy-action@releases/v4 31 | with: 32 | branch: gh-pages 33 | folder: target/gh-pages 34 | -------------------------------------------------------------------------------- /.github/workflows/hakari.yml: -------------------------------------------------------------------------------- 1 | # This workflow file serves as an example for cargo-hakari CI integration. 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | name: cargo hakari 12 | 13 | jobs: 14 | workspace-hack-check: 15 | name: Check workspace-hack 16 | runs-on: ubuntu-latest 17 | env: 18 | RUSTFLAGS: -D warnings 19 | steps: 20 | - uses: actions/checkout@v2 21 | - uses: actions-rs/toolchain@v1 22 | with: 23 | toolchain: stable 24 | - name: Install cargo-hakari 25 | uses: baptiste0928/cargo-install@v1 26 | with: 27 | crate: cargo-hakari 28 | version: 0.9 29 | - name: Check workspace-hack Cargo.toml is up-to-date 30 | uses: actions-rs/cargo@v1 31 | with: 32 | command: hakari 33 | args: generate --diff 34 | - name: Check all crates depend on workspace-hack 35 | uses: actions-rs/cargo@v1 36 | with: 37 | command: hakari 38 | args: manage-deps --dry-run 39 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'i386-apple-ios' 14 | target-features = 'unknown' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'proc-macro2' 17 | version = '1.0.29' 18 | source = 'registry+https://github.com/fakeorg/crates.io-index' 19 | 20 | [[metadata.omitted-packages.ids]] 21 | name = 'serde' 22 | version = '1.0.130' 23 | source = 'registry+https://github.com/fakeorg/crates.io-index' 24 | 25 | [[host-package]] 26 | name = 'debug-ignore' 27 | version = '1.0.1' 28 | workspace-path = '' 29 | status = 'initial' 30 | features = ['serde'] 31 | optional-deps = ['serde'] 32 | 33 | [[host-package]] 34 | name = 'unicode-xid' 35 | version = '0.2.2' 36 | crates-io = true 37 | status = 'direct' 38 | features = ['default'] 39 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'aarch64-unknown-netbsd' 11 | target-features = 'unknown' 12 | flags = ['cargo_web', 'test-flag'] 13 | 14 | [metadata.target-platform] 15 | triple = 'thumbv7neon-unknown-linux-musleabihf' 16 | target-features = 'all' 17 | flags = ['abc', 'flag-test'] 18 | [[metadata.omitted-packages.ids]] 19 | name = 'builddep' 20 | version = '0.1.0' 21 | workspace-path = 'builddep' 22 | 23 | [[metadata.omitted-packages.ids]] 24 | name = 'main' 25 | version = '0.1.0' 26 | workspace-path = 'main' 27 | 28 | [[target-package]] 29 | name = 'builddep' 30 | version = '0.1.0' 31 | workspace-path = 'builddep' 32 | status = 'initial' 33 | features = [] 34 | 35 | [[target-package]] 36 | name = 'main' 37 | version = '0.1.0' 38 | workspace-path = 'main' 39 | status = 'initial' 40 | features = [] 41 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | triple = 'armv5te-unknown-linux-uclibceabi' 14 | target-features = ['fma', 'rdrand', 'sha'] 15 | flags = ['flag-test'] 16 | [[metadata.omitted-packages.ids]] 17 | name = 'testcycles-base' 18 | version = '0.1.0' 19 | workspace-path = 'testcycles-base' 20 | 21 | [[metadata.features-only]] 22 | name = 'testcycles-base' 23 | version = '0.1.0' 24 | workspace-path = 'testcycles-base' 25 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 26 | 27 | [[target-package]] 28 | name = 'testcycles-base' 29 | version = '0.1.0' 30 | workspace-path = 'testcycles-base' 31 | status = 'initial' 32 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 33 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_dups-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_dups 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'none' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['armv5te-unknown-linux-musleabi'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'bytes' 12 | # version = '0.3.0' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'testcrate-dups' 17 | # version = '0.1.0' 18 | # workspace-path = '' 19 | # [[final-excludes.ids]] 20 | # name = 'bytes' 21 | # version = '0.3.0' 22 | # crates-io = true 23 | # 24 | # [[final-excludes.ids]] 25 | # name = 'bytes' 26 | # version = '0.5.4' 27 | # crates-io = true 28 | # 29 | # [[final-excludes.ids]] 30 | # name = 'lazy_static' 31 | # version = '0.2.11' 32 | # crates-io = true 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'testcrate-dups' 36 | # version = '0.1.0' 37 | # workspace-path = '' 38 | 39 | ### END HAKARI SECTION 40 | 41 | # This part of the file should be preserved at the end. 42 | -------------------------------------------------------------------------------- /target-spec/README.tpl: -------------------------------------------------------------------------------- 1 | # {{crate}} 2 | 3 | [![target-spec on crates.io](https://img.shields.io/crates/v/target-spec)](https://crates.io/crates/target-spec) 4 | [![Documentation (latest release)](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://docs.rs/target-spec/) 5 | [![Documentation (main)](https://img.shields.io/badge/docs-main-purple)](https://facebookincubator.github.io/cargo-guppy/rustdoc/target_spec/) 6 | [![Changelog](https://img.shields.io/badge/changelog-latest-blue)](CHANGELOG.md) 7 | [![License](https://img.shields.io/badge/license-Apache-green.svg)](../LICENSE-APACHE) 8 | [![License](https://img.shields.io/badge/license-MIT-green.svg)](../LICENSE-MIT) 9 | 10 | {{readme}} 11 | 12 | ## Contributing 13 | 14 | See the [CONTRIBUTING](../CONTRIBUTING.md) file for how to help out. 15 | 16 | ## License 17 | 18 | This project is available under the terms of either the [Apache 2.0 license](../LICENSE-APACHE) or the [MIT 19 | license](../LICENSE-MIT). 20 | 21 | 27 | -------------------------------------------------------------------------------- /fixtures/guppy/summaries/metadata_guppy_44b62fa-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_guppy_44b62fa 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'armebv7r-none-eabi' 11 | target-features = 'unknown' 12 | flags = ['bar', 'cargo_web'] 13 | 14 | [metadata.target-platform] 15 | triple = 'msp430-none-elf' 16 | target-features = [] 17 | flags = ['flag-test'] 18 | 19 | [[metadata.features-only]] 20 | name = 'cargo-guppy' 21 | version = '0.1.0' 22 | workspace-path = 'cargo-guppy' 23 | features = [] 24 | 25 | [[metadata.features-only]] 26 | name = 'guppy-benchmarks' 27 | version = '0.1.0' 28 | workspace-path = 'internal-tools/benchmarks' 29 | features = [] 30 | 31 | [[metadata.features-only]] 32 | name = 'guppy-summaries' 33 | version = '0.6.1' 34 | workspace-path = 'guppy-summaries' 35 | features = [] 36 | 37 | [[host-package]] 38 | name = 'cargo-guppy' 39 | version = '0.1.0' 40 | workspace-path = 'cargo-guppy' 41 | status = 'initial' 42 | features = [] 43 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'i686-uwp-windows-gnu' 11 | target-features = 'all' 12 | flags = ['cargo_web', 'foo'] 13 | 14 | [metadata.target-platform] 15 | triple = 'i686-pc-windows-gnu' 16 | target-features = 'unknown' 17 | flags = ['cargo_web', 'foo'] 18 | [[metadata.omitted-packages.ids]] 19 | name = 'testcycles-base' 20 | version = '0.1.0' 21 | workspace-path = 'testcycles-base' 22 | 23 | [[metadata.omitted-packages.ids]] 24 | name = 'testcycles-helper' 25 | version = '0.1.0' 26 | workspace-path = 'testcycles-helper' 27 | 28 | [[metadata.features-only]] 29 | name = 'testcycles-helper' 30 | version = '0.1.0' 31 | workspace-path = 'testcycles-helper' 32 | features = [] 33 | 34 | [[target-package]] 35 | name = 'testcycles-base' 36 | version = '0.1.0' 37 | workspace-path = 'testcycles-base' 38 | status = 'initial' 39 | features = [] 40 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'powerpc-unknown-freebsd' 14 | target-features = 'all' 15 | flags = ['test-flag'] 16 | [[metadata.omitted-packages.ids]] 17 | name = 'lazy_static' 18 | version = '0.2.11' 19 | crates-io = true 20 | 21 | [[metadata.features-only]] 22 | name = 'testcrate-dups' 23 | version = '0.1.0' 24 | workspace-path = '' 25 | features = [] 26 | 27 | [[target-package]] 28 | name = 'testcrate-dups' 29 | version = '0.1.0' 30 | workspace-path = '' 31 | status = 'initial' 32 | features = [] 33 | 34 | [[target-package]] 35 | name = 'bytes' 36 | version = '0.5.4' 37 | crates-io = true 38 | status = 'direct' 39 | features = ['default', 'std'] 40 | 41 | [[target-package]] 42 | name = 'lazy_static' 43 | version = '1.4.0' 44 | crates-io = true 45 | status = 'direct' 46 | features = [] 47 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_alternate_registries-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_alternate_registries 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'none' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['armv7s-apple-ios', 'powerpc64le-unknown-linux-musl', 'powerpc64-unknown-linux-gnu'] 10 | # 11 | # [traversal-excludes] 12 | # [[final-excludes.ids]] 13 | # name = 'debug-ignore' 14 | # version = '1.0.1' 15 | # workspace-path = '' 16 | # 17 | # [[final-excludes.ids]] 18 | # name = 'ryu' 19 | # version = '1.0.5' 20 | # crates-io = true 21 | # 22 | # [[final-excludes.ids]] 23 | # name = 'serde_derive' 24 | # version = '1.0.130' 25 | # source = 'registry+https://github.com/fakeorg/crates.io-index' 26 | # 27 | # [[final-excludes.ids]] 28 | # name = 'unicode-xid' 29 | # version = '0.2.2' 30 | # crates-io = true 31 | # [registries.my-registry] 32 | # index = 'https://github.com/fakeorg/crates.io-index' 33 | 34 | ### END HAKARI SECTION 35 | 36 | # This part of the file should be preserved at the end. 37 | -------------------------------------------------------------------------------- /internal-tools/cargo-compare/proptest-regressions/tests/workspace_tests.txt: -------------------------------------------------------------------------------- 1 | # cargo-compare detected behavior differences with x86_64-linux-kernel and cfg-expr 0.4.1. Version 0.5.0 fixes this. 2 | cc dcfe17be3577aec645724cb519635e2561c1c38501e77743d6f13e241998a080 3 | cc aebdbdcc35a3cdce564310440f34ba71081dde62bca995c83d5a36bff52cc6e5 # shrinks to common = GuppyCargoCommon { pf: PackagesAndFeatures { packages: [], features_only: [], features: [], all_features: false, no_default_features: true }, include_dev: false, v2: false, target_platform: None, metadata_opts: CargoMetadataOptions { manifest_path: Some("/home/rain/dev/cargo-guppy/internal-tools/cargo-compare/../../fixtures/workspace/inside-outside/workspace/Cargo.toml") } } 4 | cc ef18a893130ae4f9253d94be4bc2783e35ceff91bf4c873a20c303fd167e8346 # shrinks to common = GuppyCargoCommon { pf: PackagesAndFeatures { packages: [], features_only: [], features: [], all_features: false, no_default_features: false }, include_dev: false, v2: true, target_platform: Some("x86_64-unknown-none-hermitkernel"), metadata_opts: CargoMetadataOptions { manifest_path: Some("/home/rain/dev/cargo-guppy/internal-tools/cargo-compare/./Cargo.toml") } } 5 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) The cargo-guppy Contributors 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_weak_namespaced_features-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_weak_namespaced_features 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'arrayvec' 12 | # version = '0.7.2' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'namespaced-weak' 17 | # version = '0.1.0' 18 | # workspace-path = '' 19 | # [[final-excludes.ids]] 20 | # name = 'namespaced-weak' 21 | # version = '0.1.0' 22 | # workspace-path = '' 23 | # 24 | # [[final-excludes.ids]] 25 | # name = 'pathdiff' 26 | # version = '0.2.1' 27 | # crates-io = true 28 | # 29 | # [[final-excludes.ids]] 30 | # name = 'smallvec' 31 | # version = '1.8.0' 32 | # crates-io = true 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'tinyvec' 36 | # version = '1.5.1' 37 | # crates-io = true 38 | 39 | ### END HAKARI SECTION 40 | 41 | # This part of the file should be preserved at the end. 42 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'riscv32gc-unknown-linux-musl' 11 | target-features = ['ssse3', 'xsaves'] 12 | flags = ['cargo_web', 'foo'] 13 | 14 | [metadata.target-platform] 15 | triple = 'x86_64-unknown-linux-gnu' 16 | target-features = 'unknown' 17 | flags = ['test-flag'] 18 | 19 | [[target-package]] 20 | name = 'build-user' 21 | version = '0.1.0' 22 | workspace-path = 'build-user' 23 | status = 'initial' 24 | features = [] 25 | 26 | [[target-package]] 27 | name = 'macro' 28 | version = '0.1.0' 29 | workspace-path = 'macro' 30 | status = 'initial' 31 | features = [] 32 | 33 | [[target-package]] 34 | name = 'normal-user' 35 | version = '0.1.0' 36 | workspace-path = 'normal-user' 37 | status = 'initial' 38 | features = [] 39 | 40 | [[host-package]] 41 | name = 'macro' 42 | version = '0.1.0' 43 | workspace-path = 'macro' 44 | status = 'initial' 45 | features = [] 46 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle2-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle2 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['powerpc-unknown-netbsd'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'lower-a' 12 | # version = '0.1.0' 13 | # workspace-path = 'lower-a' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'lower-b' 17 | # version = '0.1.0' 18 | # workspace-path = 'lower-b' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'upper-a' 22 | # version = '0.1.0' 23 | # workspace-path = 'upper-a' 24 | # [[final-excludes.ids]] 25 | # name = 'lower-b' 26 | # version = '0.1.0' 27 | # workspace-path = 'lower-b' 28 | # 29 | # [[final-excludes.ids]] 30 | # name = 'upper-a' 31 | # version = '0.1.0' 32 | # workspace-path = 'upper-a' 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'upper-b' 36 | # version = '0.1.0' 37 | # workspace-path = 'upper-b' 38 | 39 | ### END HAKARI SECTION 40 | 41 | # This part of the file should be preserved at the end. 42 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_weak_namespaced_features-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_weak_namespaced_features 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'mips-unknown-linux-uclibc' 11 | target-features = 'unknown' 12 | 13 | [metadata.target-platform] 14 | triple = 'arm-unknown-linux-musleabi' 15 | target-features = ['xsave', 'xsavec', 'xsaves'] 16 | flags = ['bar', 'cargo_web'] 17 | [[metadata.omitted-packages.ids]] 18 | name = 'arrayvec' 19 | version = '0.7.2' 20 | crates-io = true 21 | 22 | [[metadata.omitted-packages.ids]] 23 | name = 'namespaced-weak' 24 | version = '0.1.0' 25 | workspace-path = '' 26 | 27 | [[metadata.omitted-packages.ids]] 28 | name = 'pathdiff' 29 | version = '0.2.1' 30 | crates-io = true 31 | 32 | [[metadata.features-only]] 33 | name = 'namespaced-weak' 34 | version = '0.1.0' 35 | workspace-path = '' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'namespaced-weak' 40 | version = '0.1.0' 41 | workspace-path = '' 42 | status = 'initial' 43 | features = [] 44 | -------------------------------------------------------------------------------- /fixtures/workspace/inside-outside/workspace/internal/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "internal" 3 | version = "0.1.0" 4 | authors = ["Fake Author "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | lazy_static = "1" 11 | external = { path = "../../external" } 12 | internal-macro = { path = "../internal-macro", features = ["internal-normal-feature"] } 13 | 14 | [dev-dependencies] 15 | lazy_static = {version = "1", features = ["spin"] } 16 | bytes = "0.5" 17 | external = { path = "../../external", features = ["internal-dev-feature"] } 18 | 19 | [build-dependencies] 20 | external = { path = "../../external", features = ["internal-build-feature"] } 21 | 22 | [target.'cfg(target_arch = "x86")'.dependencies] 23 | x86-active = { path = "../../x86-active", optional = true } 24 | 25 | [target.'cfg(target_arch = "aarch64")'.dependencies] 26 | aarch64-active = { path = "../../aarch64-active", optional = true } 27 | 28 | [features] 29 | default = [] 30 | extra = ["x86-active/extra"] 31 | extra2 = ["aarch64-active", "aarch64-active/extra"] 32 | dev-feature = [] 33 | build-feature = [] 34 | -------------------------------------------------------------------------------- /target-spec/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "target-spec" 3 | version = "1.1.0" 4 | description = "Evaluate Cargo.toml target specifications" 5 | documentation = "https://docs.rs/target-spec" 6 | repository = "https://github.com/facebookincubator/cargo-guppy" 7 | authors = ["Jack Moffitt ", "Rain "] 8 | license = "MIT OR Apache-2.0" 9 | readme = "README.md" 10 | keywords = ["cargo", "targets", "platforms", "os", "cpu"] 11 | categories = ["development-tools", "parser-implementations"] 12 | edition = "2021" 13 | rust-version = "1.56" 14 | 15 | [package.metadata.docs.rs] 16 | all-features = true 17 | rustdoc-args = ["--cfg=doc_cfg"] 18 | 19 | [badges] 20 | maintenance = { status = "actively-developed" } 21 | 22 | [dependencies] 23 | cfg-expr = { version = "0.10.3", features = ["targets"] } 24 | proptest = { version = "1.0.0", optional = true } 25 | serde = { version = "1.0.137", optional = true, features = ["derive"] } 26 | target-lexicon = { version = "0.12.4", features = ["std"] } 27 | guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } 28 | 29 | [dev-dependencies] 30 | toml = "0.5.9" 31 | 32 | [features] 33 | proptest1 = ["proptest"] 34 | summaries = ["serde"] 35 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'upper-a' 16 | version = '0.1.0' 17 | workspace-path = 'upper-a' 18 | 19 | [[metadata.features-only]] 20 | name = 'lower-b' 21 | version = '0.1.0' 22 | workspace-path = 'lower-b' 23 | features = [] 24 | 25 | [[metadata.features-only]] 26 | name = 'upper-b' 27 | version = '0.1.0' 28 | workspace-path = 'upper-b' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'lower-a' 33 | version = '0.1.0' 34 | workspace-path = 'lower-a' 35 | status = 'initial' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'upper-b' 40 | version = '0.1.0' 41 | workspace-path = 'upper-b' 42 | status = 'initial' 43 | features = [] 44 | 45 | [[target-package]] 46 | name = 'lower-b' 47 | version = '0.1.0' 48 | workspace-path = 'lower-b' 49 | status = 'workspace' 50 | features = [] 51 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-apple-tvos' 11 | target-features = 'all' 12 | flags = ['bar'] 13 | 14 | [metadata.target-platform] 15 | triple = 'riscv32imac-unknown-none-elf' 16 | target-features = [] 17 | flags = ['cargo_web', 'foo'] 18 | [[metadata.omitted-packages.ids]] 19 | name = 'lazy_static' 20 | version = '0.2.11' 21 | crates-io = true 22 | 23 | [[metadata.features-only]] 24 | name = 'testcrate-dups' 25 | version = '0.1.0' 26 | workspace-path = '' 27 | features = [] 28 | 29 | [[target-package]] 30 | name = 'testcrate-dups' 31 | version = '0.1.0' 32 | workspace-path = '' 33 | status = 'initial' 34 | features = [] 35 | 36 | [[target-package]] 37 | name = 'bytes' 38 | version = '0.5.4' 39 | crates-io = true 40 | status = 'direct' 41 | features = ['default', 'std'] 42 | 43 | [[target-package]] 44 | name = 'lazy_static' 45 | version = '1.4.0' 46 | crates-io = true 47 | status = 'direct' 48 | features = [] 49 | -------------------------------------------------------------------------------- /guppy-summaries/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "guppy-summaries" 3 | version = "0.7.0" 4 | description = "Build summaries for Cargo, created by guppy." 5 | documentation = "https://docs.rs/guppy-summaries" 6 | repository = "https://github.com/facebookincubator/cargo-guppy" 7 | authors = ["Rain "] 8 | license = "MIT OR Apache-2.0" 9 | readme = "README.md" 10 | keywords = ["cargo", "dependencies", "guppy", "summaries"] 11 | categories = ["config", "data-structures", "development-tools", "parser-implementations"] 12 | edition = "2021" 13 | exclude = [ 14 | # Readme template that doesn't need to be included. 15 | "README.tpl", 16 | ] 17 | rust-version = "1.56" 18 | 19 | [package.metadata.docs.rs] 20 | all-features = true 21 | 22 | [dependencies] 23 | camino = { version = "1.0.9", features = ["serde1"] } 24 | cfg-if = "1.0.0" 25 | diffus = "0.10.0" 26 | toml = { version = "0.5.9", features = ["preserve_order"] } 27 | semver = { version = "1.0.13", features = ["serde"] } 28 | serde = { version = "1.0.137", features = ["derive"] } 29 | guppy-workspace-hack = { version = "0.1", path = "../workspace-hack" } 30 | 31 | [dev-dependencies] 32 | indoc = "1.0.6" 33 | pretty_assertions = "1.2.1" 34 | serde_json = "1.0.81" 35 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'wasm32-wasi' 11 | target-features = 'all' 12 | 13 | [metadata.target-platform] 14 | spec = 'always' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'main' 17 | version = '0.1.0' 18 | workspace-path = 'main' 19 | 20 | [[metadata.features-only]] 21 | name = 'builddep' 22 | version = '0.1.0' 23 | workspace-path = 'builddep' 24 | features = [] 25 | 26 | [[metadata.features-only]] 27 | name = 'main' 28 | version = '0.1.0' 29 | workspace-path = 'main' 30 | features = [] 31 | 32 | [[target-package]] 33 | name = 'builddep' 34 | version = '0.1.0' 35 | workspace-path = 'builddep' 36 | status = 'initial' 37 | features = [] 38 | 39 | [[target-package]] 40 | name = 'main' 41 | version = '0.1.0' 42 | workspace-path = 'main' 43 | status = 'initial' 44 | features = [] 45 | 46 | [[host-package]] 47 | name = 'builddep' 48 | version = '0.1.0' 49 | workspace-path = 'builddep' 50 | status = 'initial' 51 | features = [] 52 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | 15 | [[metadata.features-only]] 16 | name = 'testcrate-dups' 17 | version = '0.1.0' 18 | workspace-path = '' 19 | features = [] 20 | 21 | [[target-package]] 22 | name = 'testcrate-dups' 23 | version = '0.1.0' 24 | workspace-path = '' 25 | status = 'initial' 26 | features = [] 27 | 28 | [[target-package]] 29 | name = 'bytes' 30 | version = '0.3.0' 31 | crates-io = true 32 | status = 'direct' 33 | features = [] 34 | 35 | [[target-package]] 36 | name = 'bytes' 37 | version = '0.5.4' 38 | crates-io = true 39 | status = 'direct' 40 | features = ['default', 'std'] 41 | 42 | [[target-package]] 43 | name = 'lazy_static' 44 | version = '0.2.11' 45 | crates-io = true 46 | status = 'direct' 47 | features = [] 48 | 49 | [[target-package]] 50 | name = 'lazy_static' 51 | version = '1.4.0' 52 | crates-io = true 53 | status = 'direct' 54 | features = [] 55 | -------------------------------------------------------------------------------- /guppy/src/platform/proptest_helpers.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use crate::platform::{Platform, PlatformSpec, TargetFeatures}; 5 | use proptest::prelude::*; 6 | 7 | /// # Helpers for property testing 8 | /// 9 | /// The methods in this section allow a `PlatformSpec` to be used in property-based testing 10 | /// scenarios. 11 | /// 12 | /// Currently, [proptest 1](https://docs.rs/proptest/1) is supported if the `proptest1` 13 | /// feature is enabled. 14 | impl PlatformSpec { 15 | /// Returns a [`Strategy`] that generates a random `PlatformSpec` instance. 16 | pub fn strategy(platform: impl Strategy) -> impl Strategy { 17 | prop_oneof![ 18 | 1 => Just(PlatformSpec::Any), 19 | 1 => Just(PlatformSpec::Always), 20 | 2 => platform.prop_map(PlatformSpec::from), 21 | ] 22 | } 23 | } 24 | 25 | impl Arbitrary for PlatformSpec { 26 | type Parameters = (); 27 | type Strategy = BoxedStrategy; 28 | 29 | fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy { 30 | Self::strategy(Platform::strategy(any::())).boxed() 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.config/hakari.toml: -------------------------------------------------------------------------------- 1 | # This file contains settings for `cargo hakari`. 2 | # See https://docs.rs/cargo-hakari/latest/cargo_hakari/config for a full list of options. 3 | 4 | hakari-package = "guppy-workspace-hack" 5 | 6 | # Setting workspace.resolver = "2" in the root Cargo.toml is HIGHLY recommended. 7 | # Hakari works much better with the new feature resolver. 8 | # For more about the new feature resolver, see: 9 | # https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver 10 | resolver = "2" 11 | 12 | # Version of `workspace-hack = ...` lines in other `Cargo.toml` files to use. 13 | # See https://docs.rs/cargo-hakari/latest/cargo_hakari/config#dep-format-version for more. 14 | dep-format-version = "2" 15 | 16 | # Add triples corresponding to platforms commonly used by developers here. 17 | # https://doc.rust-lang.org/rustc/platform-support.html 18 | platforms = [ 19 | "x86_64-unknown-linux-gnu", 20 | "x86_64-apple-darwin", 21 | "x86_64-pc-windows-msvc", 22 | ] 23 | 24 | exact-versions = true 25 | 26 | [traversal-excludes] 27 | workspace-members = [ 28 | # Exclude the "cargo-compare" package from consideration because it is only used 29 | # for some test runs in CI. 30 | "cargo-compare", 31 | ] 32 | -------------------------------------------------------------------------------- /target-spec/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use std::{env, fs, path::Path}; 5 | 6 | fn main() { 7 | let out_dir = env::var_os("OUT_DIR").unwrap(); 8 | let dest_path = Path::new(&out_dir).join("current_platform.rs"); 9 | 10 | let target = env::var("TARGET").unwrap(); 11 | 12 | // Non-x86/amd64 platforms don't have this environment variable defined at all. 13 | let features = env::var("CARGO_CFG_TARGET_FEATURE").unwrap_or_else(|_| "".to_string()); 14 | // The features are in the format |foo,bar|. Convert to |&["foo", "bar", ]|; 15 | let mut out = vec!["&["]; 16 | for feature in features.split(',') { 17 | out.push("\""); 18 | out.push(feature); 19 | out.push("\", "); 20 | } 21 | out.push("]"); 22 | let features = out.join(""); 23 | 24 | fs::write( 25 | &dest_path, 26 | format!( 27 | "static CURRENT_TARGET: &str = \"{}\";\n\ 28 | \n\ 29 | static CURRENT_TARGET_FEATURES: &[&str] = {};\ 30 | ", 31 | target, features, 32 | ), 33 | ) 34 | .unwrap(); 35 | println!("cargo:rerun-if-changed=build.rs"); 36 | } 37 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_dups-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_dups 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['mipsisa32r6el-unknown-linux-gnu', 'i686-uwp-windows-gnu'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'bytes' 12 | # version = '0.3.0' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'bytes' 17 | # version = '0.5.4' 18 | # crates-io = true 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'lazy_static' 22 | # version = '0.2.11' 23 | # crates-io = true 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'lazy_static' 27 | # version = '1.4.0' 28 | # crates-io = true 29 | # [[final-excludes.ids]] 30 | # name = 'bytes' 31 | # version = '0.3.0' 32 | # crates-io = true 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'bytes' 36 | # version = '0.5.4' 37 | # crates-io = true 38 | # 39 | # [[final-excludes.ids]] 40 | # name = 'lazy_static' 41 | # version = '0.2.11' 42 | # crates-io = true 43 | 44 | ### END HAKARI SECTION 45 | 46 | # This part of the file should be preserved at the end. 47 | -------------------------------------------------------------------------------- /fixtures/guppy/hakari/metadata_guppy_44b62fa-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_guppy_44b62fa 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = [] 10 | # [[traversal-excludes.ids]] 11 | # name = 'guppy-cmdlib' 12 | # version = '0.1.0' 13 | # workspace-path = 'guppy-cmdlib' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'guppy-summaries' 17 | # version = '0.6.1' 18 | # workspace-path = 'guppy-summaries' 19 | # [[final-excludes.ids]] 20 | # name = 'guppy-benchmarks' 21 | # version = '0.1.0' 22 | # workspace-path = 'internal-tools/benchmarks' 23 | # 24 | # [[final-excludes.ids]] 25 | # name = 'guppy-workspace-hack' 26 | # version = '0.1.0' 27 | # workspace-path = 'workspace-hack' 28 | # 29 | # [[final-excludes.ids]] 30 | # name = 'hakari' 31 | # version = '0.8.1' 32 | # workspace-path = 'tools/hakari' 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'proptest-ext' 36 | # version = '0.1.0' 37 | # workspace-path = 'internal-tools/proptest-ext' 38 | 39 | ### END HAKARI SECTION 40 | 41 | # This part of the file should be preserved at the end. 42 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'arm-unknown-linux-gnueabihf' 11 | target-features = 'unknown' 12 | flags = ['bar', 'flag-test'] 13 | 14 | [metadata.target-platform] 15 | triple = 'armv5te-unknown-linux-musleabi' 16 | target-features = 'unknown' 17 | 18 | [[metadata.features-only]] 19 | name = 'lower-a' 20 | version = '0.1.0' 21 | workspace-path = 'lower-a' 22 | features = [] 23 | 24 | [[target-package]] 25 | name = 'lower-a' 26 | version = '0.1.0' 27 | workspace-path = 'lower-a' 28 | status = 'initial' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'lower-b' 33 | version = '0.1.0' 34 | workspace-path = 'lower-b' 35 | status = 'initial' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'upper-b' 40 | version = '0.1.0' 41 | workspace-path = 'upper-b' 42 | status = 'initial' 43 | features = [] 44 | 45 | [[target-package]] 46 | name = 'upper-a' 47 | version = '0.1.0' 48 | workspace-path = 'upper-a' 49 | status = 'workspace' 50 | features = [] 51 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_proc_macro1-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_proc_macro1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['armebv7r-none-eabi', 'armv7a-kmc-solid_asp3-eabi', 'aarch64-unknown-uefi'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'build-user' 12 | # version = '0.1.0' 13 | # workspace-path = 'build-user' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'dev-user' 17 | # version = '0.1.0' 18 | # workspace-path = 'dev-user' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'macro' 22 | # version = '0.1.0' 23 | # workspace-path = 'macro' 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'normal-user' 27 | # version = '0.1.0' 28 | # workspace-path = 'normal-user' 29 | # [[final-excludes.ids]] 30 | # name = 'build-user' 31 | # version = '0.1.0' 32 | # workspace-path = 'build-user' 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'normal-user' 36 | # version = '0.1.0' 37 | # workspace-path = 'normal-user' 38 | 39 | ### END HAKARI SECTION 40 | 41 | # This part of the file should be preserved at the end. 42 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | triple = 'armv7r-none-eabihf' 14 | target-features = [] 15 | [[metadata.omitted-packages.ids]] 16 | name = 'bytes' 17 | version = '0.5.3' 18 | crates-io = true 19 | 20 | [[metadata.omitted-packages.ids]] 21 | name = 'serde' 22 | version = '1.0.105' 23 | crates-io = true 24 | 25 | [[target-package]] 26 | name = 'testcrate-targets' 27 | version = '0.1.0' 28 | workspace-path = '' 29 | status = 'initial' 30 | features = ['bytes', 'dep-a'] 31 | optional-deps = ['bytes', 'dep-a'] 32 | 33 | [[target-package]] 34 | name = 'dep-a' 35 | version = '0.1.0' 36 | path = '../dep-a' 37 | status = 'direct' 38 | features = ['bar', 'baz', 'foo', 'quux'] 39 | 40 | [[target-package]] 41 | name = 'lazy_static' 42 | version = '0.2.11' 43 | crates-io = true 44 | status = 'direct' 45 | features = [] 46 | 47 | [[target-package]] 48 | name = 'lazy_static' 49 | version = '1.4.0' 50 | crates-io = true 51 | status = 'direct' 52 | features = [] 53 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'bytes' 16 | version = '0.5.4' 17 | crates-io = true 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'testcrate-dups' 21 | version = '0.1.0' 22 | workspace-path = '' 23 | 24 | [[metadata.features-only]] 25 | name = 'testcrate-dups' 26 | version = '0.1.0' 27 | workspace-path = '' 28 | features = [] 29 | 30 | [[target-package]] 31 | name = 'testcrate-dups' 32 | version = '0.1.0' 33 | workspace-path = '' 34 | status = 'initial' 35 | features = [] 36 | 37 | [[target-package]] 38 | name = 'bytes' 39 | version = '0.3.0' 40 | crates-io = true 41 | status = 'direct' 42 | features = [] 43 | 44 | [[target-package]] 45 | name = 'lazy_static' 46 | version = '0.2.11' 47 | crates-io = true 48 | status = 'direct' 49 | features = [] 50 | 51 | [[target-package]] 52 | name = 'lazy_static' 53 | version = '1.4.0' 54 | crates-io = true 55 | status = 'direct' 56 | features = [] 57 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_builddep-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_builddep 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'm68k-unknown-linux-gnu' 11 | target-features = 'all' 12 | flags = ['test-flag'] 13 | 14 | [metadata.target-platform] 15 | triple = 'thumbv8m.base-none-eabi' 16 | target-features = 'unknown' 17 | flags = ['test-flag'] 18 | [[metadata.omitted-packages.ids]] 19 | name = 'builddep' 20 | version = '0.1.0' 21 | workspace-path = 'builddep' 22 | 23 | [[metadata.omitted-packages.ids]] 24 | name = 'main' 25 | version = '0.1.0' 26 | workspace-path = 'main' 27 | 28 | [[metadata.features-only]] 29 | name = 'builddep' 30 | version = '0.1.0' 31 | workspace-path = 'builddep' 32 | features = [] 33 | 34 | [[metadata.features-only]] 35 | name = 'main' 36 | version = '0.1.0' 37 | workspace-path = 'main' 38 | features = [] 39 | 40 | [[target-package]] 41 | name = 'builddep' 42 | version = '0.1.0' 43 | workspace-path = 'builddep' 44 | status = 'initial' 45 | features = [] 46 | 47 | [[target-package]] 48 | name = 'main' 49 | version = '0.1.0' 50 | workspace-path = 'main' 51 | status = 'initial' 52 | features = [] 53 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'x86_64-unknown-illumos' 14 | target-features = 'all' 15 | flags = ['foo', 'test-flag'] 16 | [[metadata.omitted-packages.ids]] 17 | name = 'testcycles-helper' 18 | version = '0.1.0' 19 | workspace-path = 'testcycles-helper' 20 | 21 | [[metadata.features-only]] 22 | name = 'testcycles-base' 23 | version = '0.1.0' 24 | workspace-path = 'testcycles-base' 25 | features = [] 26 | 27 | [[metadata.features-only]] 28 | name = 'testcycles-helper' 29 | version = '0.1.0' 30 | workspace-path = 'testcycles-helper' 31 | features = [] 32 | 33 | [[target-package]] 34 | name = 'testcycles-base' 35 | version = '0.1.0' 36 | workspace-path = 'testcycles-base' 37 | status = 'initial' 38 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 39 | 40 | [[target-package]] 41 | name = 'testcycles-helper' 42 | version = '0.1.0' 43 | workspace-path = 'testcycles-helper' 44 | status = 'initial' 45 | features = [] 46 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'lower-a' 16 | version = '0.1.0' 17 | workspace-path = 'lower-a' 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'lower-b' 21 | version = '0.1.0' 22 | workspace-path = 'lower-b' 23 | 24 | [[metadata.features-only]] 25 | name = 'lower-a' 26 | version = '0.1.0' 27 | workspace-path = 'lower-a' 28 | features = [] 29 | 30 | [[metadata.features-only]] 31 | name = 'lower-b' 32 | version = '0.1.0' 33 | workspace-path = 'lower-b' 34 | features = [] 35 | 36 | [[target-package]] 37 | name = 'lower-a' 38 | version = '0.1.0' 39 | workspace-path = 'lower-a' 40 | status = 'initial' 41 | features = [] 42 | 43 | [[target-package]] 44 | name = 'lower-b' 45 | version = '0.1.0' 46 | workspace-path = 'lower-b' 47 | status = 'initial' 48 | features = [] 49 | 50 | [[target-package]] 51 | name = 'upper-b' 52 | version = '0.1.0' 53 | workspace-path = 'upper-b' 54 | status = 'initial' 55 | features = [] 56 | -------------------------------------------------------------------------------- /tools/cargo-hakari/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cargo-hakari" 3 | version = "0.9.14" 4 | description = "Manage workspace-hack packages to speed up builds in large workspaces." 5 | documentation = "https://docs.rs/cargo-hakari" 6 | edition = "2021" 7 | repository = "https://github.com/facebookincubator/cargo-guppy" 8 | license = "MIT OR Apache-2.0" 9 | readme = "README.md" 10 | keywords = [ 11 | "cargo", 12 | "dependencies", 13 | "workspace-hack", 14 | "feature-unification", 15 | "guppy", 16 | ] 17 | categories = ["development-tools::cargo-plugins"] 18 | rust-version = "1.56" 19 | 20 | [dependencies] 21 | camino = "1.0.9" 22 | cfg-if = "1.0.0" 23 | clap = { version = "3.1.18", features = ["derive"] } 24 | # disable tracing integration since we don't use it 25 | color-eyre = { version = "0.6.1", default-features = false } 26 | dialoguer = "0.10.1" 27 | duct = "0.13.5" 28 | enable-ansi-support = "0.1.2" 29 | env_logger = "0.9.0" 30 | guppy = { version = "0.14.2", path = "../../guppy" } 31 | hakari = { version = "0.10.0", path = "../hakari", features = ["cli-support"] } 32 | log = "0.4.17" 33 | owo-colors = { version = "3.5.0", features = ["supports-colors"] } 34 | supports-color = "1.3.0" 35 | guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } 36 | 37 | [dev-dependencies] 38 | tempfile = "3.3.0" 39 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'riscv32gc-unknown-linux-gnu' 14 | target-features = 'all' 15 | flags = ['cargo_web'] 16 | [[metadata.omitted-packages.ids]] 17 | name = 'itoa' 18 | version = '0.4.8' 19 | crates-io = true 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'serde_derive' 23 | version = '1.0.130' 24 | source = 'registry+https://github.com/fakeorg/crates.io-index' 25 | 26 | [[target-package]] 27 | name = 'debug-ignore' 28 | version = '1.0.1' 29 | workspace-path = '' 30 | status = 'initial' 31 | features = ['serde'] 32 | optional-deps = ['serde'] 33 | 34 | [[target-package]] 35 | name = 'serde' 36 | version = '1.0.130' 37 | source = 'registry+https://github.com/fakeorg/crates.io-index' 38 | status = 'direct' 39 | features = ['derive', 'serde_derive'] 40 | optional-deps = ['serde_derive'] 41 | 42 | [[target-package]] 43 | name = 'unicode-xid' 44 | version = '0.2.2' 45 | crates-io = true 46 | status = 'direct' 47 | features = ['default'] 48 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_proc_macro1-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_proc_macro1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['mipsel-unknown-none', 'powerpc-unknown-netbsd'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'build-user' 12 | # version = '0.1.0' 13 | # workspace-path = 'build-user' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'dev-user' 17 | # version = '0.1.0' 18 | # workspace-path = 'dev-user' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'macro' 22 | # version = '0.1.0' 23 | # workspace-path = 'macro' 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'normal-user' 27 | # version = '0.1.0' 28 | # workspace-path = 'normal-user' 29 | # [[final-excludes.ids]] 30 | # name = 'build-user' 31 | # version = '0.1.0' 32 | # workspace-path = 'build-user' 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'dev-user' 36 | # version = '0.1.0' 37 | # workspace-path = 'dev-user' 38 | # 39 | # [[final-excludes.ids]] 40 | # name = 'macro' 41 | # version = '0.1.0' 42 | # workspace-path = 'macro' 43 | 44 | ### END HAKARI SECTION 45 | 46 | # This part of the file should be preserved at the end. 47 | -------------------------------------------------------------------------------- /tools/determinator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "determinator" 3 | version = "0.9.0" 4 | description = "Figure out which packages changed between two commits to a workspace." 5 | documentation = "https://docs.rs/determinator" 6 | authors = ["Rain "] 7 | edition = "2021" 8 | repository = "https://github.com/facebookincubator/cargo-guppy" 9 | license = "MIT OR Apache-2.0" 10 | readme = "README.md" 11 | keywords = [ 12 | "cargo", 13 | "guppy", 14 | "determinator", 15 | "package-changes", 16 | "build-caching", 17 | ] 18 | categories = ["config", "development-tools"] 19 | include = [ 20 | "README.md", 21 | "**/*.rs", 22 | # Include default rules with the package. 23 | "default-rules.toml", 24 | ] 25 | rust-version = "1.56" 26 | 27 | [dependencies] 28 | camino = "1.0.9" 29 | globset = "0.4.8" 30 | guppy = { version = "0.14.0", path = "../../guppy", features = [ 31 | "rayon1", 32 | "summaries", 33 | ] } 34 | once_cell = "1.12.0" 35 | petgraph = { version = "0.6.2", default-features = false, features = [ 36 | "graphmap", 37 | ] } 38 | rayon = "1.5.3" 39 | serde = { version = "1.0.137", features = ["derive"] } 40 | toml = "0.5.9" 41 | guppy-workspace-hack = { version = "0.1", path = "../../workspace-hack" } 42 | 43 | [dev-dependencies] 44 | fixtures = { path = "../../fixtures" } 45 | cfg-if = "1.0.0" 46 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 's390x-unknown-linux-musl' 11 | target-features = ['fma', 'sse4.1'] 12 | flags = ['flag-test'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'normal-user' 18 | version = '0.1.0' 19 | workspace-path = 'normal-user' 20 | 21 | [[metadata.features-only]] 22 | name = 'normal-user' 23 | version = '0.1.0' 24 | workspace-path = 'normal-user' 25 | features = [] 26 | 27 | [[target-package]] 28 | name = 'build-user' 29 | version = '0.1.0' 30 | workspace-path = 'build-user' 31 | status = 'initial' 32 | features = [] 33 | 34 | [[target-package]] 35 | name = 'macro' 36 | version = '0.1.0' 37 | workspace-path = 'macro' 38 | status = 'initial' 39 | features = [] 40 | 41 | [[target-package]] 42 | name = 'normal-user' 43 | version = '0.1.0' 44 | workspace-path = 'normal-user' 45 | status = 'initial' 46 | features = [] 47 | 48 | [[host-package]] 49 | name = 'macro' 50 | version = '0.1.0' 51 | workspace-path = 'macro' 52 | status = 'initial' 53 | features = [] 54 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | triple = 'aarch64-unknown-openbsd' 14 | target-features = 'all' 15 | flags = ['abc', 'cargo_web'] 16 | 17 | [[metadata.features-only]] 18 | name = 'dev-user' 19 | version = '0.1.0' 20 | workspace-path = 'dev-user' 21 | features = [] 22 | 23 | [[metadata.features-only]] 24 | name = 'normal-user' 25 | version = '0.1.0' 26 | workspace-path = 'normal-user' 27 | features = [] 28 | 29 | [[target-package]] 30 | name = 'build-user' 31 | version = '0.1.0' 32 | workspace-path = 'build-user' 33 | status = 'initial' 34 | features = [] 35 | 36 | [[target-package]] 37 | name = 'dev-user' 38 | version = '0.1.0' 39 | workspace-path = 'dev-user' 40 | status = 'initial' 41 | features = [] 42 | 43 | [[target-package]] 44 | name = 'normal-user' 45 | version = '0.1.0' 46 | workspace-path = 'normal-user' 47 | status = 'initial' 48 | features = [] 49 | 50 | [[host-package]] 51 | name = 'macro' 52 | version = '0.1.0' 53 | workspace-path = 'macro' 54 | status = 'workspace' 55 | features = [] 56 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'dev-user' 16 | version = '0.1.0' 17 | workspace-path = 'dev-user' 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'normal-user' 21 | version = '0.1.0' 22 | workspace-path = 'normal-user' 23 | 24 | [[metadata.features-only]] 25 | name = 'build-user' 26 | version = '0.1.0' 27 | workspace-path = 'build-user' 28 | features = [] 29 | 30 | [[metadata.features-only]] 31 | name = 'macro' 32 | version = '0.1.0' 33 | workspace-path = 'macro' 34 | features = [] 35 | 36 | [[target-package]] 37 | name = 'dev-user' 38 | version = '0.1.0' 39 | workspace-path = 'dev-user' 40 | status = 'initial' 41 | features = [] 42 | 43 | [[target-package]] 44 | name = 'normal-user' 45 | version = '0.1.0' 46 | workspace-path = 'normal-user' 47 | status = 'initial' 48 | features = [] 49 | 50 | [[host-package]] 51 | name = 'macro' 52 | version = '0.1.0' 53 | workspace-path = 'macro' 54 | status = 'workspace' 55 | features = [] 56 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'aarch64-kmc-solid_asp3' 11 | target-features = ['fma', 'sse', 'sse3', 'sse4.2', 'xsavec', 'xsaveopt'] 12 | 13 | [metadata.target-platform] 14 | spec = 'any' 15 | [[metadata.omitted-packages.ids]] 16 | name = 'bytes' 17 | version = '0.5.3' 18 | crates-io = true 19 | 20 | [[metadata.omitted-packages.ids]] 21 | name = 'dep-a' 22 | version = '0.1.0' 23 | path = '../dep-a' 24 | 25 | [[metadata.features-only]] 26 | name = 'testcrate-targets' 27 | version = '0.1.0' 28 | workspace-path = '' 29 | features = ['bytes', 'dep-a'] 30 | optional-deps = ['bytes', 'dep-a'] 31 | 32 | [[host-package]] 33 | name = 'testcrate-targets' 34 | version = '0.1.0' 35 | workspace-path = '' 36 | status = 'initial' 37 | features = ['bytes', 'dep-a'] 38 | optional-deps = ['bytes', 'dep-a'] 39 | 40 | [[host-package]] 41 | name = 'lazy_static' 42 | version = '0.2.11' 43 | crates-io = true 44 | status = 'direct' 45 | features = [] 46 | 47 | [[host-package]] 48 | name = 'lazy_static' 49 | version = '1.4.0' 50 | crates-io = true 51 | status = 'direct' 52 | features = [] 53 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'riscv64imac-unknown-none-elf' 11 | target-features = 'all' 12 | flags = ['foo'] 13 | 14 | [metadata.target-platform] 15 | triple = 'i586-unknown-linux-gnu' 16 | target-features = ['bmi2', 'sse', 'sse4.1'] 17 | flags = ['bar', 'flag-test'] 18 | [[metadata.omitted-packages.ids]] 19 | name = 'testcycles-helper' 20 | version = '0.1.0' 21 | workspace-path = 'testcycles-helper' 22 | 23 | [[metadata.features-only]] 24 | name = 'testcycles-base' 25 | version = '0.1.0' 26 | workspace-path = 'testcycles-base' 27 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 28 | 29 | [[target-package]] 30 | name = 'testcycles-base' 31 | version = '0.1.0' 32 | workspace-path = 'testcycles-base' 33 | status = 'initial' 34 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 35 | 36 | [[target-package]] 37 | name = 'testcycles-helper' 38 | version = '0.1.0' 39 | workspace-path = 'testcycles-helper' 40 | status = 'initial' 41 | features = [] 42 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'build-user' 16 | version = '0.1.0' 17 | workspace-path = 'build-user' 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'macro' 21 | version = '0.1.0' 22 | workspace-path = 'macro' 23 | 24 | [[target-package]] 25 | name = 'build-user' 26 | version = '0.1.0' 27 | workspace-path = 'build-user' 28 | status = 'initial' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'dev-user' 33 | version = '0.1.0' 34 | workspace-path = 'dev-user' 35 | status = 'initial' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'macro' 40 | version = '0.1.0' 41 | workspace-path = 'macro' 42 | status = 'initial' 43 | features = [] 44 | 45 | [[target-package]] 46 | name = 'normal-user' 47 | version = '0.1.0' 48 | workspace-path = 'normal-user' 49 | status = 'initial' 50 | features = [] 51 | 52 | [[host-package]] 53 | name = 'macro' 54 | version = '0.1.0' 55 | workspace-path = 'macro' 56 | status = 'initial' 57 | features = [] 58 | -------------------------------------------------------------------------------- /guppy/examples/topo_sort.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | //! Print out crates in a workspace in topological order. 5 | //! 6 | //! The into_iter_ids and into_iter_metadatas iterators return packages in topological order. Note 7 | //! that into_iter_links returns links in "link order" -- see its documentation for more. 8 | 9 | use guppy::{graph::DependencyDirection, CargoMetadata, Error}; 10 | 11 | fn main() -> Result<(), Error> { 12 | // `guppy` accepts `cargo metadata` JSON output. Use a pre-existing fixture for these examples. 13 | let metadata = 14 | CargoMetadata::parse_json(include_str!("../../fixtures/large/metadata_libra.json"))?; 15 | let package_graph = metadata.build_graph()?; 16 | 17 | // This produces the set of packages in this workspace. 18 | let workspace_set = package_graph.resolve_workspace(); 19 | 20 | // Iterate over packages in forward topo order. 21 | for package in workspace_set.packages(DependencyDirection::Forward) { 22 | // All selected packages are in the workspace. 23 | let workspace_path = package 24 | .source() 25 | .workspace_path() 26 | .expect("packages in workspace should have workspace path"); 27 | println!("{}: {}", package.name(), workspace_path); 28 | } 29 | 30 | Ok(()) 31 | } 32 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_dups-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_dups 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['x86_64-unknown-none-linuxkernel'] 10 | # 11 | # [traversal-excludes] 12 | # 13 | # [final-excludes] 14 | 15 | [dependencies] 16 | bytes-468e82937335b1c9 = { package = "bytes", version = "0.3", default-features = false } 17 | bytes-d8f496e17d97b5cb = { package = "bytes", version = "0.5", features = ["std"] } 18 | lazy_static-6f8ce4dd05d13bba = { package = "lazy_static", version = "0.2", default-features = false } 19 | lazy_static-dff4ba8e3ae991db = { package = "lazy_static", version = "1", default-features = false } 20 | 21 | [build-dependencies] 22 | bytes-468e82937335b1c9 = { package = "bytes", version = "0.3", default-features = false } 23 | bytes-d8f496e17d97b5cb = { package = "bytes", version = "0.5", features = ["std"] } 24 | lazy_static-6f8ce4dd05d13bba = { package = "lazy_static", version = "0.2", default-features = false } 25 | lazy_static-dff4ba8e3ae991db = { package = "lazy_static", version = "1", default-features = false } 26 | 27 | ### END HAKARI SECTION 28 | 29 | # This part of the file should be preserved at the end. 30 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_alternate_registries-3.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_alternate_registries 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'replicate-target-on-host' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['powerpc-wrs-vxworks-spe'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'proc-macro2' 12 | # version = '1.0.29' 13 | # source = 'registry+https://github.com/fakeorg/crates.io-index' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'quote' 17 | # version = '1.0.10' 18 | # source = 'registry+https://github.com/fakeorg/crates.io-index' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'serde' 22 | # version = '1.0.130' 23 | # crates-io = true 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'serde_json' 27 | # version = '1.0.68' 28 | # crates-io = true 29 | # 30 | # [[traversal-excludes.ids]] 31 | # name = 'syn' 32 | # version = '1.0.80' 33 | # source = 'registry+https://github.com/fakeorg/crates.io-index' 34 | # [[final-excludes.ids]] 35 | # name = 'ryu' 36 | # version = '1.0.5' 37 | # crates-io = true 38 | # [registries.my-registry] 39 | # index = 'https://github.com/fakeorg/crates.io-index' 40 | 41 | ### END HAKARI SECTION 42 | 43 | # This part of the file should be preserved at the end. 44 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'armv7r-none-eabihf' 11 | target-features = 'unknown' 12 | flags = ['bar'] 13 | 14 | [metadata.target-platform] 15 | spec = 'any' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'lower-a' 18 | version = '0.1.0' 19 | workspace-path = 'lower-a' 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'lower-b' 23 | version = '0.1.0' 24 | workspace-path = 'lower-b' 25 | 26 | [[metadata.features-only]] 27 | name = 'upper-a' 28 | version = '0.1.0' 29 | workspace-path = 'upper-a' 30 | features = [] 31 | 32 | [[host-package]] 33 | name = 'lower-a' 34 | version = '0.1.0' 35 | workspace-path = 'lower-a' 36 | status = 'initial' 37 | features = [] 38 | 39 | [[host-package]] 40 | name = 'lower-b' 41 | version = '0.1.0' 42 | workspace-path = 'lower-b' 43 | status = 'initial' 44 | features = [] 45 | 46 | [[host-package]] 47 | name = 'upper-a' 48 | version = '0.1.0' 49 | workspace-path = 'upper-a' 50 | status = 'initial' 51 | features = [] 52 | 53 | [[host-package]] 54 | name = 'upper-b' 55 | version = '0.1.0' 56 | workspace-path = 'upper-b' 57 | status = 'initial' 58 | features = [] 59 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_dups-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_dups 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-sun-solaris' 11 | target-features = 'all' 12 | flags = ['test-flag'] 13 | 14 | [metadata.target-platform] 15 | triple = 'thumbv8m.main-none-eabihf' 16 | target-features = ['avx', 'sha', 'sse', 'xsaveopt'] 17 | flags = ['flag-test', 'foo'] 18 | 19 | [[metadata.features-only]] 20 | name = 'testcrate-dups' 21 | version = '0.1.0' 22 | workspace-path = '' 23 | features = [] 24 | 25 | [[target-package]] 26 | name = 'testcrate-dups' 27 | version = '0.1.0' 28 | workspace-path = '' 29 | status = 'initial' 30 | features = [] 31 | 32 | [[target-package]] 33 | name = 'bytes' 34 | version = '0.3.0' 35 | crates-io = true 36 | status = 'direct' 37 | features = [] 38 | 39 | [[target-package]] 40 | name = 'bytes' 41 | version = '0.5.4' 42 | crates-io = true 43 | status = 'direct' 44 | features = ['default', 'std'] 45 | 46 | [[target-package]] 47 | name = 'lazy_static' 48 | version = '0.2.11' 49 | crates-io = true 50 | status = 'direct' 51 | features = [] 52 | 53 | [[target-package]] 54 | name = 'lazy_static' 55 | version = '1.4.0' 56 | crates-io = true 57 | status = 'direct' 58 | features = [] 59 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_weak_namespaced_features-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_weak_namespaced_features 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'tinyvec' 16 | version = '1.5.1' 17 | crates-io = true 18 | 19 | [[target-package]] 20 | name = 'namespaced-weak' 21 | version = '0.1.0' 22 | workspace-path = '' 23 | status = 'initial' 24 | features = ['arrayvec', 'bar', 'baz', 'foo', 'pathdiff2', 'smallvec', 'smallvec-union', 'tinyvec', 'upgrade1', 'upgrade2', 'upgrade3', 'upgrade4', 'upgrade5', 'upgrade6', 'upgrade7', 'upgrade8', 'windows-dep', 'windows-named', 'windows-non-weak', 'windows-weak'] 25 | optional-deps = ['arrayvec', 'pathdiff', 'smallvec', 'tinyvec'] 26 | 27 | [[target-package]] 28 | name = 'arrayvec' 29 | version = '0.7.2' 30 | crates-io = true 31 | status = 'direct' 32 | features = ['std'] 33 | 34 | [[target-package]] 35 | name = 'pathdiff' 36 | version = '0.2.1' 37 | crates-io = true 38 | status = 'direct' 39 | features = [] 40 | 41 | [[target-package]] 42 | name = 'smallvec' 43 | version = '1.8.0' 44 | crates-io = true 45 | status = 'direct' 46 | features = ['union'] 47 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-5.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | 15 | [[metadata.features-only]] 16 | name = 'debug-ignore' 17 | version = '1.0.1' 18 | workspace-path = '' 19 | features = [] 20 | 21 | [[target-package]] 22 | name = 'debug-ignore' 23 | version = '1.0.1' 24 | workspace-path = '' 25 | status = 'initial' 26 | features = [] 27 | 28 | [[target-package]] 29 | name = 'serde_json' 30 | version = '1.0.68' 31 | crates-io = true 32 | status = 'direct' 33 | features = ['default', 'std'] 34 | 35 | [[target-package]] 36 | name = 'unicode-xid' 37 | version = '0.2.2' 38 | crates-io = true 39 | status = 'direct' 40 | features = ['default'] 41 | 42 | [[target-package]] 43 | name = 'itoa' 44 | version = '0.4.8' 45 | crates-io = true 46 | status = 'transitive' 47 | features = [] 48 | 49 | [[target-package]] 50 | name = 'ryu' 51 | version = '1.0.5' 52 | crates-io = true 53 | status = 'transitive' 54 | features = [] 55 | 56 | [[target-package]] 57 | name = 'serde' 58 | version = '1.0.130' 59 | crates-io = true 60 | status = 'transitive' 61 | features = ['std'] 62 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_cycle2-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_cycle2 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['aarch64-apple-ios-macabi', 'x86_64-unknown-dragonfly'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'lower-a' 12 | # version = '0.1.0' 13 | # workspace-path = 'lower-a' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'lower-b' 17 | # version = '0.1.0' 18 | # workspace-path = 'lower-b' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'upper-a' 22 | # version = '0.1.0' 23 | # workspace-path = 'upper-a' 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'upper-b' 27 | # version = '0.1.0' 28 | # workspace-path = 'upper-b' 29 | # [[final-excludes.ids]] 30 | # name = 'lower-a' 31 | # version = '0.1.0' 32 | # workspace-path = 'lower-a' 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'lower-b' 36 | # version = '0.1.0' 37 | # workspace-path = 'lower-b' 38 | # 39 | # [[final-excludes.ids]] 40 | # name = 'upper-a' 41 | # version = '0.1.0' 42 | # workspace-path = 'upper-a' 43 | # 44 | # [[final-excludes.ids]] 45 | # name = 'upper-b' 46 | # version = '0.1.0' 47 | # workspace-path = 'upper-b' 48 | 49 | ### END HAKARI SECTION 50 | 51 | # This part of the file should be preserved at the end. 52 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'mips-unknown-linux-musl' 11 | target-features = 'unknown' 12 | flags = ['abc'] 13 | 14 | [metadata.target-platform] 15 | spec = 'any' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'testcycles-base' 18 | version = '0.1.0' 19 | workspace-path = 'testcycles-base' 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'testcycles-helper' 23 | version = '0.1.0' 24 | workspace-path = 'testcycles-helper' 25 | 26 | [[metadata.features-only]] 27 | name = 'testcycles-base' 28 | version = '0.1.0' 29 | workspace-path = 'testcycles-base' 30 | features = ['default', 'default-enable', 'default-transitive'] 31 | 32 | [[metadata.features-only]] 33 | name = 'testcycles-helper' 34 | version = '0.1.0' 35 | workspace-path = 'testcycles-helper' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'testcycles-base' 40 | version = '0.1.0' 41 | workspace-path = 'testcycles-base' 42 | status = 'initial' 43 | features = ['default', 'default-enable', 'default-transitive'] 44 | 45 | [[target-package]] 46 | name = 'testcycles-helper' 47 | version = '0.1.0' 48 | workspace-path = 'testcycles-helper' 49 | status = 'initial' 50 | features = [] 51 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-0.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'upper-a' 16 | version = '0.1.0' 17 | workspace-path = 'upper-a' 18 | 19 | [[metadata.features-only]] 20 | name = 'lower-a' 21 | version = '0.1.0' 22 | workspace-path = 'lower-a' 23 | features = [] 24 | 25 | [[metadata.features-only]] 26 | name = 'lower-b' 27 | version = '0.1.0' 28 | workspace-path = 'lower-b' 29 | features = [] 30 | 31 | [[metadata.features-only]] 32 | name = 'upper-b' 33 | version = '0.1.0' 34 | workspace-path = 'upper-b' 35 | features = [] 36 | 37 | [[host-package]] 38 | name = 'lower-a' 39 | version = '0.1.0' 40 | workspace-path = 'lower-a' 41 | status = 'initial' 42 | features = [] 43 | 44 | [[host-package]] 45 | name = 'lower-b' 46 | version = '0.1.0' 47 | workspace-path = 'lower-b' 48 | status = 'initial' 49 | features = [] 50 | 51 | [[host-package]] 52 | name = 'upper-a' 53 | version = '0.1.0' 54 | workspace-path = 'upper-a' 55 | status = 'initial' 56 | features = [] 57 | 58 | [[host-package]] 59 | name = 'upper-b' 60 | version = '0.1.0' 61 | workspace-path = 'upper-b' 62 | status = 'initial' 63 | features = [] 64 | -------------------------------------------------------------------------------- /tools/determinator/default-rules.toml: -------------------------------------------------------------------------------- 1 | # These are the default rules shipped with this version of the determinator library. These rules are embedded into the 2 | # determinator library through `include_str!`. 3 | # 4 | # These rules are applied *after* custom rules, so a custom rule that matches any of the same files will override 5 | # them. 6 | 7 | # Standard ignore and other metadata files. 8 | [[path-rule]] 9 | globs = ["**/.gitignore", "**/.gitattributes", ".dockerignore", ".hgignore", ".svnignore", "**/.ignore"] 10 | mark-changed = [] 11 | 12 | # Files that can affect the global build. Cargo.toml may contain updates to build flags or profile overrides, 13 | # so rebuild everything if it changes. (We could do a more sophisticated analysis in the future.) 14 | [[path-rule]] 15 | globs = ["rust-toolchain", "Cargo.toml", "**/.cargo/config", "**/.cargo/config.toml"] 16 | mark-changed = "all" 17 | 18 | # Tool files that don't influence builds or tests. 19 | [[path-rule]] 20 | globs = ["clippy.toml", "rustfmt.toml", ".lintrules/**/*"] 21 | mark-changed = [] 22 | 23 | # Cargo.lock is ignored, since the determinator does a deeper analysis to figure out which packages changed. 24 | [[path-rule]] 25 | globs = ["Cargo.lock"] 26 | mark-changed = [] 27 | 28 | # README, LICENSE and other metadata files are ignored throughout the codebase. 29 | [[path-rule]] 30 | globs = ["**/README*", "**/LICENSE*", "**/CONTRIBUTING*", "**/CODE_OF_CONDUCT*", "**/SECURITY*"] 31 | mark-changed = [] 32 | -------------------------------------------------------------------------------- /fixtures/guppy/summaries/metadata_guppy_44b62fa-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_guppy_44b62fa 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'determinator' 16 | version = '0.7.0' 17 | workspace-path = 'tools/determinator' 18 | 19 | [[metadata.features-only]] 20 | name = 'guppy-benchmarks' 21 | version = '0.1.0' 22 | workspace-path = 'internal-tools/benchmarks' 23 | features = [] 24 | 25 | [[metadata.features-only]] 26 | name = 'hakari' 27 | version = '0.8.1' 28 | workspace-path = 'tools/hakari' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'cargo-compare' 33 | version = '0.1.0' 34 | workspace-path = 'internal-tools/cargo-compare' 35 | status = 'initial' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'fixture-manager' 40 | version = '0.1.0' 41 | workspace-path = 'internal-tools/fixture-manager' 42 | status = 'initial' 43 | features = [] 44 | 45 | [[target-package]] 46 | name = 'fixtures' 47 | version = '0.1.0' 48 | workspace-path = 'fixtures' 49 | status = 'initial' 50 | features = [] 51 | 52 | [[target-package]] 53 | name = 'hakari' 54 | version = '0.8.1' 55 | workspace-path = 'tools/hakari' 56 | status = 'initial' 57 | features = [] 58 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_targets1-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = 'install' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['armv7a-none-eabi', 'mips64el-unknown-linux-muslabi64', 'i686-unknown-freebsd'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'serde' 12 | # version = '1.0.105' 13 | # crates-io = true 14 | # 15 | # [final-excludes] 16 | 17 | [dependencies] 18 | bytes = { version = "0.5", features = ["serde", "std"] } 19 | dep-a = { path = "/Users/fakeuser/local/testcrates/testcrate-targets/../dep-a", default-features = false, features = ["bar", "baz", "foo", "quux"] } 20 | lazy_static-dff4ba8e3ae991db = { package = "lazy_static", version = "1", default-features = false } 21 | 22 | [target.armv7a-none-eabi.dependencies] 23 | lazy_static-6f8ce4dd05d13bba = { package = "lazy_static", version = "0.2", default-features = false } 24 | 25 | [target.mips64el-unknown-linux-muslabi64.dependencies] 26 | lazy_static-6f8ce4dd05d13bba = { package = "lazy_static", version = "0.2", default-features = false } 27 | 28 | [target.i686-unknown-freebsd.dependencies] 29 | lazy_static-6f8ce4dd05d13bba = { package = "lazy_static", version = "0.2", default-features = false } 30 | 31 | ### END HAKARI SECTION 32 | 33 | # This part of the file should be preserved at the end. 34 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata_targets1-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_targets1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'none' 7 | # output-single-feature = true 8 | # dep-format-version = '2' 9 | # platforms = ['aarch64-apple-ios-macabi', 'armv7-unknown-linux-musleabi'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'dep-a' 12 | # version = '0.1.0' 13 | # path = '../dep-a' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'lazy_static' 17 | # version = '0.1.16' 18 | # crates-io = true 19 | # [[final-excludes.ids]] 20 | # name = 'dep-a' 21 | # version = '0.1.0' 22 | # path = '../dep-a' 23 | # 24 | # [[final-excludes.ids]] 25 | # name = 'lazy_static' 26 | # version = '0.1.16' 27 | # crates-io = true 28 | # 29 | # [[final-excludes.ids]] 30 | # name = 'lazy_static' 31 | # version = '0.2.11' 32 | # crates-io = true 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'lazy_static' 36 | # version = '1.4.0' 37 | # crates-io = true 38 | # 39 | # [[final-excludes.ids]] 40 | # name = 'serde' 41 | # version = '1.0.105' 42 | # crates-io = true 43 | # 44 | # [[final-excludes.ids]] 45 | # name = 'testcrate-targets' 46 | # version = '0.1.0' 47 | # workspace-path = '' 48 | 49 | [dependencies] 50 | bytes = { version = "0.5", default-features = false, features = ["serde"] } 51 | 52 | ### END HAKARI SECTION 53 | 54 | # This part of the file should be preserved at the end. 55 | -------------------------------------------------------------------------------- /tools/cargo-hakari/src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use cargo_hakari::Args; 5 | use cfg_if::cfg_if; 6 | use clap::Parser; 7 | use color_eyre::eyre::Result; 8 | 9 | // On Unix-like operating systems, the executable name of the Cargo subcommand usually doesn't have 10 | // a file extension, while on Windows, executables usually have a ".exe" extension. 11 | fn executable_name(subcommand: &str) -> String { 12 | cfg_if! { 13 | if #[cfg(target_os = "windows")] { 14 | format!("cargo-{}.exe", subcommand) 15 | } else { 16 | format!("cargo-{}", subcommand) 17 | } 18 | } 19 | } 20 | 21 | // When invoked as a cargo subcommand, cargo passes too many arguments so we need to filter out 22 | // arg[1] if it matches the end of arg[0], e.i. "cargo-X X foo" should become "cargo-X foo". 23 | fn args() -> impl Iterator { 24 | let mut args: Vec = ::std::env::args().collect(); 25 | 26 | if args.len() >= 2 && args[0].ends_with(&executable_name(&args[1])) { 27 | args.remove(1); 28 | } 29 | 30 | args.into_iter() 31 | } 32 | 33 | fn main() -> Result<()> { 34 | color_eyre::install()?; 35 | // Attempt to turn on ANSI color support on Windows. This may or may not work. 36 | let _ = enable_ansi_support::enable_ansi_support(); 37 | 38 | let args = Args::parse_from(args()); 39 | std::process::exit(args.exec()?) 40 | } 41 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata2-1.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata2 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '2' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['aarch64-apple-ios-sim', 'armv7-unknown-netbsd-eabihf'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'quote' 12 | # version = '1.0.2' 13 | # path = '../quote' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'same-file' 17 | # version = '1.0.5' 18 | # crates-io = true 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'version_check' 22 | # version = '0.9.1' 23 | # crates-io = true 24 | # [[final-excludes.ids]] 25 | # name = 'datatest-derive' 26 | # version = '0.4.0' 27 | # crates-io = true 28 | # 29 | # [[final-excludes.ids]] 30 | # name = 'dtoa' 31 | # version = '0.4.4' 32 | # crates-io = true 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'linked-hash-map' 36 | # version = '0.5.2' 37 | # crates-io = true 38 | # 39 | # [[final-excludes.ids]] 40 | # name = 'memchr' 41 | # version = '2.2.1' 42 | # crates-io = true 43 | # 44 | # [[final-excludes.ids]] 45 | # name = 'quote' 46 | # version = '1.0.2' 47 | # path = '../quote' 48 | # 49 | # [[final-excludes.ids]] 50 | # name = 'winapi-i686-pc-windows-gnu' 51 | # version = '0.4.0' 52 | # crates-io = true 53 | 54 | ### END HAKARI SECTION 55 | 56 | # This part of the file should be preserved at the end. 57 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'wasm32-wasi' 14 | target-features = 'unknown' 15 | flags = ['bar'] 16 | [[metadata.omitted-packages.ids]] 17 | name = 'lower-a' 18 | version = '0.1.0' 19 | workspace-path = 'lower-a' 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'lower-b' 23 | version = '0.1.0' 24 | workspace-path = 'lower-b' 25 | 26 | [[metadata.omitted-packages.ids]] 27 | name = 'upper-a' 28 | version = '0.1.0' 29 | workspace-path = 'upper-a' 30 | 31 | [[metadata.features-only]] 32 | name = 'lower-a' 33 | version = '0.1.0' 34 | workspace-path = 'lower-a' 35 | features = [] 36 | 37 | [[metadata.features-only]] 38 | name = 'lower-b' 39 | version = '0.1.0' 40 | workspace-path = 'lower-b' 41 | features = [] 42 | 43 | [[target-package]] 44 | name = 'lower-b' 45 | version = '0.1.0' 46 | workspace-path = 'lower-b' 47 | status = 'initial' 48 | features = [] 49 | 50 | [[target-package]] 51 | name = 'upper-a' 52 | version = '0.1.0' 53 | workspace-path = 'upper-a' 54 | status = 'initial' 55 | features = [] 56 | 57 | [[target-package]] 58 | name = 'upper-b' 59 | version = '0.1.0' 60 | workspace-path = 'upper-b' 61 | status = 'initial' 62 | features = [] 63 | -------------------------------------------------------------------------------- /guppy/src/package_id.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use std::fmt; 5 | 6 | /// An "opaque" identifier for a package. 7 | #[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] 8 | #[allow(clippy::derive_hash_xor_eq)] // safe because the same PartialEq impl is used everywhere 9 | pub struct PackageId { 10 | /// The underlying string representation of an ID. 11 | repr: Box, 12 | } 13 | 14 | impl PackageId { 15 | /// Creates a new `PackageId`. 16 | pub fn new(s: impl Into>) -> Self { 17 | Self { repr: s.into() } 18 | } 19 | 20 | pub(super) fn from_metadata(id: cargo_metadata::PackageId) -> Self { 21 | Self { 22 | repr: id.repr.into_boxed_str(), 23 | } 24 | } 25 | 26 | /// Returns the inner representation of a package ID. This is generally an opaque string and its 27 | /// precise format is subject to change. 28 | pub fn repr(&self) -> &str { 29 | &self.repr 30 | } 31 | } 32 | 33 | impl fmt::Display for PackageId { 34 | fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result { 35 | fmt::Display::fmt(&self.repr, f) 36 | } 37 | } 38 | 39 | impl PartialEq<&PackageId> for PackageId { 40 | fn eq(&self, other: &&PackageId) -> bool { 41 | self.eq(*other) 42 | } 43 | } 44 | 45 | impl PartialEq for &PackageId { 46 | fn eq(&self, other: &PackageId) -> bool { 47 | (*self).eq(other) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /fixtures/small/hakari/metadata1-2.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata1 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'auto' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['aarch64-uwp-windows-msvc'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'regex' 12 | # version = '1.3.1' 13 | # crates-io = true 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'serde' 17 | # version = '1.0.100' 18 | # crates-io = true 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'serde_yaml' 22 | # version = '0.8.9' 23 | # crates-io = true 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'testcrate' 27 | # version = '0.1.0' 28 | # workspace-path = '' 29 | # [[final-excludes.ids]] 30 | # name = 'datatest' 31 | # version = '0.4.2' 32 | # crates-io = true 33 | # 34 | # [[final-excludes.ids]] 35 | # name = 'region' 36 | # version = '2.1.2' 37 | # crates-io = true 38 | # 39 | # [[final-excludes.ids]] 40 | # name = 'serde' 41 | # version = '1.0.100' 42 | # crates-io = true 43 | # 44 | # [[final-excludes.ids]] 45 | # name = 'version_check' 46 | # version = '0.9.1' 47 | # crates-io = true 48 | # 49 | # [[final-excludes.ids]] 50 | # name = 'walkdir' 51 | # version = '2.2.9' 52 | # source = 'git+https://github.com/BurntSushi/walkdir?tag=2.2.9#7c7013259eb9db400b3e5c7bc60330ca08068826' 53 | 54 | ### END HAKARI SECTION 55 | 56 | # This part of the file should be preserved at the end. 57 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'armv7a-none-eabi' 11 | target-features = 'unknown' 12 | flags = ['abc', 'bar'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'dep-a' 18 | version = '0.1.0' 19 | path = '../dep-a' 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'lazy_static' 23 | version = '1.4.0' 24 | crates-io = true 25 | 26 | [[metadata.features-only]] 27 | name = 'testcrate-targets' 28 | version = '0.1.0' 29 | workspace-path = '' 30 | features = ['bytes', 'dep-a'] 31 | optional-deps = ['bytes', 'dep-a'] 32 | 33 | [[host-package]] 34 | name = 'testcrate-targets' 35 | version = '0.1.0' 36 | workspace-path = '' 37 | status = 'initial' 38 | features = ['bytes', 'dep-a'] 39 | optional-deps = ['bytes', 'dep-a'] 40 | 41 | [[host-package]] 42 | name = 'bytes' 43 | version = '0.5.3' 44 | crates-io = true 45 | status = 'direct' 46 | features = ['default', 'serde', 'std'] 47 | optional-deps = ['serde'] 48 | 49 | [[host-package]] 50 | name = 'lazy_static' 51 | version = '0.2.11' 52 | crates-io = true 53 | status = 'direct' 54 | features = [] 55 | 56 | [[host-package]] 57 | name = 'serde' 58 | version = '1.0.105' 59 | crates-io = true 60 | status = 'transitive' 61 | features = ['default', 'std'] 62 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle_features-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle_features 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'always' 11 | 12 | [metadata.target-platform] 13 | triple = 'mips64-openwrt-linux-musl' 14 | target-features = 'unknown' 15 | flags = ['test-flag'] 16 | [[metadata.omitted-packages.ids]] 17 | name = 'testcycles-base' 18 | version = '0.1.0' 19 | workspace-path = 'testcycles-base' 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'testcycles-helper' 23 | version = '0.1.0' 24 | workspace-path = 'testcycles-helper' 25 | 26 | [[metadata.features-only]] 27 | name = 'testcycles-base' 28 | version = '0.1.0' 29 | workspace-path = 'testcycles-base' 30 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 31 | 32 | [[metadata.features-only]] 33 | name = 'testcycles-helper' 34 | version = '0.1.0' 35 | workspace-path = 'testcycles-helper' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'testcycles-base' 40 | version = '0.1.0' 41 | workspace-path = 'testcycles-base' 42 | status = 'initial' 43 | features = ['default', 'default-enable', 'default-transitive', 'helper-enable', 'helper-transitive'] 44 | 45 | [[target-package]] 46 | name = 'testcycles-helper' 47 | version = '0.1.0' 48 | workspace-path = 'testcycles-helper' 49 | status = 'initial' 50 | features = [] 51 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-7.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'mipsisa32r6el-unknown-linux-gnu' 11 | target-features = ['avx2', 'sse3'] 12 | flags = ['foo'] 13 | 14 | [metadata.target-platform] 15 | triple = 'mips64-openwrt-linux-musl' 16 | target-features = 'unknown' 17 | 18 | [[metadata.features-only]] 19 | name = 'testcrate-targets' 20 | version = '0.1.0' 21 | workspace-path = '' 22 | features = [] 23 | 24 | [[target-package]] 25 | name = 'testcrate-targets' 26 | version = '0.1.0' 27 | workspace-path = '' 28 | status = 'initial' 29 | features = [] 30 | 31 | [[target-package]] 32 | name = 'bytes' 33 | version = '0.5.3' 34 | crates-io = true 35 | status = 'direct' 36 | features = ['serde'] 37 | optional-deps = ['serde'] 38 | 39 | [[target-package]] 40 | name = 'dep-a' 41 | version = '0.1.0' 42 | path = '../dep-a' 43 | status = 'direct' 44 | features = ['baz', 'foo', 'quux'] 45 | 46 | [[target-package]] 47 | name = 'lazy_static' 48 | version = '0.2.11' 49 | crates-io = true 50 | status = 'direct' 51 | features = [] 52 | 53 | [[target-package]] 54 | name = 'lazy_static' 55 | version = '1.4.0' 56 | crates-io = true 57 | status = 'direct' 58 | features = [] 59 | 60 | [[target-package]] 61 | name = 'serde' 62 | version = '1.0.105' 63 | crates-io = true 64 | status = 'transitive' 65 | features = ['default', 'std'] 66 | -------------------------------------------------------------------------------- /fixtures/guppy/hakari/metadata_guppy_44b62fa-0.toml: -------------------------------------------------------------------------------- 1 | # This file is @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-hakari --fixture metadata_guppy_44b62fa 3 | 4 | ### BEGIN HAKARI SECTION 5 | # resolver = '1' 6 | # unify-target-host = 'unify-if-both' 7 | # output-single-feature = false 8 | # dep-format-version = '2' 9 | # platforms = ['powerpc-wrs-vxworks', 'thumbv7neon-linux-androideabi'] 10 | # [[traversal-excludes.ids]] 11 | # name = 'cargo-compare' 12 | # version = '0.1.0' 13 | # workspace-path = 'internal-tools/cargo-compare' 14 | # 15 | # [[traversal-excludes.ids]] 16 | # name = 'cargo-guppy' 17 | # version = '0.1.0' 18 | # workspace-path = 'cargo-guppy' 19 | # 20 | # [[traversal-excludes.ids]] 21 | # name = 'cargo-hakari' 22 | # version = '0.9.11' 23 | # workspace-path = 'tools/cargo-hakari' 24 | # 25 | # [[traversal-excludes.ids]] 26 | # name = 'fixtures' 27 | # version = '0.1.0' 28 | # workspace-path = 'fixtures' 29 | # 30 | # [[traversal-excludes.ids]] 31 | # name = 'proptest-ext' 32 | # version = '0.1.0' 33 | # workspace-path = 'internal-tools/proptest-ext' 34 | # 35 | # [[traversal-excludes.ids]] 36 | # name = 'target-spec' 37 | # version = '0.9.0' 38 | # workspace-path = 'target-spec' 39 | # [[final-excludes.ids]] 40 | # name = 'cargo-compare' 41 | # version = '0.1.0' 42 | # workspace-path = 'internal-tools/cargo-compare' 43 | # 44 | # [[final-excludes.ids]] 45 | # name = 'cargo-hakari' 46 | # version = '0.9.11' 47 | # workspace-path = 'tools/cargo-hakari' 48 | 49 | ### END HAKARI SECTION 50 | 51 | # This part of the file should be preserved at the end. 52 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-6.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'riscv64gc-unknown-freebsd' 11 | target-features = ['rdrand'] 12 | flags = ['bar'] 13 | 14 | [metadata.target-platform] 15 | triple = 'mips64el-unknown-linux-muslabi64' 16 | target-features = 'all' 17 | [[metadata.omitted-packages.ids]] 18 | name = 'dep-a' 19 | version = '0.1.0' 20 | path = '../dep-a' 21 | 22 | [[metadata.omitted-packages.ids]] 23 | name = 'lazy_static' 24 | version = '0.1.16' 25 | crates-io = true 26 | 27 | [[metadata.omitted-packages.ids]] 28 | name = 'serde' 29 | version = '1.0.105' 30 | crates-io = true 31 | 32 | [[metadata.features-only]] 33 | name = 'testcrate-targets' 34 | version = '0.1.0' 35 | workspace-path = '' 36 | features = [] 37 | 38 | [[target-package]] 39 | name = 'testcrate-targets' 40 | version = '0.1.0' 41 | workspace-path = '' 42 | status = 'initial' 43 | features = [] 44 | 45 | [[target-package]] 46 | name = 'bytes' 47 | version = '0.5.3' 48 | crates-io = true 49 | status = 'direct' 50 | features = ['serde'] 51 | optional-deps = ['serde'] 52 | 53 | [[target-package]] 54 | name = 'lazy_static' 55 | version = '0.2.11' 56 | crates-io = true 57 | status = 'direct' 58 | features = [] 59 | 60 | [[target-package]] 61 | name = 'lazy_static' 62 | version = '1.4.0' 63 | crates-io = true 64 | status = 'direct' 65 | features = [] 66 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-fortanix-unknown-sgx' 11 | target-features = 'all' 12 | flags = ['abc'] 13 | 14 | [metadata.target-platform] 15 | spec = 'always' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'ryu' 18 | version = '1.0.5' 19 | crates-io = true 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'serde_derive' 23 | version = '1.0.130' 24 | source = 'registry+https://github.com/fakeorg/crates.io-index' 25 | 26 | [[metadata.features-only]] 27 | name = 'debug-ignore' 28 | version = '1.0.1' 29 | workspace-path = '' 30 | features = [] 31 | 32 | [[target-package]] 33 | name = 'debug-ignore' 34 | version = '1.0.1' 35 | workspace-path = '' 36 | status = 'initial' 37 | features = [] 38 | 39 | [[target-package]] 40 | name = 'serde_json' 41 | version = '1.0.68' 42 | crates-io = true 43 | status = 'direct' 44 | features = ['default', 'std'] 45 | 46 | [[target-package]] 47 | name = 'unicode-xid' 48 | version = '0.2.2' 49 | crates-io = true 50 | status = 'direct' 51 | features = ['default'] 52 | 53 | [[target-package]] 54 | name = 'itoa' 55 | version = '0.4.8' 56 | crates-io = true 57 | status = 'transitive' 58 | features = [] 59 | 60 | [[target-package]] 61 | name = 'serde' 62 | version = '1.0.130' 63 | crates-io = true 64 | status = 'transitive' 65 | features = ['std'] 66 | -------------------------------------------------------------------------------- /guppy/src/dependency_kind.rs: -------------------------------------------------------------------------------- 1 | // Copyright (c) The cargo-guppy Contributors 2 | // SPDX-License-Identifier: MIT OR Apache-2.0 3 | 4 | use std::fmt; 5 | 6 | /// A descriptor for the kind of dependency. 7 | /// 8 | /// Cargo dependencies may be one of three kinds. 9 | #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)] 10 | pub enum DependencyKind { 11 | /// Normal dependencies. 12 | /// 13 | /// These are specified in the `[dependencies]` section. 14 | Normal, 15 | 16 | /// Dependencies used for development only. 17 | /// 18 | /// These are specified in the `[dev-dependencies]` section, and are used for tests, 19 | /// benchmarks and similar. 20 | Development, 21 | 22 | /// Dependencies used for build scripts. 23 | /// 24 | /// These are specified in the `[build-dependencies]` section. 25 | Build, 26 | } 27 | 28 | impl DependencyKind { 29 | /// A list of all the possible values of `DependencyKind`. 30 | pub const VALUES: &'static [Self; 3] = &[ 31 | DependencyKind::Normal, 32 | DependencyKind::Development, 33 | DependencyKind::Build, 34 | ]; 35 | 36 | /// Returns a string representing the kind of dependency this is. 37 | pub fn to_str(self) -> &'static str { 38 | match self { 39 | DependencyKind::Normal => "normal", 40 | DependencyKind::Development => "dev", 41 | DependencyKind::Build => "build", 42 | } 43 | } 44 | } 45 | 46 | impl fmt::Display for DependencyKind { 47 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 48 | write!(f, "{}", self.to_str()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-3.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = false 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'any' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'dep-a' 16 | version = '0.1.0' 17 | path = '../dep-a' 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'testcrate-targets' 21 | version = '0.1.0' 22 | workspace-path = '' 23 | 24 | [[metadata.features-only]] 25 | name = 'testcrate-targets' 26 | version = '0.1.0' 27 | workspace-path = '' 28 | features = ['bytes', 'dep-a'] 29 | optional-deps = ['bytes', 'dep-a'] 30 | 31 | [[target-package]] 32 | name = 'testcrate-targets' 33 | version = '0.1.0' 34 | workspace-path = '' 35 | status = 'initial' 36 | features = ['bytes', 'dep-a'] 37 | optional-deps = ['bytes', 'dep-a'] 38 | 39 | [[target-package]] 40 | name = 'bytes' 41 | version = '0.5.3' 42 | crates-io = true 43 | status = 'direct' 44 | features = ['default', 'serde', 'std'] 45 | optional-deps = ['serde'] 46 | 47 | [[target-package]] 48 | name = 'lazy_static' 49 | version = '0.2.11' 50 | crates-io = true 51 | status = 'direct' 52 | features = [] 53 | 54 | [[target-package]] 55 | name = 'lazy_static' 56 | version = '1.4.0' 57 | crates-io = true 58 | status = 'direct' 59 | features = [] 60 | 61 | [[target-package]] 62 | name = 'serde' 63 | version = '1.0.105' 64 | crates-io = true 65 | status = 'transitive' 66 | features = ['default', 'std'] 67 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_proc_macro1-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_proc_macro1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'proc-macros-on-target' 8 | 9 | [metadata.host-platform] 10 | spec = 'any' 11 | 12 | [metadata.target-platform] 13 | spec = 'always' 14 | [[metadata.omitted-packages.ids]] 15 | name = 'build-user' 16 | version = '0.1.0' 17 | workspace-path = 'build-user' 18 | 19 | [[metadata.omitted-packages.ids]] 20 | name = 'normal-user' 21 | version = '0.1.0' 22 | workspace-path = 'normal-user' 23 | 24 | [[metadata.features-only]] 25 | name = 'build-user' 26 | version = '0.1.0' 27 | workspace-path = 'build-user' 28 | features = [] 29 | 30 | [[metadata.features-only]] 31 | name = 'dev-user' 32 | version = '0.1.0' 33 | workspace-path = 'dev-user' 34 | features = [] 35 | 36 | [[metadata.features-only]] 37 | name = 'macro' 38 | version = '0.1.0' 39 | workspace-path = 'macro' 40 | features = [] 41 | 42 | [[target-package]] 43 | name = 'build-user' 44 | version = '0.1.0' 45 | workspace-path = 'build-user' 46 | status = 'initial' 47 | features = [] 48 | 49 | [[target-package]] 50 | name = 'macro' 51 | version = '0.1.0' 52 | workspace-path = 'macro' 53 | status = 'initial' 54 | features = [] 55 | 56 | [[target-package]] 57 | name = 'normal-user' 58 | version = '0.1.0' 59 | workspace-path = 'normal-user' 60 | status = 'initial' 61 | features = [] 62 | 63 | [[host-package]] 64 | name = 'macro' 65 | version = '0.1.0' 66 | workspace-path = 'macro' 67 | status = 'initial' 68 | features = [] 69 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = 'install' 6 | include-dev = true 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'mipsel-sony-psp' 11 | target-features = 'unknown' 12 | 13 | [metadata.target-platform] 14 | triple = 'armv6k-nintendo-3ds' 15 | target-features = 'unknown' 16 | flags = ['abc', 'bar'] 17 | [[metadata.omitted-packages.ids]] 18 | name = 'lazy_static' 19 | version = '1.4.0' 20 | crates-io = true 21 | 22 | [[metadata.features-only]] 23 | name = 'testcrate-targets' 24 | version = '0.1.0' 25 | workspace-path = '' 26 | features = ['bytes', 'dep-a'] 27 | optional-deps = ['bytes', 'dep-a'] 28 | 29 | [[host-package]] 30 | name = 'testcrate-targets' 31 | version = '0.1.0' 32 | workspace-path = '' 33 | status = 'initial' 34 | features = ['bytes', 'dep-a'] 35 | optional-deps = ['bytes', 'dep-a'] 36 | 37 | [[host-package]] 38 | name = 'bytes' 39 | version = '0.5.3' 40 | crates-io = true 41 | status = 'direct' 42 | features = ['default', 'serde', 'std'] 43 | optional-deps = ['serde'] 44 | 45 | [[host-package]] 46 | name = 'dep-a' 47 | version = '0.1.0' 48 | path = '../dep-a' 49 | status = 'direct' 50 | features = ['bar', 'baz', 'foo', 'quux'] 51 | 52 | [[host-package]] 53 | name = 'lazy_static' 54 | version = '0.2.11' 55 | crates-io = true 56 | status = 'direct' 57 | features = [] 58 | 59 | [[host-package]] 60 | name = 'serde' 61 | version = '1.0.105' 62 | crates-io = true 63 | status = 'transitive' 64 | features = ['default', 'std'] 65 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to cargo-guppy 2 | 3 | Development for `cargo-guppy` happens in the open on GitHub. 4 | 5 | ## Pull Requests 6 | 7 | We actively welcome your pull requests. If you have a new feature in mind, please discuss the feature in an issue to 8 | ensure that your contributions will be accepted. 9 | 10 | 1. Fork the repo and create your branch from `main`. 11 | 2. If you've added code that should be tested, add tests. 12 | 3. If you've changed APIs, update the documentation. 13 | 4. Ensure the test suite passes with `cargo test --all-features`. 14 | 5. Run `cargo fmt` to automatically format your changes (CI will let you know if you missed this). 15 | 6. If you haven't already, complete the Contributor License Agreement ("CLA"). 16 | 17 | ## Contributor License Agreement ("CLA") 18 | 19 | In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of 20 | Facebook's open source projects. 21 | 22 | Complete your CLA here: 23 | 24 | ## Issues 25 | 26 | We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be 27 | able to reproduce the issue. 28 | 29 | Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. In those 30 | cases, please go through the process outlined on that page and do not file a public issue. 31 | 32 | ## License 33 | 34 | By contributing to `cargo-guppy`, you agree that your contributions will be dual-licensed under the terms of the 35 | [`LICENSE-MIT`](LICENSE-MIT) and [`LICENSE-APACHE`](LICENSE-APACHE) files in the root directory of this source 36 | tree. 37 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_cycle2-2.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_cycle2 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'riscv32imc-esp-espidf' 11 | target-features = 'unknown' 12 | 13 | [metadata.target-platform] 14 | triple = 'x86_64-unknown-none-hermitkernel' 15 | target-features = ['avx', 'bmi1'] 16 | flags = ['cargo_web'] 17 | [[metadata.omitted-packages.ids]] 18 | name = 'lower-a' 19 | version = '0.1.0' 20 | workspace-path = 'lower-a' 21 | 22 | [[metadata.omitted-packages.ids]] 23 | name = 'lower-b' 24 | version = '0.1.0' 25 | workspace-path = 'lower-b' 26 | 27 | [[metadata.omitted-packages.ids]] 28 | name = 'upper-b' 29 | version = '0.1.0' 30 | workspace-path = 'upper-b' 31 | 32 | [[metadata.features-only]] 33 | name = 'lower-a' 34 | version = '0.1.0' 35 | workspace-path = 'lower-a' 36 | features = [] 37 | 38 | [[metadata.features-only]] 39 | name = 'lower-b' 40 | version = '0.1.0' 41 | workspace-path = 'lower-b' 42 | features = [] 43 | 44 | [[host-package]] 45 | name = 'lower-a' 46 | version = '0.1.0' 47 | workspace-path = 'lower-a' 48 | status = 'initial' 49 | features = [] 50 | 51 | [[host-package]] 52 | name = 'lower-b' 53 | version = '0.1.0' 54 | workspace-path = 'lower-b' 55 | status = 'initial' 56 | features = [] 57 | 58 | [[host-package]] 59 | name = 'upper-a' 60 | version = '0.1.0' 61 | workspace-path = 'upper-a' 62 | status = 'initial' 63 | features = [] 64 | 65 | [[host-package]] 66 | name = 'upper-b' 67 | version = '0.1.0' 68 | workspace-path = 'upper-b' 69 | status = 'initial' 70 | features = [] 71 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_targets1-4.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_targets1 3 | 4 | [metadata] 5 | resolver = '1' 6 | include-dev = true 7 | initials-platform = 'standard' 8 | 9 | [metadata.host-platform] 10 | triple = 'x86_64-unknown-freebsd' 11 | target-features = [] 12 | flags = ['foo'] 13 | 14 | [metadata.target-platform] 15 | spec = 'any' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'serde' 18 | version = '1.0.105' 19 | crates-io = true 20 | 21 | [[metadata.features-only]] 22 | name = 'testcrate-targets' 23 | version = '0.1.0' 24 | workspace-path = '' 25 | features = ['bytes', 'dep-a'] 26 | optional-deps = ['bytes', 'dep-a'] 27 | 28 | [[target-package]] 29 | name = 'testcrate-targets' 30 | version = '0.1.0' 31 | workspace-path = '' 32 | status = 'initial' 33 | features = ['bytes', 'dep-a'] 34 | optional-deps = ['bytes', 'dep-a'] 35 | 36 | [[target-package]] 37 | name = 'bytes' 38 | version = '0.5.3' 39 | crates-io = true 40 | status = 'direct' 41 | features = ['default', 'serde', 'std'] 42 | optional-deps = ['serde'] 43 | 44 | [[target-package]] 45 | name = 'dep-a' 46 | version = '0.1.0' 47 | path = '../dep-a' 48 | status = 'direct' 49 | features = ['bar', 'baz', 'foo', 'quux'] 50 | 51 | [[target-package]] 52 | name = 'lazy_static' 53 | version = '0.1.16' 54 | crates-io = true 55 | status = 'direct' 56 | features = [] 57 | 58 | [[target-package]] 59 | name = 'lazy_static' 60 | version = '0.2.11' 61 | crates-io = true 62 | status = 'direct' 63 | features = [] 64 | 65 | [[target-package]] 66 | name = 'lazy_static' 67 | version = '1.4.0' 68 | crates-io = true 69 | status = 'direct' 70 | features = [] 71 | -------------------------------------------------------------------------------- /fixtures/small/summaries/metadata_alternate_registries-1.toml: -------------------------------------------------------------------------------- 1 | # This summary was @generated. To regenerate, run: 2 | # cargo run -p fixture-manager -- generate-summaries --fixture metadata_alternate_registries 3 | 4 | [metadata] 5 | resolver = '2' 6 | include-dev = false 7 | initials-platform = 'host' 8 | 9 | [metadata.host-platform] 10 | triple = 'armv7a-kmc-solid_asp3-eabihf' 11 | target-features = ['aes', 'fma', 'sha', 'sse2', 'xsavec'] 12 | 13 | [metadata.target-platform] 14 | triple = 'mips64-unknown-linux-gnuabi64' 15 | target-features = 'all' 16 | [[metadata.omitted-packages.ids]] 17 | name = 'quote' 18 | version = '1.0.10' 19 | source = 'registry+https://github.com/fakeorg/crates.io-index' 20 | 21 | [[metadata.omitted-packages.ids]] 22 | name = 'serde_derive' 23 | version = '1.0.130' 24 | source = 'registry+https://github.com/fakeorg/crates.io-index' 25 | 26 | [[metadata.omitted-packages.ids]] 27 | name = 'syn' 28 | version = '1.0.80' 29 | source = 'registry+https://github.com/fakeorg/crates.io-index' 30 | 31 | [[metadata.features-only]] 32 | name = 'debug-ignore' 33 | version = '1.0.1' 34 | workspace-path = '' 35 | features = ['serde'] 36 | optional-deps = ['serde'] 37 | 38 | [[host-package]] 39 | name = 'debug-ignore' 40 | version = '1.0.1' 41 | workspace-path = '' 42 | status = 'initial' 43 | features = ['serde'] 44 | optional-deps = ['serde'] 45 | 46 | [[host-package]] 47 | name = 'serde' 48 | version = '1.0.130' 49 | source = 'registry+https://github.com/fakeorg/crates.io-index' 50 | status = 'direct' 51 | features = ['derive', 'serde_derive'] 52 | optional-deps = ['serde_derive'] 53 | 54 | [[host-package]] 55 | name = 'unicode-xid' 56 | version = '0.2.2' 57 | crates-io = true 58 | status = 'direct' 59 | features = ['default'] 60 | --------------------------------------------------------------------------------