cargo-lock-9.0.0/.cargo_vcs_info.json0000644000000001500000000000100130570ustar { "git": { "sha1": "ec73f6156d73401d88ff0cece4dd418c2891edd8" }, "path_in_vcs": "cargo-lock" }cargo-lock-9.0.0/CHANGELOG.md000064400000000000000000000102351046102023000134650ustar 00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## 9.0.0 (2023-04-24) ### Added - Implement `From` for `String` ([#776]) - Support sparse registry references in `Lockfile`s ([#780]) ### Changed - Mark `SourceKind` as `#[non_exhaustive]` ([#793]) - Use `Display` for `io::ErrorKind`; MSRV 1.60 ([#794]) - Bump `toml` to 0.7 ([#800], [#805]) - Improvements to the `cargo lock tree` subcommand ([#860]) ### Fixed - `Source::is_default_registry` for sparse index ([#859]) [#776]: https://github.com/RustSec/rustsec/pull/776 [#780]: https://github.com/RustSec/rustsec/pull/780 [#793]: https://github.com/RustSec/rustsec/pull/793 [#794]: https://github.com/RustSec/rustsec/pull/794 [#800]: https://github.com/RustSec/rustsec/pull/800 [#805]: https://github.com/RustSec/rustsec/pull/805 [#859]: https://github.com/RustSec/rustsec/pull/859 [#860]: https://github.com/RustSec/rustsec/pull/860 ## 8.0.3 (2022-11-30) ### Fixed - Encoding inconsistency when there's only one registry for all packages ([#767]) [#767]: https://github.com/RustSec/rustsec/pull/767 ## 8.0.2 (2022-06-30) ### Fixed - Re-export `GitReference` ([#595]) - Encode version into V3 lockfiles ([#596]) [#595]: https://github.com/RustSec/rustsec/pull/595 [#596]: https://github.com/RustSec/rustsec/pull/596 ## 8.0.1 (2022-05-21) ### Fixed - Dependency source extraction for V2+ lockfiles ([#568]) [#568]: https://github.com/RustSec/rustsec/pull/568 ## 8.0.0 (2022-05-08) [YANKED] NOTE: yanked due to bug fixed in v8.0.1. ### Added - Expose `package::SourceKind` ([#557]) ### Changed - Flatten API ([#558]) - 2021 edition upgrade; MSRV 1.56 ([#559]) - Refactor error handling ([#560]) [#557]: https://github.com/RustSec/rustsec/pull/557 [#558]: https://github.com/RustSec/rustsec/pull/558 [#559]: https://github.com/RustSec/rustsec/pull/559 [#560]: https://github.com/RustSec/rustsec/pull/560 ## 7.1.0 (2022-04-23) ### Added - `SourceId::default()` ([#536]) ### Changed - MSRV is now 1.49 ([#524]) ### Fixed - V3 lockfile handling and tests ([#535]) [#524]: https://github.com/RustSec/rustsec/pull/524 [#535]: https://github.com/RustSec/rustsec/pull/535 [#536]: https://github.com/RustSec/rustsec/pull/536 ## 7.0.1 (2021-07-05) ### Changed - Bump `petgraph` dependency from 0.5.1 to 0.6.0 ([#396]) [#396]: https://github.com/RustSec/rustsec/pull/396 ## 7.0.0 (2021-05-27) [YANKED] ### Added - Support for V3 lockfile format ([#363]) ### Changed - Bump `semver` to v1.0.0 ([#378]) [#363]: https://github.com/RustSec/rustsec/pull/363 [#378]: https://github.com/RustSec/rustsec/pull/378 ## 6.0.1 (2021-01-25) ### Changed - Rename default branch to `main` ## 6.0.0 (2020-09-25) - Bump semver from 0.10.0 to 0.11.0 ## 5.0.0 (2020-09-23) - CLI: support for listing a single dependency - Cargo-compatible serializer - CLI: add `--dependencies` and `--sources` flags to `cargo lock list` - CLI: implement `cargo lock tree` without arguments - Add `dependency::Tree::roots()` method - CLI: make `list` the default command - Make `cli` feature non-default - WASM support; MSRV 1.41+ - Bump `semver` dependency from v0.9 to v0.10 ## 4.0.1 (2020-01-22) - CLI: fix executable name ## 4.0.0 (2020-01-22) - Command line interface - Add helper methods for working with checksum metadata - Use minified version of Cargo's `SourceId` type - Overhaul encoding: use serde_derive, proper V1/V2 support - Add support Cargo.lock `patch` and `root` - Detect V1 vs V2 Cargo.lock files - Update `petgraph` requirement from 0.4 to 0.5 - Add `package::Checksum` ## 3.0.0 (2019-10-01) - Support `[package.dependencies]` without versions ## 2.0.0 (2019-09-25) - Use two-pass dependency tree computation - Remove `Lockfile::root_package()` ## 1.0.0 (2019-09-24) - dependency/tree: Render trees to an `io::Write` - metadata: Generalize into `Key` and `Value` types - Refactor dependency handling ## 0.2.1 (2019-09-21) - Allow empty `[metadata]` in Cargo.lock files ## 0.2.0 (2019-09-21) - dependency_graph: Move `petgraph` types into a module ## 0.1.0 (2019-09-21) - Initial release cargo-lock-9.0.0/Cargo.lock0000644000000147000000000000100110400ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "cargo-lock" version = "9.0.0" dependencies = [ "gumdrop", "petgraph", "semver", "serde", "toml", "url", ] [[package]] name = "fixedbitset" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "form_urlencoded" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ "percent-encoding", ] [[package]] name = "gumdrop" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bc700f989d2f6f0248546222d9b4258f5b02a171a431f8285a81c08142629e3" dependencies = [ "gumdrop_derive", ] [[package]] name = "gumdrop_derive" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "idna" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" dependencies = [ "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown", ] [[package]] name = "memchr" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "nom8" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" dependencies = [ "memchr", ] [[package]] name = "percent-encoding" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "petgraph" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", "indexmap", ] [[package]] name = "proc-macro2" version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] [[package]] name = "semver" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ "serde", ] [[package]] name = "serde" version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "serde_spanned" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" dependencies = [ "serde", ] [[package]] name = "syn" version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "tinyvec" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit", ] [[package]] name = "toml_datetime" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5" dependencies = [ "indexmap", "nom8", "serde", "serde_spanned", "toml_datetime", ] [[package]] name = "unicode-bidi" version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-normalization" version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "url" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] cargo-lock-9.0.0/Cargo.toml0000644000000027750000000000100110740ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.60" name = "cargo-lock" version = "9.0.0" authors = ["Tony Arcieri "] description = "Self-contained Cargo.lock parser with optional dependency graph analysis" homepage = "https://rustsec.org" readme = "README.md" keywords = [ "cargo", "dependency", "lock", "lockfile", ] categories = ["parser-implementations"] license = "Apache-2.0 OR MIT" repository = "https://github.com/RustSec/rustsec/tree/main/cargo-lock" resolver = "1" [package.metadata.docs.rs] features = ["dependency-tree"] rustdoc-args = [ "--cfg", "docsrs", ] [[bin]] name = "cargo-lock" required-features = ["cli"] [dependencies.gumdrop] version = "0.8" optional = true [dependencies.petgraph] version = "0.6" optional = true [dependencies.semver] version = "1" features = ["serde"] [dependencies.serde] version = "1" features = ["serde_derive"] [dependencies.toml] version = "0.7" [dependencies.url] version = "2" [features] cli = [ "gumdrop", "dependency-tree", ] dependency-tree = ["petgraph"] cargo-lock-9.0.0/Cargo.toml.orig000064400000000000000000000017351046102023000145500ustar 00000000000000[package] name = "cargo-lock" description = "Self-contained Cargo.lock parser with optional dependency graph analysis" version = "9.0.0" authors = ["Tony Arcieri "] license = "Apache-2.0 OR MIT" readme = "README.md" homepage = "https://rustsec.org" repository = "https://github.com/RustSec/rustsec/tree/main/cargo-lock" categories = ["parser-implementations"] keywords = ["cargo", "dependency", "lock", "lockfile"] edition = "2021" rust-version = "1.60" [[bin]] name = "cargo-lock" required-features = ["cli"] [dependencies] gumdrop = { version = "0.8", optional = true } petgraph = { version = "0.6", optional = true } semver = { version = "1", features = ["serde"] } serde = { version = "1", features = ["serde_derive"] } toml = "0.7" url = "2" [features] cli = ["gumdrop", "dependency-tree"] dependency-tree = ["petgraph"] [package.metadata.docs.rs] features = ["dependency-tree"] rustdoc-args = ["--cfg", "docsrs"] cargo-lock-9.0.0/LICENSE-APACHE000064400000000000000000000251371046102023000136070ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. cargo-lock-9.0.0/LICENSE-MIT000064400000000000000000000020671046102023000133140ustar 00000000000000Copyright (c) 2019-2022 The RustSec Project Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cargo-lock-9.0.0/README.md000064400000000000000000000066101046102023000131350ustar 00000000000000# RustSec: `cargo-lock` crate [![Latest Version][crate-image]][crate-link] [![Docs][docs-image]][docs-link] [![Build Status][build-image]][build-link] [![Safety Dance][safety-image]][safety-link] ![MSRV][rustc-image] ![Apache 2.0 OR MIT licensed][license-image] [![Project Chat][zulip-image]][zulip-link] Self-contained [serde]-powered `Cargo.lock` parser/serializer with support for the V1, V2 (merge-friendly) and V3 formats, as well as optional dependency tree analysis features. Used by [RustSec]. When the `dependency-tree` feature of this crate is enabled, it supports computing a directed graph of the dependency tree, modeled using the [`petgraph`] crate, along with support for printing dependency trees ala the [`cargo-tree`] crate. [Documentation][docs-link] ## Minimum Supported Rust Version Rust **1.60** or higher. Minimum supported Rust version can be changed in the future, but it will be accompanied by a minor version bump. ## SemVer Policy - MSRV is considered exempt from SemVer as noted above - The `cargo lock` CLI interface is not considered to have a stable interface and is also exempted from SemVer. We reserve the right to make substantial changes to it at any time (for now) - The `dependency-tree` feature depends on the pre-1.0 `petgraph` crate. We reserve the right to update `petgraph`, however when we do it will be accompanied by a minor version bump. ## Command Line Interface This crate provides a `cargo lock` subcommand which can be installed with: ```text $ cargo install cargo-lock --features=cli ``` It supports the following subcommands: - `list`: list packages in `Cargo.lock` - `translate`: translate `Cargo.lock` files between the V1 and V2 formats - `tree`: print a dependency tree from `Cargo.lock` alone See the [crate documentation][docs-link] for more detailed usage information. ## License Licensed under either of: - Apache License, Version 2.0 ([LICENSE-APACHE] or ) - MIT license ([LICENSE-MIT] or ) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions. [//]: # (badges) [crate-image]: https://buildstats.info/crate/cargo-lock [crate-link]: https://crates.io/crates/cargo-lock [docs-image]: https://docs.rs/cargo-lock/badge.svg [docs-link]: https://docs.rs/cargo-lock/ [build-image]: https://github.com/RustSec/rustsec/actions/workflows/cargo-lock.yml/badge.svg [build-link]: https://github.com/RustSec/rustsec/actions/workflows/cargo-lock.yml [license-image]: https://img.shields.io/badge/license-Apache2.0%2FMIT-blue.svg [rustc-image]: https://img.shields.io/badge/rustc-1.60+-blue.svg [safety-image]: https://img.shields.io/badge/unsafe-forbidden-success.svg [safety-link]: https://github.com/rust-secure-code/safety-dance/ [zulip-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [zulip-link]: https://rust-lang.zulipchat.com/#narrow/stream/146229-wg-secure-code/ [//]: # (general links) [serde]: https://serde.rs/ [RustSec]: https://rustsec.org/ [`petgraph`]: https://github.com/petgraph/petgraph [`cargo-tree`]: https://github.com/sfackler/cargo-tree [LICENSE-APACHE]: https://github.com/RustSec/cargo-lock/blob/main/LICENSE-APACHE [LICENSE-MIT]: https://github.com/RustSec/cargo-lock/blob/main/LICENSE-MIT cargo-lock-9.0.0/src/bin/cargo-lock/main.rs000064400000000000000000000205321046102023000165270ustar 00000000000000//! The `cargo lock` subcommand #![forbid(unsafe_code)] #![warn(rust_2018_idioms, unused_qualifications)] use cargo_lock::{ dependency::graph::EdgeDirection, dependency::Tree, package::{self}, Dependency, Lockfile, Package, ResolveVersion, Version, }; use gumdrop::Options; use petgraph::graph::NodeIndex; use std::{ env, fs, io, path::{Path, PathBuf}, process::exit, str::FromStr, }; /// `cargo lock` subcommands #[derive(Debug, Options)] enum Command { /// The `cargo lock list` subcommand #[options(help = "list packages in Cargo.lock")] List(ListCmd), /// The `cargo lock translate` subcommand #[options(help = "translate a Cargo.lock file")] Translate(TranslateCmd), /// The `cargo lock tree` subcommand #[options(help = "print a dependency tree for the given dependency")] Tree(TreeCmd), } /// The `cargo lock list` subcommand #[derive(Debug, Default, Options)] struct ListCmd { /// Input `Cargo.lock` file #[options(short = "f", help = "input Cargo.lock file")] file: Option, /// Get information for a specific package #[options(short = "p", help = "get information for a single package")] package: Option, /// List dependencies as part of the output #[options(short = "d", help = "show dependencies for each package")] dependencies: bool, /// Show package sources in list #[options(short = "s", help = "show package sources in listing")] sources: bool, } impl ListCmd { /// Display dependency summary from `Cargo.lock` pub fn run(&self) { for package in &load_lockfile(&self.file).packages { if let Some(name) = &self.package { if &package.name != name { continue; } } if self.sources { println!("- {}", Dependency::from(package)); } else { println!("- {} {}", package.name, package.version); } if self.dependencies { for dep in &package.dependencies { if self.sources { println!(" - {}", dep); } else { println!(" - {} {}", dep.name, dep.version); } } } } } } /// The `cargo lock translate` subcommand #[derive(Debug, Options)] struct TranslateCmd { /// Input `Cargo.lock` file #[options(short = "f", help = "input Cargo.lock file to translate")] file: Option, /// Output `Cargo.lock` file #[options(short = "o", help = "output Cargo.lock file (default STDOUT)")] output: Option, /// Cargo.lock format version to translate to #[options(short = "v", help = "Cargo.lock resolve version to output")] version: Option, } impl TranslateCmd { /// Translate `Cargo.lock` to a different format version pub fn run(&self) { let output = self .output .as_ref() .map(AsRef::as_ref) .unwrap_or_else(|| Path::new("-")); let mut lockfile = load_lockfile(&self.file); lockfile.version = self.version.unwrap_or_default(); let lockfile_toml = lockfile.to_string(); if output == Path::new("-") { println!("{}", &lockfile_toml); } else { fs::write(output, lockfile_toml.as_bytes()).unwrap_or_else(|e| { eprintln!("*** error: {}", e); exit(1); }); } } } /// The `cargo lock tree` subcommand #[derive(Debug, Options)] struct TreeCmd { /// Input `Cargo.lock` file #[options( short = "f", long = "file", help = "input Cargo.lock file to translate" )] file: Option, /// Show exact package identities (checksums or specific source versions) when available #[options( short = "x", long = "exact", help = "show exact package identies (checksums or specific source versions) when available" )] exact: bool, // Show inverse dependencies rather than forward dependencies #[options( short = "i", long = "invert", help = "show inverse dependencies _on_ a package, rather than forward dependencies _of_ a package" )] inverse: bool, /// Dependencies names or hashes to draw a tree for #[options(free, help = "dependency names or hashes to draw trees for")] dependencies: Vec, } fn package_matches_name(pkg: &Package, name: &str) -> bool { pkg.name.as_str() == name } fn package_matches_ver(pkg: &Package, ver: &str) -> bool { // Try interpreting ver as a semver string. if let Ok(v) = Version::from_str(ver) { return pkg.version == v; } // Try comparing ver to hashes in either the package checksum or the source // precise field if let Some(cksum) = &pkg.checksum { if cksum.to_string() == ver { return true; } } if let Some(src) = &pkg.source { if let Some(precise) = src.precise() { if precise == ver { return true; } } } false } fn package_matches(pkg: &Package, spec: &str) -> bool { if let Some((name, ver)) = spec.split_once('@') { package_matches_name(pkg, name) && package_matches_ver(pkg, ver) } else { package_matches_name(pkg, spec) || package_matches_ver(pkg, spec) } } impl TreeCmd { /// Display dependency trees from `Cargo.lock` pub fn run(&self) { let lockfile = load_lockfile(&self.file); let tree = lockfile.dependency_tree().unwrap_or_else(|e| { eprintln!("*** error: {}", e); exit(1); }); let indices: Vec = if self.dependencies.is_empty() { tree.roots().to_vec() } else { self.dependencies .iter() .map(|dep| { let package = lockfile .packages .iter() .find(|pkg| package_matches(pkg, dep)) .unwrap_or_else(|| { eprintln!("*** error: invalid dependency name: `{}`", dep); exit(1); }); tree.nodes()[&package.into()] }) .collect() }; self.dependency_tree(&tree, &indices); } /// Show dependency tree for the provided dependencies fn dependency_tree(&self, tree: &Tree, indices: &[NodeIndex]) { for (i, index) in indices.iter().enumerate() { if i > 0 { println!(); } let direction = if self.inverse { EdgeDirection::Incoming } else { EdgeDirection::Outgoing }; tree.render(&mut io::stdout(), *index, direction, self.exact) .unwrap(); } } } /// Load a lockfile from the given path (or `Cargo.toml`) fn load_lockfile(path: &Option) -> Lockfile { let path = path .as_ref() .map(AsRef::as_ref) .unwrap_or_else(|| Path::new("Cargo.lock")); Lockfile::load(path).unwrap_or_else(|e| { eprintln!("*** error: {}", e); exit(1); }) } fn main() { let mut args = env::args().collect::>(); // Remove leading arguments (bin and potential `lock`) if !args.is_empty() { args.remove(0); if args.get(0).map(AsRef::as_ref) == Some("lock") { args.remove(0); } } // If no command is specified, implicitly assume `list` if args.is_empty() || args[0].starts_with('-') { ListCmd::parse_args_default(&args) .unwrap_or_else(|e| { eprintln!("*** error: {}", e); eprintln!("USAGE:"); eprintln!("{}", ListCmd::usage()); exit(1); }) .run(); exit(0); } // ...otherwise parse and run the subcommand let cmd = Command::parse_args_default(&args).unwrap_or_else(|e| { eprintln!("*** error: {}", e); eprintln!("USAGE:"); eprintln!("{}", Command::usage()); exit(1); }); match cmd { Command::List(list) => list.run(), Command::Translate(translate) => translate.run(), Command::Tree(tree) => tree.run(), } } cargo-lock-9.0.0/src/dependency/graph.rs000064400000000000000000000005611046102023000162310ustar 00000000000000//! `petgraph` types used for modeling the `dependency::Tree`. pub use petgraph::{graph::NodeIndex, EdgeDirection}; use crate::{dependency::Dependency, package::Package, Map}; /// Dependency graph (modeled using `petgraph`) pub type Graph = petgraph::graph::Graph; /// Nodes in the dependency graph pub type Nodes = Map; cargo-lock-9.0.0/src/dependency/tree.rs000064400000000000000000000144541046102023000160750ustar 00000000000000//! Dependency trees computed from `Cargo.lock` files. //! //! Uses the `petgraph` crate for modeling the dependency structure. // Includes code from `cargo-tree`, Copyright (c) 2015-2016 Steven Fackler // Licensed under the same terms as `cargo-audit` (i.e. Apache 2.0 + MIT) use super::{ graph::{EdgeDirection, Graph, NodeIndex, Nodes}, Dependency, }; use crate::{error::Error, lockfile::Lockfile, Map}; use std::{collections::BTreeSet as Set, io}; /// Dependency tree computed from a `Cargo.lock` file #[derive(Clone, Debug)] pub struct Tree { /// Dependency graph for a particular package graph: Graph, /// Package data associated with nodes in the graph nodes: Nodes, } impl Tree { /// Construct a new dependency tree for the given [`Lockfile`]. pub fn new(lockfile: &Lockfile) -> Result { let mut graph = Graph::new(); let mut nodes = Map::new(); // Populate all graph nodes in the first pass for package in &lockfile.packages { let node_index = graph.add_node(package.clone()); nodes.insert(Dependency::from(package), node_index); } // Populate all graph edges in the second pass for package in &lockfile.packages { let parent_index = nodes[&Dependency::from(package)]; for dependency in &package.dependencies { if let Some(node_index) = nodes.get(dependency) { graph.add_edge(parent_index, *node_index, dependency.clone()); } } } Ok(Tree { graph, nodes }) } /// Render the dependency graph for the given [`NodeIndex`] using the /// default set of [`Symbols`]. pub fn render( &self, w: &mut impl io::Write, node_index: NodeIndex, direction: EdgeDirection, exact: bool, ) -> io::Result<()> { self.render_with_symbols(w, node_index, direction, &Symbols::default(), exact) } /// Render the dependency graph for the given [`NodeIndex`] using the /// provided set of [`Symbols`]. pub fn render_with_symbols( &self, w: &mut impl io::Write, node_index: NodeIndex, direction: EdgeDirection, symbols: &Symbols, exact: bool, ) -> io::Result<()> { Presenter::new(&self.graph, symbols).print_node(w, node_index, direction, exact) } /// Get the indexes of the root packages in the workspace /// (i.e. toplevel packages which are not used as dependencies) pub fn roots(&self) -> Vec { self.graph.externals(EdgeDirection::Incoming).collect() } /// Get the `petgraph` dependency graph. pub fn graph(&self) -> &Graph { &self.graph } /// Get the nodes of the `petgraph` dependency graph. pub fn nodes(&self) -> &Nodes { &self.nodes } } /// Symbols to use when printing the dependency tree pub struct Symbols { down: &'static str, tee: &'static str, ell: &'static str, right: &'static str, } impl Default for Symbols { fn default() -> Symbols { Self { down: "│", tee: "├", ell: "└", right: "─", } } } /// Dependency tree presenter struct Presenter<'g, 's> { /// Dependency graph being displayed graph: &'g Graph, /// Symbols to use to display graph symbols: &'s Symbols, /// Are there continuing levels? levels_continue: Vec, /// Dependencies we've already visited visited: Set, } impl<'g, 's> Presenter<'g, 's> { /// Create a new dependency tree `Presenter`. fn new(graph: &'g Graph, symbols: &'s Symbols) -> Self { Self { graph, symbols, levels_continue: vec![], visited: Set::new(), } } /// Print a node in the dependency tree. fn print_node( &mut self, w: &mut impl io::Write, node_index: NodeIndex, direction: EdgeDirection, exact: bool, ) -> io::Result<()> { let package = &self.graph[node_index]; let new = self.visited.insert(node_index); if let Some((&last_continues, rest)) = self.levels_continue.split_last() { for &continues in rest { let c = if continues { self.symbols.down } else { " " }; write!(w, "{} ", c)?; } let c = if last_continues { self.symbols.tee } else { self.symbols.ell }; write!(w, "{0}{1}{1} ", c, self.symbols.right)?; } if exact { let spec = if let Some(checksum) = &package.checksum { format!("checksum:{}", checksum) } else if let Some(src) = &package.source { src.to_string() } else { "inexact".to_string() }; writeln!(w, "{} {} {}", &package.name, &package.version, spec)?; } else { writeln!(w, "{} {}", &package.name, &package.version)?; } if !new { return Ok(()); } use petgraph::visit::EdgeRef; let dependencies = self .graph .edges_directed(node_index, direction) .map(|edge| match direction { EdgeDirection::Incoming => edge.source(), EdgeDirection::Outgoing => edge.target(), }) .collect::>(); for (i, dependency) in dependencies.iter().enumerate() { self.levels_continue.push(i < (dependencies.len() - 1)); self.print_node(w, *dependency, direction, exact)?; self.levels_continue.pop(); } Ok(()) } } #[cfg(test)] mod tests { use super::*; /// Load this crate's `Cargo.lock` fn load_lockfile() -> Lockfile { Lockfile::load("tests/examples/Cargo.lock.v3").unwrap() } #[test] fn compute_tree() { // TODO(tarcieri): test dependency tree is computed correctly Tree::new(&load_lockfile()).unwrap(); } #[test] fn compute_roots() { let tree = Tree::new(&load_lockfile()).unwrap(); let roots = tree.roots(); assert_eq!(roots.len(), 1); let root_package = &tree.graph[roots[0]]; assert_eq!(root_package.name.as_str(), "cargo-lock"); } } cargo-lock-9.0.0/src/dependency.rs000064400000000000000000000030171046102023000151270ustar 00000000000000//! Package dependencies #[cfg(feature = "dependency-tree")] #[cfg_attr(docsrs, doc(cfg(feature = "dependency-tree")))] pub mod graph; #[cfg(feature = "dependency-tree")] #[cfg_attr(docsrs, doc(cfg(feature = "dependency-tree")))] pub mod tree; #[cfg(feature = "dependency-tree")] pub use self::tree::Tree; use crate::package::{Name, Package, SourceId}; use semver::Version; use serde::{Deserialize, Serialize}; use std::fmt; /// Package dependencies #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)] pub struct Dependency { /// Name of the dependency pub name: Name, /// Version of the dependency pub version: Version, /// Source identifier for the dependency pub source: Option, } impl Dependency { /// Does the given [`Package`] exactly match this `Dependency`? pub fn matches(&self, package: &Package) -> bool { self.name == package.name && self.version == package.version } } impl fmt::Display for Dependency { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{} {}", &self.name, &self.version)?; if let Some(source) = &self.source { write!(f, " ({})", source)?; } Ok(()) } } impl From<&Package> for Dependency { /// Get the [`Dependency`] requirement for this `[[package]]` fn from(pkg: &Package) -> Dependency { Self { name: pkg.name.clone(), version: pkg.version.clone(), source: pkg.source.clone(), } } } cargo-lock-9.0.0/src/error.rs000064400000000000000000000024571046102023000141510ustar 00000000000000//! Error types use std::{fmt, io}; /// Result type with the `cargo-lock` crate's [`Error`] type. pub type Result = core::result::Result; /// Error type. #[derive(Debug)] #[non_exhaustive] pub enum Error { /// An error occurred performing an I/O operation (e.g. network, file) Io(io::ErrorKind), /// Couldn't parse response data Parse(String), /// Errors related to versions Version(semver::Error), } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Error::Io(kind) => write!(f, "I/O operation failed: {}", kind), Error::Parse(s) => write!(f, "parse error: {}", s), Error::Version(err) => write!(f, "version error: {}", err), } } } impl From for Error { fn from(err: io::Error) -> Self { Error::Io(err.kind()) } } impl From for Error { fn from(err: semver::Error) -> Self { Error::Version(err) } } impl From for Error { fn from(err: std::num::ParseIntError) -> Self { Error::Parse(err.to_string()) } } impl From for Error { fn from(err: toml::de::Error) -> Self { Error::Parse(err.to_string()) } } impl std::error::Error for Error {} cargo-lock-9.0.0/src/lib.rs000064400000000000000000000122751046102023000135650ustar 00000000000000#![doc = include_str!("../README.md")] #![doc(html_logo_url = "https://raw.githubusercontent.com/RustSec/logos/main/rustsec-logo-lg.png")] #![cfg_attr(docsrs, feature(doc_cfg))] #![forbid(unsafe_code)] #![warn(missing_docs, rust_2018_idioms, unused_qualifications)] //! # Usage //! //! ``` //! use cargo_lock::Lockfile; //! //! let lockfile = Lockfile::load("tests/examples/Cargo.lock").unwrap(); //! println!("number of dependencies: {}", lockfile.packages.len()); //! ``` //! //! # Dependency tree API //! //! When the `dependency-tree` feature of this crate is enabled, it supports //! computing a directed graph of the dependency tree expressed in the //! lockfile, modeled using the [`petgraph`] crate, along with support for //! printing dependency trees ala the [`cargo-tree`] crate, a CLI interface //! for which is provided by the `cargo lock tree` subcommand described above. //! //! This same graph representation of a `Cargo.lock` file is programmatically //! available via this crate's API. //! //! # Command Line Interface //! //! This crate provides a `cargo lock` Cargo subcommand which can be installed //! by running the following: //! //! ```text //! $ cargo install cargo-lock --features cli //! ``` //! //! It supports the following subcommands: //! //! ### `list`: summarize packages in `Cargo.lock` //! //! The `cargo lock list` subcommand (which can be shortened to just //! `cargo lock` if you prefer) provides a short synopsis of the packages //! enumerated in `Cargo.lock`: //! //! ```text //! $ cargo lock //! - autocfg 1.0.0 //! - cargo-lock 4.0.1 //! - fixedbitset 0.2.0 //! - gumdrop 0.8.0 //! - gumdrop_derive 0.8.0 //! - idna 0.2.0 //! - indexmap 1.3.2 //! - matches 0.1.8 //! [...] //! ``` //! //! Adding a `-d` (or `--dependencies`) flag will show transitive dependencies: //! //! ```text //! $ cargo lock -d //! - autocfg 1.0.0 //! - cargo-lock 4.0.1 //! - gumdrop 0.8.0 //! - petgraph 0.5.1 //! - semver 0.10.0 //! - serde 1.0.116 //! - toml 0.5.6 //! - url 2.1.1 //! - fixedbitset 0.2.0 //! - gumdrop 0.8.0 //! - gumdrop_derive 0.8.0 //! - gumdrop_derive 0.8.0 //! - proc-macro2 1.0.21 //! - quote 1.0.3 //! - syn 1.0.40 //! - idna 0.2.0 //! - matches 0.1.8 //! - unicode-bidi 0.3.4 //! - unicode-normalization 0.1.12 //! [...] //! ``` //! //! Adding a `-s` (or `--source`) flag will show source information for each //! package (when available): //! //! ```text //! - autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index) //! - cargo-lock 4.0.1 //! - fixedbitset 0.2.0 (registry+https://github.com/rust-lang/crates.io-index) //! - gumdrop 0.8.0 (registry+https://github.com/rust-lang/crates.io-index) //! - gumdrop_derive 0.8.0 (registry+https://github.com/rust-lang/crates.io-index) //! - idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index) //! - indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index) //! [...] //! ``` //! //! ### `translate`: convert `Cargo.lock` files between the V1 and V2 formats //! //! The `cargo lock translate` subcommand can translate V1 Cargo.lock files to //! the [V2 format] and vice versa: //! //! ```text //! $ cargo lock translate //! ``` //! //! ...will translate Cargo.lock to the V2 format. To translate a V2 Cargo.lock //! file back to the V1 format, use: //! //! ```text //! $ cargo lock translate -v1 //! ``` //! //! ### `tree`: provide information for how a dependency is included //! //! The `cargo lock tree` subcommand (similar to the `cargo-tree` command) //! can provide a visualization of the current dependency tree or how a //! particular dependency is being used in your project, by consulting //! `Cargo.lock` alone: //! //! ```text //! $ cargo lock tree //! cargo-lock 4.0.1 //! ├── url 2.1.1 //! │ ├── percent-encoding 2.1.0 //! │ ├── matches 0.1.8 //! │ └── idna 0.2.0 //! │ ├── unicode-normalization 0.1.12 //! │ │ └── smallvec 1.2.0 //! │ ├── unicode-bidi 0.3.4 //! │ │ └── matches 0.1.8 //! │ └── matches 0.1.8 //! ├── toml 0.5.6 //! │ └── serde 1.0.116 //! │ └── serde_derive 1.0.116 //! [...] //! ``` //! //! ```text //! $ cargo lock tree syn //! syn 1.0.14 //! ├── serde_derive 1.0.104 //! │ └── serde 1.0.104 //! │ ├── toml 0.5.6 //! │ │ └── cargo-lock 3.0.0 //! │ ├── semver 0.9.0 //! │ │ └── cargo-lock 3.0.0 //! │ └── cargo-lock 3.0.0 //! └── gumdrop_derive 0.7.0 //! └── gumdrop 0.7.0 //! └── cargo-lock 3.0.0 //! ``` //! //! [RustSec]: https://rustsec.org/ //! [V2 format]: https://github.com/rust-lang/cargo/pull/7070 //! [`petgraph`]: https://github.com/petgraph/petgraph //! [`cargo-tree`]: https://github.com/sfackler/cargo-tree pub mod dependency; pub mod package; mod error; mod lockfile; mod metadata; mod patch; pub use crate::{ dependency::Dependency, error::{Error, Result}, lockfile::{Lockfile, ResolveVersion}, metadata::{Metadata, MetadataKey, MetadataValue}, package::{Checksum, Name, Package, SourceId, Version}, patch::Patch, }; /// Use `BTreeMap` for all `Map` types in the crate use std::collections::BTreeMap as Map; cargo-lock-9.0.0/src/lockfile/encoding.rs000064400000000000000000000371031046102023000163720ustar 00000000000000//! serde-based `Cargo.lock` parser/serializer //! //! Customized to allow pre/postprocessing to detect and serialize both //! the V1 vs V2 formats and ensure the end-user is supplied a consistent //! representation regardless of which version is in use. //! //! Parts adapted from upstream Cargo. //! Cargo is primarily distributed under the terms of both the MIT license and //! the Apache License (Version 2.0). use super::{Lockfile, ResolveVersion}; use crate::{ metadata, Checksum, Dependency, Error, Metadata, Name, Package, Patch, Result, SourceId, Version, }; use serde::{de, ser, Deserialize, Serialize}; use std::{collections::HashMap, collections::HashSet, fmt, fmt::Write, str::FromStr}; impl<'de> Deserialize<'de> for Lockfile { fn deserialize>( deserializer: D, ) -> std::result::Result { EncodableLockfile::deserialize(deserializer)? .try_into() .map_err(de::Error::custom) } } impl Serialize for Lockfile { fn serialize(&self, serializer: S) -> std::result::Result { EncodableLockfile::from(self).serialize(serializer) } } /// Serialization-oriented equivalent to [`Lockfile`] #[derive(Debug, Deserialize, Serialize)] pub(super) struct EncodableLockfile { /// Lockfile version pub(super) version: Option, /// Packages in the lockfile #[serde(default)] pub(super) package: Vec, /// Legacy root package (preserved for compatibility) pub(super) root: Option, /// Metadata fields #[serde(default, skip_serializing_if = "Metadata::is_empty")] pub(super) metadata: Metadata, /// Patch section #[serde(default, skip_serializing_if = "Patch::is_empty")] pub(super) patch: Patch, } impl EncodableLockfile { /// Attempt to find a checksum for a package in a V1 lockfile pub fn find_checksum(&self, package: &Package) -> Option { for (key, value) in &self.metadata { if let Ok(dep) = key.checksum_dependency() { if dep.name == package.name && dep.version == package.version { return value.checksum().ok(); } } } None } } impl TryFrom for Lockfile { type Error = Error; fn try_from(raw_lockfile: EncodableLockfile) -> Result { let version = match raw_lockfile.version { Some(n) => n.try_into()?, None => ResolveVersion::detect(&raw_lockfile.package, &raw_lockfile.metadata)?, }; let mut packages = Vec::with_capacity(raw_lockfile.package.len()); for raw_package in &raw_lockfile.package { packages.push(if version == ResolveVersion::V1 { // In the V1 format, all dependencies are fully qualified with // their versions, but their checksums are stored in metadata. let mut pkg = Package::try_from(raw_package)?; pkg.checksum = raw_lockfile.find_checksum(&pkg); pkg } else { // In newer versions, we may need to look up dependency versions // from the other packages listed in the lockfile raw_package.resolve(&raw_lockfile.package)? }) } Ok(Lockfile { version, packages, root: raw_lockfile .root .as_ref() .map(|root| root.try_into()) .transpose()?, metadata: raw_lockfile.metadata, patch: raw_lockfile.patch, }) } } impl From<&Lockfile> for EncodableLockfile { fn from(lockfile: &Lockfile) -> EncodableLockfile { let mut packages = Vec::with_capacity(lockfile.packages.len()); let mut metadata = lockfile.metadata.clone(); let mut package_to_registries: HashMap<_, HashSet<&SourceId>> = HashMap::new(); for package in &lockfile.packages { if let Some(source) = package.source.as_ref() { if source.is_registry() { package_to_registries .entry(&package.name) .or_default() .insert(source); } } } for package in &lockfile.packages { let mut raw_pkg = EncodablePackage::from(package); let checksum_key = metadata::MetadataKey::for_checksum(&Dependency::from(package)); if lockfile.version == ResolveVersion::V1 { // In the V1 format, we need to remove the checksum from // packages and add it to metadata if let Some(checksum) = raw_pkg.checksum.take() { let value = checksum .to_string() .parse::() .unwrap(); metadata.insert(checksum_key, value); } } else { // In newer versions, we need to remove the version/source from // unambiguous dependencies, and remove checksums from the // metadata table if present raw_pkg.v2_deps(&lockfile.packages); metadata.remove(&checksum_key); // If there's only one registry, Cargo does not encode this information so // it should be omitted from encodable packages for dep in raw_pkg.dependencies.iter_mut() { if let Some(registries) = package_to_registries.get(&dep.name) { if registries.len() == 1 { dep.source = None; } } } } packages.push(raw_pkg); } let version = if lockfile.version.is_explicit() { Some(lockfile.version.into()) } else { None }; EncodableLockfile { version, package: packages, root: lockfile.root.as_ref().map(|root| root.into()), metadata, patch: lockfile.patch.clone(), } } } impl ToString for EncodableLockfile { /// Adapted from `serialize_resolve` in upstream Cargo: /// fn to_string(&self) -> String { let toml = toml::Value::try_from(self).unwrap(); let mut out = String::new(); // At the start of the file we notify the reader that the file is generated. // Specifically Phabricator ignores files containing "@generated", so we use that. let marker_line = "# This file is automatically @generated by Cargo."; let extra_line = "# It is not intended for manual editing."; out.push_str(marker_line); out.push('\n'); out.push_str(extra_line); out.push('\n'); if let Some(value) = toml.get("version") { if let Some(version) = value.as_integer() { if version >= 3 { writeln!(out, "version = {}", version).unwrap(); } } } out.push('\n'); let deps = toml["package"].as_array().unwrap(); for dep in deps { let dep = dep.as_table().unwrap(); out.push_str("[[package]]\n"); emit_package(dep, &mut out); } if let Some(patch) = toml.get("patch") { let list = patch["unused"].as_array().unwrap(); for entry in list { out.push_str("[[patch.unused]]\n"); emit_package(entry.as_table().unwrap(), &mut out); out.push('\n'); } } if let Some(meta) = toml.get("metadata") { out.push_str("[metadata]\n"); out.push_str(&toml::to_string_pretty(&meta).unwrap()); } // Trim redundant newlines if out.ends_with("\n\n") { out.pop(); } out } } /// Emit a single package from a lockfile. /// /// This method is adapted from the same-named method in upstream Cargo: /// fn emit_package(dep: &toml::value::Table, out: &mut String) { writeln!(out, "name = {}", &dep["name"]).unwrap(); writeln!(out, "version = {}", &dep["version"]).unwrap(); if dep.contains_key("source") { writeln!(out, "source = {}", &dep["source"]).unwrap(); } if dep.contains_key("checksum") { writeln!(out, "checksum = {}", &dep["checksum"]).unwrap(); } if let Some(s) = dep.get("dependencies") { let slice = s.as_array().unwrap(); if !slice.is_empty() { out.push_str("dependencies = [\n"); for child in slice.iter() { writeln!(out, " {},", child).unwrap(); } out.push_str("]\n"); } } else if dep.contains_key("replace") { writeln!(out, "replace = {}", &dep["replace"]).unwrap(); } out.push('\n'); } /// Serialization-oriented equivalent to [`Package`] #[derive(Debug, Deserialize, Serialize)] pub(crate) struct EncodablePackage { /// Package name pub(super) name: Name, /// Package version pub(super) version: Version, /// Source of a package pub(super) source: Option, /// Package checksum pub(super) checksum: Option, /// Package dependencies #[serde(default, skip_serializing_if = "Vec::is_empty")] pub(super) dependencies: Vec, /// Replace directive pub(super) replace: Option, } impl EncodablePackage { /// Resolve all of the dependencies of a package, which in the V2 format /// may be abbreviated to prevent merge conflicts fn resolve(&self, packages: &[EncodablePackage]) -> Result { let mut dependencies = Vec::with_capacity(self.dependencies.len()); for dep in &self.dependencies { dependencies.push(dep.resolve(packages)?); } Ok(Package { name: self.name.clone(), version: self.version.clone(), source: self.source.clone(), checksum: self.checksum.clone(), dependencies, replace: self .replace .as_ref() .map(|rep| rep.try_into()) .transpose()?, }) } /// Prepare `ResolveVersion::V2` dependencies by removing ones which are unambiguous fn v2_deps(&mut self, packages: &[Package]) { for dependency in &mut self.dependencies { dependency.v2(packages); } } } /// Note: this only works for `ResolveVersion::V1` dependencies. impl TryFrom<&EncodablePackage> for Package { type Error = Error; fn try_from(raw_package: &EncodablePackage) -> Result { raw_package.resolve(&[]) } } impl From<&Package> for EncodablePackage { fn from(package: &Package) -> EncodablePackage { EncodablePackage { name: package.name.clone(), version: package.version.clone(), source: package.source.clone(), checksum: package.checksum.clone(), dependencies: package .dependencies .iter() .map(|dep| dep.into()) .collect::>(), replace: package.replace.as_ref().map(|rep| rep.into()), } } } /// Package dependencies #[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] pub(crate) struct EncodableDependency { /// Name of the dependency pub(super) name: Name, /// Version of the dependency pub(super) version: Option, /// Source for the dependency pub(super) source: Option, } impl EncodableDependency { /// Resolve this dependency, which in the V2 format may be abbreviated to /// prevent merge conflicts pub fn resolve(&self, packages: &[EncodablePackage]) -> Result { for pkg in packages { if pkg.name == self.name && (self.version.is_none() || self.version.as_ref() == Some(&pkg.version)) && self.source.is_none() { return Ok(Dependency { name: pkg.name.clone(), version: pkg.version.clone(), source: pkg.source.clone(), }); } } let version = self .version .clone() .ok_or_else(|| Error::Parse(format!("couldn't resolve dependency: {}", self.name)))?; Ok(Dependency { name: self.name.clone(), version, source: self.source.clone(), }) } /// Prepare `ResolveVersion::V2` dependencies by removing ones which are unambiguous pub fn v2(&mut self, packages: &[Package]) { let mut matching = vec![]; for package in packages { if package.name == self.name { matching.push(package); } } // TODO(tarcieri): better handle other cases? if matching.len() == 1 { self.version = None; self.source = None; } } } impl FromStr for EncodableDependency { type Err = Error; fn from_str(s: &str) -> Result { let mut parts = s.split_whitespace(); let name = parts .next() .ok_or_else(|| Error::Parse("empty dependency string".to_owned()))? .parse()?; let version = parts.next().map(FromStr::from_str).transpose()?; let source = parts .next() .map(|s| { if s.len() < 2 || !s.starts_with('(') || !s.ends_with(')') { Err(Error::Parse(format!( "malformed source in dependency: {}", s ))) } else { s[1..(s.len() - 1)].parse() } }) .transpose()?; if parts.next().is_some() { return Err(Error::Parse(format!("malformed dependency: {}", s))); } Ok(Self { name, version, source, }) } } impl fmt::Display for EncodableDependency { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", &self.name)?; if let Some(version) = &self.version { write!(f, " {}", version)?; } if let Some(source) = &self.source { write!(f, " ({})", source)?; } Ok(()) } } /// Note: this only works for `ResolveVersion::V1` dependencies. impl TryFrom<&EncodableDependency> for Dependency { type Error = Error; fn try_from(raw_dependency: &EncodableDependency) -> Result { raw_dependency.resolve(&[]) } } impl From<&Dependency> for EncodableDependency { fn from(package: &Dependency) -> EncodableDependency { EncodableDependency { name: package.name.clone(), version: Some(package.version.clone()), source: package.source.clone(), } } } impl<'de> Deserialize<'de> for EncodableDependency { fn deserialize>( deserializer: D, ) -> std::result::Result { String::deserialize(deserializer)? .parse() .map_err(de::Error::custom) } } impl Serialize for EncodableDependency { fn serialize(&self, serializer: S) -> std::result::Result { self.to_string().serialize(serializer) } } cargo-lock-9.0.0/src/lockfile/version.rs000064400000000000000000000053131046102023000162670ustar 00000000000000//! Lockfile versions use super::encoding::EncodablePackage; use crate::{ error::{Error, Result}, metadata::Metadata, }; use serde::{Deserialize, Serialize}; use std::str::FromStr; /// Lockfile versions #[derive(Copy, Clone, Debug, Deserialize, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)] #[non_exhaustive] #[repr(u32)] pub enum ResolveVersion { /// Original `Cargo.lock` format which places checksums in the /// `[[metadata]]` table. V1 = 1, /// Revised `Cargo.lock` format which is optimized to prevent merge /// conflicts. /// /// For more information, see: /// V2 = 2, /// Encodes Git dependencies with `branch = 'master'` in the manifest as /// `?branch=master` in their URLs. /// /// For more information, see: /// V3 = 3, } impl ResolveVersion { /// Autodetect the version of a lockfile from the packages pub(super) fn detect(packages: &[EncodablePackage], metadata: &Metadata) -> Result { // V1: look for [[metadata]] keys beginning with checksum let is_v1 = metadata.keys().any(|key| key.is_checksum()); // V2: look for `checksum` fields in `[package]` let is_v2 = packages.iter().any(|package| package.checksum.is_some()); if is_v1 && is_v2 { return Err(Error::Parse("malformed lockfile: contains checksums in both [[package]] and [[metadata]] sections".to_string())); } if is_v1 { Ok(ResolveVersion::V1) } else { // Default to V2 Ok(ResolveVersion::V2) } } /// Should this version be explicitly encoded? pub(super) fn is_explicit(self) -> bool { u32::from(self) >= 3 } } /// V3 format is now the default. impl Default for ResolveVersion { fn default() -> Self { ResolveVersion::V3 } } impl From for u32 { fn from(version: ResolveVersion) -> u32 { version as u32 } } impl FromStr for ResolveVersion { type Err = Error; fn from_str(s: &str) -> Result { u32::from_str(s) .map_err(|_| Error::Parse(format!("invalid Cargo.lock format version: `{}`", s))) .and_then(Self::try_from) } } impl TryFrom for ResolveVersion { type Error = Error; fn try_from(num: u32) -> Result { match num { 1 => Ok(ResolveVersion::V1), 2 => Ok(ResolveVersion::V2), 3 => Ok(ResolveVersion::V3), _ => Err(Error::Parse(format!( "invalid Cargo.lock format version: `{}`", num ))), } } } cargo-lock-9.0.0/src/lockfile.rs000064400000000000000000000031441046102023000146020ustar 00000000000000//! Parser for `Cargo.lock` files pub(crate) mod encoding; pub mod version; pub use self::version::ResolveVersion; use self::encoding::EncodableLockfile; use crate::{ error::{Error, Result}, metadata::Metadata, package::Package, patch::Patch, }; use std::{fs, path::Path, str::FromStr, string::ToString}; #[cfg(feature = "dependency-tree")] use crate::dependency::Tree; /// Parsed Cargo.lock file containing dependencies #[derive(Clone, Debug, Eq, PartialEq)] pub struct Lockfile { /// Version of the Lockfile pub version: ResolveVersion, /// Dependencies enumerated in the lockfile pub packages: Vec, /// Legacy "root" dependency for backwards compatibility pub root: Option, /// Package metadata pub metadata: Metadata, /// Patches pub patch: Patch, } impl Lockfile { /// Load lock data from a `Cargo.lock` file pub fn load(path: impl AsRef) -> Result { fs::read_to_string(path.as_ref())?.parse() } /// Get the dependency tree for this `Lockfile`. Returns an error if the /// contents of this lockfile aren't well structured. /// /// The `dependency-tree` Cargo feature must be enabled to use this. #[cfg(feature = "dependency-tree")] pub fn dependency_tree(&self) -> Result { Tree::new(self) } } impl FromStr for Lockfile { type Err = Error; fn from_str(toml_string: &str) -> Result { Ok(toml::from_str(toml_string)?) } } impl ToString for Lockfile { fn to_string(&self) -> String { EncodableLockfile::from(self).to_string() } } cargo-lock-9.0.0/src/metadata.rs000064400000000000000000000070271046102023000145760ustar 00000000000000//! Package metadata use crate::{ error::{Error, Result}, lockfile::encoding::EncodableDependency, Checksum, Dependency, Map, }; use serde::{de, ser, Deserialize, Serialize}; use std::{fmt, str::FromStr}; /// Prefix of metadata keys for checksum entries const CHECKSUM_PREFIX: &str = "checksum "; /// Package metadata pub type Metadata = Map; /// Keys for the `[metadata]` table #[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] pub struct MetadataKey(String); impl MetadataKey { /// Create a metadata key for a checksum for the given dependency pub fn for_checksum(dep: &Dependency) -> Self { MetadataKey(format!("{}{}", CHECKSUM_PREFIX, dep)) } /// Is this metadata key a checksum entry? pub fn is_checksum(&self) -> bool { self.0.starts_with(CHECKSUM_PREFIX) } /// Get the dependency for a particular checksum value (if applicable) pub fn checksum_dependency(&self) -> Result { self.try_into() } } impl AsRef for MetadataKey { fn as_ref(&self) -> &str { &self.0 } } impl fmt::Display for MetadataKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.0) } } impl FromStr for MetadataKey { type Err = Error; fn from_str(s: &str) -> Result { Ok(MetadataKey(s.to_owned())) } } impl TryFrom<&MetadataKey> for Dependency { type Error = Error; fn try_from(key: &MetadataKey) -> Result { if !key.is_checksum() { return Err(Error::Parse( "can only parse dependencies from `checksum` metadata".to_owned(), )); } let dep = EncodableDependency::from_str(&key.as_ref()[CHECKSUM_PREFIX.len()..])?; (&dep).try_into() } } impl<'de> Deserialize<'de> for MetadataKey { fn deserialize>( deserializer: D, ) -> std::result::Result { String::deserialize(deserializer)? .parse() .map_err(de::Error::custom) } } impl Serialize for MetadataKey { fn serialize(&self, serializer: S) -> std::result::Result { self.to_string().serialize(serializer) } } /// Values in the `[metadata]` table #[derive(Clone, Debug, Eq, PartialEq)] pub struct MetadataValue(String); impl MetadataValue { /// Get the associated checksum for this value (if applicable) pub fn checksum(&self) -> Result { self.try_into() } } impl AsRef for MetadataValue { fn as_ref(&self) -> &str { &self.0 } } impl fmt::Display for MetadataValue { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.0) } } impl FromStr for MetadataValue { type Err = Error; fn from_str(s: &str) -> Result { Ok(MetadataValue(s.to_owned())) } } impl TryFrom<&MetadataValue> for Checksum { type Error = Error; fn try_from(value: &MetadataValue) -> Result { value.as_ref().parse() } } impl<'de> Deserialize<'de> for MetadataValue { fn deserialize>( deserializer: D, ) -> std::result::Result { String::deserialize(deserializer)? .parse() .map_err(de::Error::custom) } } impl Serialize for MetadataValue { fn serialize(&self, serializer: S) -> std::result::Result { self.to_string().serialize(serializer) } } cargo-lock-9.0.0/src/package/checksum.rs000064400000000000000000000063761046102023000162210ustar 00000000000000//! Package checksums (i.e. SHA-256 digests) use crate::{Error, Result}; use serde::{de, ser, Deserialize, Serialize}; use std::{fmt, str::FromStr}; /// Cryptographic checksum (SHA-256) for a package #[derive(Clone, Eq, Hash, PartialEq, PartialOrd, Ord)] pub enum Checksum { /// SHA-256 digest of a package Sha256([u8; 32]), } impl Checksum { /// Is this checksum SHA-256? pub fn is_sha256(&self) -> bool { self.as_sha256().is_some() } /// If this is a SHA-256 checksum, get the raw bytes pub fn as_sha256(&self) -> Option<[u8; 32]> { match self { Checksum::Sha256(digest) => Some(*digest), } } } impl From<[u8; 32]> for Checksum { fn from(bytes: [u8; 32]) -> Checksum { Checksum::Sha256(bytes) } } impl FromStr for Checksum { type Err = Error; fn from_str(s: &str) -> Result { if s.len() != 64 { return Err(Error::Parse(format!( "invalid checksum: expected 64 hex chars, got {}", s.len() ))); } let mut digest = [0u8; 32]; for (i, byte) in digest.iter_mut().enumerate() { *byte = u8::from_str_radix(&s[(i * 2)..=(i * 2) + 1], 16)?; } Ok(Checksum::Sha256(digest)) } } impl fmt::Debug for Checksum { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Checksum::Sha256(_) => write!(f, "Sha256({:x})", self), } } } impl fmt::Display for Checksum { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:x}", self) } } impl fmt::LowerHex for Checksum { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Checksum::Sha256(digest) => { for b in digest { write!(f, "{:02x}", b)?; } } } Ok(()) } } impl fmt::UpperHex for Checksum { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Checksum::Sha256(digest) => { for b in digest { write!(f, "{:02X}", b)?; } } } Ok(()) } } impl<'de> Deserialize<'de> for Checksum { fn deserialize>( deserializer: D, ) -> std::result::Result { let hex = String::deserialize(deserializer)?; hex.parse().map_err(de::Error::custom) } } impl Serialize for Checksum { fn serialize(&self, serializer: S) -> std::result::Result { self.to_string().serialize(serializer) } } #[cfg(test)] mod tests { use super::{Checksum, Error}; #[test] fn checksum_round_trip() { let checksum_str = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5"; let checksum = checksum_str.parse::().unwrap(); assert_eq!(checksum_str, checksum.to_string()); } #[test] fn invalid_checksum() { // Missing one hex letter let invalid_str = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f"; let error = invalid_str.parse::().err().unwrap(); assert!(matches!(error, Error::Parse(_))); } } cargo-lock-9.0.0/src/package/name.rs000064400000000000000000000015111046102023000153210ustar 00000000000000//! Package names use crate::Error; use serde::{Deserialize, Serialize}; use std::{fmt, str::FromStr}; /// Name of a Rust `[[package]]` #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)] pub struct Name(String); impl Name { /// Get package name as an `&str` pub fn as_str(&self) -> &str { &self.0 } } impl AsRef for Name { fn as_ref(&self) -> &str { self.as_str() } } impl fmt::Display for Name { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } } impl From for String { fn from(name: Name) -> String { name.0 } } impl FromStr for Name { type Err = Error; fn from_str(s: &str) -> Result { // TODO(tarcieri): ensure name is valid Ok(Name(s.into())) } } cargo-lock-9.0.0/src/package/source.rs000064400000000000000000000273041046102023000157110ustar 00000000000000//! Package source identifiers. //! //! Adapted from Cargo's `source_id.rs`: //! //! //! //! Copyright (c) 2014 The Rust Project Developers //! Licensed under the same terms as the `cargo-lock` crate: Apache 2.0 + MIT use crate::error::{Error, Result}; use serde::{de, ser, Deserialize, Serialize}; use std::{fmt, str::FromStr}; use url::Url; #[cfg(any(unix, windows))] use std::path::Path; /// Location of the crates.io index pub const CRATES_IO_INDEX: &str = "https://github.com/rust-lang/crates.io-index"; /// Location of the crates.io sparse HTTP index pub const CRATES_IO_SPARSE_INDEX: &str = "sparse+https://index.crates.io/"; /// Default branch name pub const DEFAULT_BRANCH: &str = "master"; /// Unique identifier for a source of packages. #[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] pub struct SourceId { /// The source URL. url: Url, /// The source kind. kind: SourceKind, /// For example, the exact Git revision of the specified branch for a Git Source. precise: Option, /// Name of the registry source for alternative registries name: Option, } /// The possible kinds of code source. #[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] #[non_exhaustive] pub enum SourceKind { /// A git repository. Git(GitReference), /// A local path.. Path, /// A remote registry. Registry, /// A sparse registry. SparseRegistry, /// A local filesystem-based registry. LocalRegistry, /// A directory-based registry. #[cfg(any(unix, windows))] Directory, } impl SourceId { /// Creates a `SourceId` object from the kind and URL. fn new(kind: SourceKind, url: Url) -> Result { Ok(Self { kind, url, precise: None, name: None, }) } /// Parses a source URL and returns the corresponding ID. /// /// ## Example /// /// ``` /// use cargo_lock::SourceId; /// SourceId::from_url("git+https://github.com/alexcrichton/\ /// libssh2-static-sys#80e71a3021618eb05\ /// 656c58fb7c5ef5f12bc747f"); /// ``` pub fn from_url(string: &str) -> Result { let mut parts = string.splitn(2, '+'); let kind = parts.next().unwrap(); let url = parts .next() .ok_or_else(|| Error::Parse(format!("invalid source `{}`", string)))?; match kind { "git" => { let mut url = url.into_url()?; let mut reference = GitReference::Branch(DEFAULT_BRANCH.to_string()); for (k, v) in url.query_pairs() { match &k[..] { // Map older 'ref' to branch. "branch" | "ref" => reference = GitReference::Branch(v.into_owned()), "rev" => reference = GitReference::Rev(v.into_owned()), "tag" => reference = GitReference::Tag(v.into_owned()), _ => {} } } let precise = url.fragment().map(|s| s.to_owned()); url.set_fragment(None); url.set_query(None); Ok(Self::for_git(&url, reference)?.with_precise(precise)) } "registry" => { let url = url.into_url()?; Ok(SourceId::new(SourceKind::Registry, url)? .with_precise(Some("locked".to_string()))) } "sparse" => { let url = url.into_url()?; Ok(SourceId::new(SourceKind::SparseRegistry, url)? .with_precise(Some("locked".to_string()))) } "path" => Self::new(SourceKind::Path, url.into_url()?), kind => Err(Error::Parse(format!( "unsupported source protocol: `{}` from `{string}`", kind ))), } } /// Creates a `SourceId` from a filesystem path. /// /// `path`: an absolute path. #[cfg(any(unix, windows))] pub fn for_path(path: &Path) -> Result { Self::new(SourceKind::Path, path.into_url()?) } /// Creates a `SourceId` from a Git reference. pub fn for_git(url: &Url, reference: GitReference) -> Result { Self::new(SourceKind::Git(reference), url.clone()) } /// Creates a SourceId from a remote registry URL. pub fn for_registry(url: &Url) -> Result { Self::new(SourceKind::Registry, url.clone()) } /// Creates a SourceId from a local registry path. #[cfg(any(unix, windows))] pub fn for_local_registry(path: &Path) -> Result { Self::new(SourceKind::LocalRegistry, path.into_url()?) } /// Creates a `SourceId` from a directory path. #[cfg(any(unix, windows))] pub fn for_directory(path: &Path) -> Result { Self::new(SourceKind::Directory, path.into_url()?) } /// Gets this source URL. pub fn url(&self) -> &Url { &self.url } /// Get the kind of source. pub fn kind(&self) -> &SourceKind { &self.kind } /// Human-friendly description of an index pub fn display_index(&self) -> String { if self.is_default_registry() { "crates.io index".to_string() } else { format!("`{}` index", self.url()) } } /// Human-friendly description of a registry name pub fn display_registry_name(&self) -> String { if self.is_default_registry() { "crates.io".to_string() } else if let Some(name) = &self.name { name.clone() } else { self.url().to_string() } } /// Returns `true` if this source is from a filesystem path. pub fn is_path(&self) -> bool { self.kind == SourceKind::Path } /// Returns `true` if this source is from a registry (either local or not). pub fn is_registry(&self) -> bool { matches!( self.kind, SourceKind::Registry | SourceKind::SparseRegistry | SourceKind::LocalRegistry ) } /// Returns `true` if this source is a "remote" registry. /// /// "remote" may also mean a file URL to a git index, so it is not /// necessarily "remote". This just means it is not `local-registry`. pub fn is_remote_registry(&self) -> bool { matches!(self.kind, SourceKind::Registry | SourceKind::SparseRegistry) } /// Returns `true` if this source from a Git repository. pub fn is_git(&self) -> bool { matches!(self.kind, SourceKind::Git(_)) } /// Gets the value of the precise field. pub fn precise(&self) -> Option<&str> { self.precise.as_ref().map(AsRef::as_ref) } /// Gets the Git reference if this is a git source, otherwise `None`. pub fn git_reference(&self) -> Option<&GitReference> { if let SourceKind::Git(ref s) = self.kind { Some(s) } else { None } } /// Creates a new `SourceId` from this source with the given `precise`. pub fn with_precise(&self, v: Option) -> Self { Self { precise: v, ..self.clone() } } /// Returns `true` if the remote registry is the standard . pub fn is_default_registry(&self) -> bool { self.kind == SourceKind::Registry && self.url.as_str() == CRATES_IO_INDEX || self.kind == SourceKind::SparseRegistry && self.url.as_str() == &CRATES_IO_SPARSE_INDEX[7..] } } impl Default for SourceId { fn default() -> SourceId { SourceId::for_registry(&CRATES_IO_INDEX.into_url().unwrap()).unwrap() } } impl FromStr for SourceId { type Err = Error; fn from_str(s: &str) -> Result { Self::from_url(s) } } impl fmt::Display for SourceId { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { SourceId { kind: SourceKind::Path, ref url, .. } => write!(f, "path+{}", url), SourceId { kind: SourceKind::Git(ref reference), ref url, ref precise, .. } => { write!(f, "git+{}", url)?; if let Some(pretty) = reference.pretty_ref() { write!(f, "?{}", pretty)?; } if let Some(precise) = precise.as_ref() { write!(f, "#{}", precise)?; } Ok(()) } SourceId { kind: SourceKind::Registry, ref url, .. } => write!(f, "registry+{}", url), SourceId { kind: SourceKind::SparseRegistry, ref url, .. } => write!(f, "sparse+{}", url), SourceId { kind: SourceKind::LocalRegistry, ref url, .. } => write!(f, "local-registry+{}", url), #[cfg(any(unix, windows))] SourceId { kind: SourceKind::Directory, ref url, .. } => write!(f, "directory+{}", url), } } } impl Serialize for SourceId { fn serialize(&self, s: S) -> std::result::Result { if self.is_path() { None::.serialize(s) } else { s.collect_str(&self.to_string()) } } } impl<'de> Deserialize<'de> for SourceId { fn deserialize>(d: D) -> std::result::Result { let string = String::deserialize(d)?; SourceId::from_url(&string).map_err(de::Error::custom) } } /// Information to find a specific commit in a Git repository. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum GitReference { /// From a tag. Tag(String), /// From the HEAD of a branch. Branch(String), /// From a specific revision. Rev(String), } impl GitReference { /// Returns a `Display`able view of this git reference, or None if using /// the head of the default branch pub fn pretty_ref(&self) -> Option> { match *self { GitReference::Branch(ref s) if *s == DEFAULT_BRANCH => None, _ => Some(PrettyRef { inner: self }), } } } /// A git reference that can be `Display`ed pub struct PrettyRef<'a> { inner: &'a GitReference, } impl<'a> fmt::Display for PrettyRef<'a> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self.inner { GitReference::Branch(ref b) => write!(f, "branch={}", b), GitReference::Tag(ref s) => write!(f, "tag={}", s), GitReference::Rev(ref s) => write!(f, "rev={}", s), } } } /// A type that can be converted to a Url trait IntoUrl { /// Performs the conversion fn into_url(self) -> Result; } impl<'a> IntoUrl for &'a str { fn into_url(self) -> Result { Url::parse(self).map_err(|s| Error::Parse(format!("invalid url `{}`: {}", self, s))) } } #[cfg(any(unix, windows))] impl<'a> IntoUrl for &'a Path { fn into_url(self) -> Result { Url::from_file_path(self) .map_err(|_| Error::Parse(format!("invalid path url `{}`", self.display()))) } } #[cfg(test)] mod tests { use super::SourceId; #[test] fn identifies_crates_io() { assert!(SourceId::default().is_default_registry()); assert!(SourceId::from_url(super::CRATES_IO_SPARSE_INDEX) .expect("failed to parse sparse URL") .is_default_registry()); } } cargo-lock-9.0.0/src/package.rs000064400000000000000000000016251046102023000144070ustar 00000000000000//! Rust packages enumerated in `Cargo.lock` mod checksum; mod name; mod source; pub use self::{ checksum::Checksum, name::Name, source::{GitReference, SourceId, SourceKind}, }; pub use semver::Version; use crate::dependency::Dependency; use serde::{Deserialize, Serialize}; /// Information about a Rust package (as sourced from `Cargo.lock`) #[derive(Clone, Debug, Deserialize, Eq, PartialEq, PartialOrd, Ord, Serialize)] pub struct Package { /// Name of the package pub name: Name, /// Version of the package pub version: Version, /// Source identifier for the package pub source: Option, /// Checksum for this package pub checksum: Option, /// Dependencies of the package #[serde(default, skip_serializing_if = "Vec::is_empty")] pub dependencies: Vec, /// Replace directive pub replace: Option, } cargo-lock-9.0.0/src/patch.rs000064400000000000000000000006511046102023000141110ustar 00000000000000//! The `[[patch]]` section use crate::dependency::Dependency; use serde::{Deserialize, Serialize}; /// The `[[patch]]` section of `Cargo.lock` #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] pub struct Patch { /// Unused patches pub unused: Vec, } impl Patch { /// Is the `[patch]` section empty? pub fn is_empty(&self) -> bool { self.unused.is_empty() } } cargo-lock-9.0.0/tests/examples/Cargo.lock000064400000000000000000000127631046102023000165510ustar 00000000000000# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "cargo-lock" version = "7.0.1" dependencies = [ "gumdrop", "petgraph", "semver", "serde", "toml", "url", ] [[package]] name = "fixedbitset" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "form_urlencoded" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding", ] [[package]] name = "gumdrop" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bc700f989d2f6f0248546222d9b4258f5b02a171a431f8285a81c08142629e3" dependencies = [ "gumdrop_derive", ] [[package]] name = "gumdrop_derive" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "idna" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", ] [[package]] name = "matches" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", "indexmap", ] [[package]] name = "proc-macro2" version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] [[package]] name = "quote" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] [[package]] name = "semver" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" dependencies = [ "serde", ] [[package]] name = "serde" version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "syn" version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] [[package]] name = "tinyvec" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "unicode-bidi" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-xid" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "url" version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", "matches", "percent-encoding", ] cargo-lock-9.0.0/tests/examples/Cargo.lock.v1000064400000000000000000001730241046102023000170740ustar 00000000000000# This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] name = "adler32" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "aho-corasick" version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "atty" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "autocfg" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "backtrace" version = "0.3.38" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "backtrace-sys" version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bitflags" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bstr" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bytesize" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "c2-chacha" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cargo" version = "0.40.0" dependencies = [ "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "cargo-platform 0.1.0", "cargo-test-macro 0.1.0", "cargo-test-support 0.1.0", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "crates-io 0.28.0", "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "crypto-hash 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "curl 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "curl-sys 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "fwdansi 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "git2-curl 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "home 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "ignore 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "im-rc 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "opener 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-workspace-hack 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustfix 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_ignored 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "strip-ansi-escapes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cargo-platform" version = "0.1.0" dependencies = [ "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cargo-test-macro" version = "0.1.0" [[package]] name = "cargo-test-support" version = "0.1.0" dependencies = [ "cargo 0.40.0", "cargo-test-macro 0.1.0", "filetime 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cc" version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chrono" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "clap" version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "commoncrypto" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "commoncrypto-sys" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "core-foundation" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "core-foundation-sys" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "crates-io" version = "0.28.0" dependencies = [ "curl 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crc32fast" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-channel" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-utils" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crypto-hash" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl" version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "curl-sys 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", "schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl-sys" version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libnghttp2-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "env_logger" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "env_logger" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure_derive" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "filetime" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "flate2" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fnv" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "foreign-types-shared" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fs2" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "fwdansi" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "getrandom" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "git2" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "git2-curl" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "curl 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", "git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "glob" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "globset" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hex" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hex" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "home" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "humantime" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "idna" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ignore" version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "im-rc" version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "sized-chunks 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "itoa" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jobserver" version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazycell" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" version = "0.2.62" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libssh2-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libnghttp2-sys" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libssh2-sys" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libz-sys" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "matches" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memchr" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "miniz-sys" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "miniz_oxide" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "miow" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-integer" version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num_cpus" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "opener" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl" version = "0.10.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-probe" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl-src" version = "111.6.0+1.1.1d" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" version = "0.9.49" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-src 111.6.0+1.1.1d (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pkg-config" version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ppv-lite86" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "pretty_env_logger" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-macro2" version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-macro2" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quick-error" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quote" version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_chacha" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "redox_syscall" version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "regex" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "remove_dir_all" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-demangle" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rustc-workspace-hack" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustfix" version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "ryu" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "same-file" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "schannel" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "scopeguard" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_ignored" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "shell-escape" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "sized-chunks" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "smallvec" version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "socket2" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "strip-ansi-escapes" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "vte 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "strsim" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" version = "0.15.44" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "synstructure" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tar" version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "filetime 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tempfile" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "termcolor" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "thread_local" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "toml" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "typenum" version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-normalization" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-width" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-xid" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "url" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "utf8parse" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "vcpkg" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "vec_map" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "vte" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "walkdir" version = "2.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasi" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-util" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wincolor" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" "checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" "checksum backtrace 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)" = "690a62be8920ccf773ee00ef0968649b0e724cda8bd5b12286302b4ae955fdf5" "checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" "checksum bitflags 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a606a02debe2813760609f57a64a2ffd27d9fdf5b2f133eaca0b248dd92cdd2" "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010" "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" "checksum cc 1.0.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4fc9a35e1f4290eb9e5fc54ba6cf40671ed2a2514c3eeb2b2a908dda2ea5a1be" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e8493056968583b0193c1bb04d6f7684586f3726992d6c573261941a895dbd68" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum commoncrypto 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" "checksum commoncrypto-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" "checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum crypto-hash 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8a77162240fd97248d19a564a565eb563a3f592b386e4136fb300909e67dddca" "checksum curl 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "d08ad3cb89d076a36b0ce5749eec2c9964f70c0c58480ab6b75a91ec4fc206d8" "checksum curl-sys 0.4.21 (registry+https://github.com/rust-lang/crates.io-index)" = "520594da9914c1dc77ce3be450fc1c74fde67c82966d80f8e93c6d460eb0e9ae" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" "checksum env_logger 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39ecdb7dd54465526f0a56d666e3b2dd5f3a218665a030b6e4ad9e70fa95d8fa" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" "checksum filetime 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd7380b54ced79dda72ecc35cc4fbbd1da6bba54afaa37e96fd1c2a308cd469" "checksum flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "2adaffba6388640136149e18ed080b77a78611c1e1d6de75aedcdf78df5d4682" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" "checksum fwdansi 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34dd4c507af68d37ffef962063dfa1944ce0dd4d5b82043dbab1dabe088610c3" "checksum getrandom 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "473a1265acc8ff1e808cd0a1af8cee3c2ee5200916058a2ca113c29f2d903571" "checksum git2 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39f27186fbb5ec67ece9a56990292bc5aed3c3fc51b9b07b0b52446b1dfb4a82" "checksum git2-curl 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cd6527e480187ce19aaf4fa6acfb7657b25628ce31cb8ffabdfca3bf731524c5" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" "checksum home 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c315e106bd6f83f026a20ddaeef2706782e490db1dcdd37caad38a0e895b3" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" "checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" "checksum ignore 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0ec16832258409d571aaef8273f3c3cc5b060d784e159d1a0f3b0017308f84a7" "checksum im-rc 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0197597d095c0d11107975d3175173f810ee572c2501ff4de64f4f3f119806" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" "checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" "checksum libgit2-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a30f8637eb59616ee3b8a00f6adff781ee4ddd8343a615b8238de756060cc1b3" "checksum libnghttp2-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463" "checksum libssh2-sys 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "8914d10b159fc288f2b6f253c94bd0c15a777fd5a297691141d89674b87e66fd" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" "checksum miniz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9e3ae51cea1576ceba0dde3d484d30e6e5b86dee0b2d412fe3a16a15c98202" "checksum miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7108aff85b876d06f22503dcce091e29f76733b2bfdd91eebce81f5e68203a10" "checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" "checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" "checksum opener 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "998c59e83d9474c01127a96e023b7a04bb061dd286bf8bb939d31dc8d31a7448" "checksum openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)" = "8152bb5a9b5b721538462336e3bef9a539f892715e5037fda0f984577311af15" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-src 111.6.0+1.1.1d (registry+https://github.com/rust-lang/crates.io-index)" = "b9c2da1de8a7a3f860919c01540b03a6db16de042405a8a07a5e9d0b4b825d9c" "checksum openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)" = "f4fad9e54bd23bd4cbbe48fdc08a1b8091707ac869ef8508edea2fec77dcc884" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum pkg-config 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "72d5370d90f49f70bd033c3d75e87fc529fbfff9d6f7cccef07d6170079d91ea" "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" "checksum pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afdc77cc74ec70ed262262942ebb7dac3d479e9e5cfa2da1841c0806f6cdabcc" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" "checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" "checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" "checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" "checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-workspace-hack 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc71d2faa173b74b232dedc235e3ee1696581bb132fc116fa3626d6151a1a8fb" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustfix 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7150ac777a2931a53489f5a41eb0937b84e3092a20cd0e73ad436b65b507f607" "checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" "checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" "checksum schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021" "checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "9796c9b7ba2ffe7a9ce53c2287dfc48080f4b2b362fcc245a259b3a7201119dd" "checksum serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)" = "4b133a43a1ecd55d4086bd5b4dc6c1751c68b1bfbeba7a5040442022c7e7c02e" "checksum serde_ignored 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c24bbb8f4b81834f618cd3e28698235c2fba06ddf7f4fbe30519dd081364e59" "checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" "checksum shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "170a13e64f2a51b77a45702ba77287f5c6829375b04a69cf2222acd17d0cfab9" "checksum sized-chunks 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f01db57d7ee89c8e053245deb77040a6cc8508311f381c88749c33d4b9b78785" "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" "checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" "checksum strip-ansi-escapes 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d63676e2abafa709460982ddc02a3bb586b6d15a49b75c212e06edd3933acee" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" "checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum tar 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)" = "b3196bfbffbba3e57481b6ea32249fbaf590396a52505a2615adbb79d9d826d3" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" "checksum toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c7aabe75941d914b72bf3e5d3932ed92ce0664d49d8432305a8b547c37227724" "checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" "checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" "checksum utf8parse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8772a4ccbb4e89959023bc5b7cb8623a795caa7092d99f3aa9501b9484d4557d" "checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vte 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4f42f536e22f7fcbb407639765c8fd78707a33109301f834a594758bedd6e8cf" "checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" cargo-lock-9.0.0/tests/examples/Cargo.lock.v2000064400000000000000000000127471046102023000171010ustar 00000000000000# This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "cargo-lock" version = "7.0.1" dependencies = [ "gumdrop", "petgraph", "semver", "serde", "toml", "url", ] [[package]] name = "fixedbitset" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "form_urlencoded" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding", ] [[package]] name = "gumdrop" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bc700f989d2f6f0248546222d9b4258f5b02a171a431f8285a81c08142629e3" dependencies = [ "gumdrop_derive", ] [[package]] name = "gumdrop_derive" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "idna" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", ] [[package]] name = "matches" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", "indexmap", ] [[package]] name = "proc-macro2" version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] [[package]] name = "quote" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] [[package]] name = "semver" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" dependencies = [ "serde", ] [[package]] name = "serde" version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "syn" version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] [[package]] name = "tinyvec" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "unicode-bidi" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-xid" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "url" version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", "matches", "percent-encoding", ] cargo-lock-9.0.0/tests/examples/Cargo.lock.v3000064400000000000000000000127631046102023000171000ustar 00000000000000# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "cargo-lock" version = "7.0.1" dependencies = [ "gumdrop", "petgraph", "semver", "serde", "toml", "url", ] [[package]] name = "fixedbitset" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" [[package]] name = "form_urlencoded" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding", ] [[package]] name = "gumdrop" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bc700f989d2f6f0248546222d9b4258f5b02a171a431f8285a81c08142629e3" dependencies = [ "gumdrop_derive", ] [[package]] name = "gumdrop_derive" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "hashbrown" version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "idna" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", "unicode-normalization", ] [[package]] name = "indexmap" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", ] [[package]] name = "matches" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "percent-encoding" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", "indexmap", ] [[package]] name = "proc-macro2" version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] [[package]] name = "quote" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] [[package]] name = "semver" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" dependencies = [ "serde", ] [[package]] name = "serde" version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "syn" version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] [[package]] name = "tinyvec" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] [[package]] name = "tinyvec_macros" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "toml" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] [[package]] name = "unicode-bidi" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-xid" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "url" version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", "matches", "percent-encoding", ] cargo-lock-9.0.0/tests/lockfile.rs000064400000000000000000000233301046102023000151540ustar 00000000000000//! Lockfile integration test use std::str::FromStr; // TODO(tarcieri): add more example `Cargo.lock` files which cover more scenarios use cargo_lock::{Lockfile, MetadataKey, ResolveVersion, Version}; /// Path to a V1 `Cargo.lock` file. const V1_LOCKFILE_PATH: &str = "tests/examples/Cargo.lock.v1"; /// Path to a V2 `Cargo.lock` file. const V2_LOCKFILE_PATH: &str = "tests/examples/Cargo.lock.v2"; /// Path to a V3 `Cargo.lock` file. const V3_LOCKFILE_PATH: &str = "tests/examples/Cargo.lock.v3"; /// Load example V1 `Cargo.lock` file (from the Cargo project itself) #[test] fn load_example_v1_lockfile() { let lockfile = Lockfile::load(V1_LOCKFILE_PATH).unwrap(); assert_eq!(lockfile.version, ResolveVersion::V1); assert_eq!(lockfile.packages.len(), 141); assert_eq!(lockfile.metadata.len(), 136); let package = &lockfile.packages[0]; assert_eq!(package.name.as_ref(), "adler32"); assert_eq!(package.version, Version::parse("1.0.4").unwrap()); let metadata_key: MetadataKey = "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" .parse() .unwrap(); let metadata_value = &lockfile.metadata[&metadata_key]; assert_eq!( metadata_value.as_ref(), "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" ); } /// Load example V2 `Cargo.lock` file #[test] fn load_example_v2_lockfile() { let lockfile = Lockfile::load(V2_LOCKFILE_PATH).unwrap(); assert_eq!(lockfile.version, ResolveVersion::V2); assert_eq!(lockfile.packages.len(), 25); assert_eq!(lockfile.metadata.len(), 0); } /// Load example V3 `Cargo.lock` file #[test] fn load_example_v3_lockfile() { let lockfile = Lockfile::load(V3_LOCKFILE_PATH).unwrap(); assert_eq!(lockfile.version, ResolveVersion::V3); assert_eq!(lockfile.packages.len(), 25); assert_eq!(lockfile.metadata.len(), 0); } /// Ensure V3 lockfiles encode their version correctly. #[test] fn serialize_v3() { let lockfile = Lockfile::load(V3_LOCKFILE_PATH).unwrap(); let reserialized = lockfile.to_string(); let lockfile2 = reserialized.parse::().unwrap(); assert_eq!(lockfile2.version, ResolveVersion::V3); assert_eq!(lockfile2.packages, lockfile.packages); } /// Ensure we can serialize a V2 lockfile as a V1 lockfile #[test] fn serialize_v2_to_v1() { let mut lockfile = Lockfile::load(V2_LOCKFILE_PATH).unwrap(); lockfile.version = ResolveVersion::V1; let reserialized = lockfile.to_string(); let lockfile2 = reserialized.parse::().unwrap(); assert_eq!(lockfile2.version, ResolveVersion::V1); assert_eq!(lockfile2.packages, lockfile.packages); } /// Ensure we can serialize a V1 lockfile as a V2 lockfile #[test] fn serialize_v1_to_v2() { let mut lockfile = Lockfile::load(V1_LOCKFILE_PATH).unwrap(); lockfile.version = ResolveVersion::V2; let reserialized = lockfile.to_string(); let lockfile2 = reserialized.parse::().unwrap(); assert_eq!(lockfile.packages, lockfile2.packages); } /// Test that encoded V1 lockfiles match what Cargo would normally write. #[test] fn serde_matches_v1() { let lockfile = Lockfile::load(V1_LOCKFILE_PATH).unwrap(); let reserialized = lockfile.to_string(); let file_content = std::fs::read_to_string(V1_LOCKFILE_PATH).unwrap(); assert_eq!(reserialized, file_content); } /// Test that encoded V2 lockfiles match what Cargo would normally write. #[test] fn serde_matches_v2() { let lockfile = Lockfile::load(V2_LOCKFILE_PATH).unwrap(); let reserialized = lockfile.to_string(); let file_content = std::fs::read_to_string(V2_LOCKFILE_PATH).unwrap(); assert_eq!(reserialized, file_content); } /// Test that encoded V3 lockfiles match what Cargo would normally write. #[test] fn serde_matches_v3() { let lockfile = Lockfile::load(V3_LOCKFILE_PATH).unwrap(); let reserialized = lockfile.to_string(); let file_content = std::fs::read_to_string(V3_LOCKFILE_PATH).unwrap(); assert_eq!(reserialized, file_content); } /// Dependency tree tests #[cfg(feature = "dependency-tree")] mod tree { use super::{Lockfile, V1_LOCKFILE_PATH, V2_LOCKFILE_PATH}; /// Compute a dependency graph from a non-trivial example V1 `Cargo.lock` #[test] fn compute_from_v1_example_lockfile() { let tree = Lockfile::load(V1_LOCKFILE_PATH) .unwrap() .dependency_tree() .unwrap(); assert_eq!(tree.nodes().len(), 141); } /// Compute a dependency graph from a non-trivial example V2 `Cargo.lock` #[test] fn compute_from_v2_example_lockfile() { let tree = Lockfile::load(V2_LOCKFILE_PATH) .unwrap() .dependency_tree() .unwrap(); assert_eq!(tree.nodes().len(), 25); } } /// Test that a lockfile with ambiguous registries have registries encoded for each package which has multiple #[test] fn encoding_multi_registry() { let lockfile = cargo_lock::Lockfile::from_str( r#"# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "bytes" version = "0.6.0" source = "registry+https://github.com/rust-lang/alternate-index" checksum = "e0dcbc35f504eb6fc275a6d20e4ebcda18cf50d40ba6fabff8c711fa16cb3b16" [[package]] name = "bytes" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bytestring" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b6a75fd3048808ef06af5cd79712be8111960adaf89d90250974b38fc3928a" dependencies = [ "bytes 1.2.1", "external 1.0.0", ] [[package]] name = "example" version = "0.1.0" dependencies = [ "bytes 0.6.0", "bytestring", "external 2.0.0", ] [[package]] name = "external" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d69d242d4c4bc978b19d6c5f254cfb61ae3679c4656f528c9992fe337e45a6" [[package]] name = "external" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b5e0d8097cb9529731750ba339ea6813275b868779461ba1d39b841641386d9" "#, ) .unwrap() .to_string(); let expected = r#"# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "bytes" version = "0.6.0" source = "registry+https://github.com/rust-lang/alternate-index" checksum = "e0dcbc35f504eb6fc275a6d20e4ebcda18cf50d40ba6fabff8c711fa16cb3b16" [[package]] name = "bytes" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bytestring" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b6a75fd3048808ef06af5cd79712be8111960adaf89d90250974b38fc3928a" dependencies = [ "bytes 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "external 1.0.0", ] [[package]] name = "example" version = "0.1.0" dependencies = [ "bytes 0.6.0 (registry+https://github.com/rust-lang/alternate-index)", "bytestring", "external 2.0.0", ] [[package]] name = "external" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d69d242d4c4bc978b19d6c5f254cfb61ae3679c4656f528c9992fe337e45a6" [[package]] name = "external" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b5e0d8097cb9529731750ba339ea6813275b868779461ba1d39b841641386d9" "#; assert_eq!(expected, lockfile); } /// Test that a lockfile with consistent registries are able to skip being encoded #[test] fn encoding_unified_registry() { let lockfile = r#"# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "bytes" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0dcbc35f504eb6fc275a6d20e4ebcda18cf50d40ba6fabff8c711fa16cb3b16" [[package]] name = "bytes" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bytestring" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b6a75fd3048808ef06af5cd79712be8111960adaf89d90250974b38fc3928a" dependencies = [ "bytes 1.2.1", ] [[package]] name = "example" version = "0.1.0" dependencies = [ "bytes 0.6.0", "bytestring", ] "#; assert_eq!( lockfile, cargo_lock::Lockfile::from_str(lockfile) .unwrap() .to_string(), ); } /// Test that a lockfile with git sources are correctly encoded #[test] fn encoding_registry_and_git() { let lockfile = r#"# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "tower-buffer" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4887dc2a65d464c8b9b66e0e4d51c2fd6cf5b3373afc72805b0a60bce00446a" dependencies = [ "tracing 0.1.35", ] [[package]] name = "tracing" version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" [[package]] name = "tracing" version = "0.2.0" source = "git+https://github.com/tokio-rs/tracing.git?rev=1e09e50e8d15580b5929adbade9c782a6833e4a0#1e09e50e8d15580b5929adbade9c782a6833e4a0" [[package]] name = "example" version = "0.1.0" dependencies = [ "tower-buffer", "tracing 0.2.0", ] "#; assert_eq!( lockfile, cargo_lock::Lockfile::from_str(lockfile) .unwrap() .to_string(), ); }