From 8d579e4cd54b9e4437a6c7c13040090589e5bb73 Mon Sep 17 00:00:00 2001 From: charles-r-earp <charles.r.earp@gmail.com> Date: Fri, 14 Apr 2023 21:42:26 -0700 Subject: [PATCH 001/104] Added workspace_default_members. --- src/cargo/ops/cargo_output_metadata.rs | 2 ++ tests/testsuite/metadata.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/cargo/ops/cargo_output_metadata.rs b/src/cargo/ops/cargo_output_metadata.rs index 9d52fa09ad7..c0a63aa75a2 100644 --- a/src/cargo/ops/cargo_output_metadata.rs +++ b/src/cargo/ops/cargo_output_metadata.rs @@ -43,6 +43,7 @@ pub fn output_metadata(ws: &Workspace<'_>, opt: &OutputMetadataOptions) -> Cargo Ok(ExportInfo { packages, workspace_members: ws.members().map(|pkg| pkg.package_id()).collect(), + workspace_default_members: ws.default_members().map(|pkg| pkg.package_id()).collect(), resolve, target_directory: ws.target_dir().into_path_unlocked(), version: VERSION, @@ -58,6 +59,7 @@ pub fn output_metadata(ws: &Workspace<'_>, opt: &OutputMetadataOptions) -> Cargo pub struct ExportInfo { packages: Vec<SerializedPackage>, workspace_members: Vec<PackageId>, + workspace_default_members: Vec<PackageId>, resolve: Option<MetadataResolve>, target_directory: PathBuf, version: u32, diff --git a/tests/testsuite/metadata.rs b/tests/testsuite/metadata.rs index 547916e7a77..299f5245dd4 100644 --- a/tests/testsuite/metadata.rs +++ b/tests/testsuite/metadata.rs @@ -65,6 +65,7 @@ fn cargo_metadata_simple() { } ], "workspace_members": ["foo 0.5.0 (path+file:[..]foo)"], + "workspace_default_members": ["foo 0.5.0 (path+file:[..]foo)"], "resolve": { "nodes": [ { From 18a77d841b46633f63e24e1095d31546506a2779 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Tue, 14 Mar 2023 11:44:16 +0000 Subject: [PATCH 002/104] chore: create a `[workspace]` for cargo Some dependencies in `resolver-tests` do not have any license information. This prevent it from being a member when integrating in rust-lang/rust. Will figure it out after. Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org> --- Cargo.toml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 319037cde80..339ea1ae3da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,26 @@ +[workspace] +resolver = "2" +members = [ + "benches/benchsuite", + "benches/capture", + "crates/cargo-platform", + "crates/cargo-test-macro", + "crates/cargo-test-support", + "crates/cargo-util", + "crates/crates-io", + "crates/credential/*", + "crates/home", + "crates/mdman", + "crates/resolver-tests", +] +exclude = [ + # For linkchecker (downloaded during CI) and semver-check + # TODO: Either move semver-check to crates/ folder, + # or make linkchecker run from a given directory. + "src/doc/", + "target/", # exclude bench testing +] + [package] name = "cargo" version = "0.71.0" From 74aad3bb23ec79066a92b71544451a7ee0d8c5bd Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Tue, 14 Mar 2023 11:46:00 +0000 Subject: [PATCH 003/104] chore: new Cargo feature `all-static` This is primarily for the release process of rust-lang/rust. Note that in rustc-worksace-hack[1] it enable http2 via libnghttp2, cargo probably needs to enable it to compile in rust-lang/rust. [1]: https://github.com/rust-lang/rust/blob/992d154f3a84cc8abcefcf6e6cf3698e4821b506/src/tools/rustc-workspace-hack/Cargo.toml#L77 Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org> --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 339ea1ae3da..393091afccd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -139,3 +139,5 @@ doc = false vendored-openssl = ["openssl/vendored"] vendored-libgit2 = ["libgit2-sys/vendored"] pretty-env-logger = ["pretty_env_logger"] +# This is primarily used by rust-lang/rust distributing cargo the executable. +all-static = ['vendored-openssl', 'curl/static-curl', 'curl/force-system-lib-on-osx'] From e7eaf14ae816c1a86e5ddd0b41486249da821d7d Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Tue, 14 Mar 2023 11:47:17 +0000 Subject: [PATCH 004/104] ci: use `-p` to specify which package to build an test Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org> --- .github/workflows/main.yml | 51 ++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 400e725e5f2..3146e7c4e9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,12 +24,7 @@ jobs: - run: rustup update stable && rustup default stable - run: rustup component add rustfmt - run: cargo fmt --all --check - - run: | - for manifest in `find crates benches/benchsuite benches/capture -name Cargo.toml` - do - echo check fmt for $manifest - cargo fmt --all --manifest-path $manifest --check - done + - run: cargo fmt --all --check --manifest-path crates/resolver-tests/Cargo.toml # Ensure there are no clippy warnings clippy: @@ -39,7 +34,8 @@ jobs: - run: rustup update stable && rustup default stable - run: rustup component add clippy # Only check cargo lib for now - - run: cargo clippy -p cargo --lib -- -D warnings + # TODO: check every members + - run: cargo clippy -p cargo --lib --no-deps -- -D warnings test: runs-on: ${{ matrix.os }} @@ -101,47 +97,41 @@ jobs: run: echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV if: matrix.os == 'ubuntu-latest' - - run: cargo test + - run: cargo test -p cargo - name: Clear intermediate test output run: ci/clean-test-output.sh - name: gitoxide tests (all git-related tests) - run: cargo test git + run: cargo test -p cargo git env: __CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2: 1 # The testsuite generates a huge amount of data, and fetch-smoke-test was # running out of disk space. - name: Clear test output run: ci/clean-test-output.sh + # This only tests `cargo fix` because fix-proxy-mode is one of the most + # complicated subprocess management in Cargo. - name: Check operability of rustc invocation with argfile + run: 'cargo test -p cargo --test testsuite -- fix::' env: __CARGO_TEST_FORCE_ARGFILE: 1 - run: | - # This only tests `cargo fix` because fix-proxy-mode is one of the most - # complicated subprocess management in Cargo. - cargo test --test testsuite -- fix:: - - run: cargo test --manifest-path crates/cargo-test-support/Cargo.toml - env: - CARGO_TARGET_DIR: target + - run: cargo test -p cargo-test-support - run: cargo test -p cargo-platform - run: cargo test -p cargo-util - - run: cargo test --manifest-path crates/home/Cargo.toml - - run: cargo test --manifest-path crates/mdman/Cargo.toml - - run: cargo build --manifest-path crates/credential/cargo-credential-1password/Cargo.toml - - run: cargo build --manifest-path crates/credential/cargo-credential-gnome-secret/Cargo.toml + - run: cargo test -p home + - run: cargo test -p mdman + - run: cargo build -p cargo-credential-1password + - run: cargo build -p cargo-credential-gnome-secret if: matrix.os == 'ubuntu-latest' - - run: cargo build --manifest-path crates/credential/cargo-credential-macos-keychain/Cargo.toml + - run: cargo build -p cargo-credential-macos-keychain if: matrix.os == 'macos-latest' - - run: cargo build --manifest-path crates/credential/cargo-credential-wincred/Cargo.toml + - run: cargo build -p cargo-credential-wincred if: matrix.os == 'windows-latest' - name: Check benchmarks - env: - # Share the target dir to try to cache a few build-time deps. - CARGO_TARGET_DIR: target run: | # This only tests one benchmark since it can take over 10 minutes to # download all workspaces. - cargo test --manifest-path benches/benchsuite/Cargo.toml --all-targets -- cargo - cargo check --manifest-path benches/capture/Cargo.toml + cargo test -p benchsuite --all-targets -- cargo + cargo check -p capture # The testsuite generates a huge amount of data, and fetch-smoke-test was # running out of disk space. - name: Clear benchmark output @@ -164,7 +154,7 @@ jobs: - run: rustup target add i686-unknown-linux-gnu - run: sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y - run: rustup component add rustfmt || echo "rustfmt not available" - - run: cargo test + - run: cargo test -p cargo env: __CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2: 1 @@ -175,7 +165,7 @@ jobs: - run: rustup update nightly && rustup default nightly - run: rustup component add rust-src - run: cargo build - - run: cargo test --test build-std + - run: cargo test -p cargo --test build-std env: CARGO_RUN_BUILD_STD_TESTS: 1 docs: @@ -192,7 +182,8 @@ jobs: mkdir mdbook curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook echo `pwd`/mdbook >> $GITHUB_PATH - - run: cargo doc --document-private-items --no-deps + # TODO: should check all workspace members + - run: cargo doc -p cargo --document-private-items --no-deps env: RUSTDOCFLAGS: -D warnings - run: cd src/doc && mdbook build --dest-dir ../../target/doc From 007b84bd536e6b1a65d3c3906177e7705b62bbdc Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Tue, 14 Mar 2023 11:49:15 +0000 Subject: [PATCH 005/104] chore: track Cargo.lock Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org> --- Cargo.lock | 3714 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 3714 insertions(+) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000000..c6d9347027f --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3714 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-wincon", + "concolor-override", + "concolor-query", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" + +[[package]] +name = "anstyle-parse" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-wincon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +dependencies = [ + "anstyle", + "windows-sys 0.45.0", +] + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "benchsuite" +version = "0.1.0" +dependencies = [ + "cargo", + "criterion", + "flate2", + "tar", + "url", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bstr" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +dependencies = [ + "memchr", + "once_cell", + "regex-automata", + "serde", +] + +[[package]] +name = "btoi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" +dependencies = [ + "num-traits", +] + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "bytesize" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" + +[[package]] +name = "camino" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +dependencies = [ + "serde", +] + +[[package]] +name = "capture" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "flate2", + "tar", + "toml", +] + +[[package]] +name = "cargo" +version = "0.71.0" +dependencies = [ + "anyhow", + "base64", + "bytesize", + "cargo-platform 0.1.2", + "cargo-test-macro", + "cargo-test-support", + "cargo-util", + "clap 4.2.1", + "crates-io", + "curl", + "curl-sys", + "env_logger 0.10.0", + "filetime", + "flate2", + "fwdansi", + "git2", + "git2-curl", + "gix", + "gix-features", + "glob", + "hex", + "hmac", + "home 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http-auth", + "humantime 2.1.0", + "ignore", + "im-rc", + "indexmap", + "is-terminal", + "itertools", + "jobserver", + "lazy_static", + "lazycell", + "libc", + "libgit2-sys", + "log", + "memchr", + "opener", + "openssl", + "os_info", + "pasetors", + "pathdiff", + "pretty_env_logger", + "rand", + "rustc-workspace-hack", + "rustfix", + "same-file", + "semver", + "serde", + "serde-value", + "serde_ignored", + "serde_json", + "sha1", + "shell-escape", + "snapbox", + "strip-ansi-escapes", + "tar", + "tempfile", + "termcolor", + "time", + "toml", + "toml_edit", + "unicode-width", + "unicode-xid", + "url", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "cargo-credential" +version = "0.2.0" + +[[package]] +name = "cargo-credential-1password" +version = "0.2.0" +dependencies = [ + "cargo-credential", + "serde", + "serde_json", +] + +[[package]] +name = "cargo-credential-gnome-secret" +version = "0.2.0" +dependencies = [ + "cargo-credential", + "pkg-config", +] + +[[package]] +name = "cargo-credential-macos-keychain" +version = "0.2.0" +dependencies = [ + "cargo-credential", + "security-framework", +] + +[[package]] +name = "cargo-credential-wincred" +version = "0.2.0" +dependencies = [ + "cargo-credential", + "windows-sys 0.45.0", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-test-macro" +version = "0.1.0" + +[[package]] +name = "cargo-test-support" +version = "0.1.0" +dependencies = [ + "anyhow", + "cargo-test-macro", + "cargo-util", + "crates-io", + "filetime", + "flate2", + "git2", + "glob", + "itertools", + "lazy_static", + "pasetors", + "serde", + "serde_json", + "snapbox", + "tar", + "termcolor", + "time", + "toml", + "url", + "windows-sys 0.45.0", +] + +[[package]] +name = "cargo-util" +version = "0.2.4" +dependencies = [ + "anyhow", + "core-foundation", + "filetime", + "hex", + "jobserver", + "libc", + "log", + "miow", + "same-file", + "sha2", + "shell-escape", + "tempfile", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "semver", + "serde", + "serde_json", +] + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "bitflags", + "textwrap", + "unicode-width", +] + +[[package]] +name = "clap" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" +dependencies = [ + "anstream", + "anstyle", + "bitflags", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_lex" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" + +[[package]] +name = "clru" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" + +[[package]] +name = "concolor-override" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" + +[[package]] +name = "concolor-query" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" +dependencies = [ + "windows-sys 0.45.0", +] + +[[package]] +name = "const-oid" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" + +[[package]] +name = "content_inspector" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38" +dependencies = [ + "memchr", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "cpufeatures" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +dependencies = [ + "libc", +] + +[[package]] +name = "crates-io" +version = "0.36.0" +dependencies = [ + "anyhow", + "curl", + "percent-encoding", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "criterion" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" +dependencies = [ + "atty", + "cast", + "clap 2.34.0", + "criterion-plot", + "csv", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "plotters", + "rayon", + "regex", + "serde", + "serde_cbor", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2538c4e68e52548bacb3e83ac549f903d44f011ac9d5abb5e132e67d0808f7" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csv" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" +dependencies = [ + "csv-core", + "itoa 1.0.6", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +dependencies = [ + "memchr", +] + +[[package]] +name = "ct-codecs" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "curl" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.61+curl-8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14d05c10f541ae6f3bc5b3d923c20001f47db7d5f0b2bc6ad16490133842db79" +dependencies = [ + "cc", + "libc", + "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi", +] + +[[package]] +name = "der" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b10af9f9f9f2134a42d3f8aa74658660f2e0234b0eb81bd171df8aa32779ed" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dunce" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" + +[[package]] +name = "ecdsa" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a48e5d537b8a30c0b023116d981b16334be1485af7ca68db3a2b7024cbc957fd" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519-compact" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3d382e8464107391c8706b4c14b087808ecb909f6c15c34114bc42e53a9e4c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "elliptic-curve" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75c71eaa367f2e5d556414a8eea812bc62985c879748d6403edabd9cb03f16e7" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "atty", + "humantime 1.3.0", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +dependencies = [ + "humantime 2.1.0", + "is-terminal", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + +[[package]] +name = "filetime" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys 0.48.0", +] + +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "libz-sys", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[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 = "fwdansi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c1f5787fe85505d1f7777268db5103d80a7a374d2316a7ce262e57baf8f208" +dependencies = [ + "memchr", + "termcolor", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "git2" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89511277159354bea13ae1e53e0c9ab85ba1b20d7e91618fa30e6bc5566857fb" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "git2-curl" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f8b7432b72928cff76f69e59ed5327f94a52763731e71274960dee72fe5f8c" +dependencies = [ + "curl", + "git2", + "log", + "url", +] + +[[package]] +name = "gix" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dabfac58aecb4a38cdd2568de66eb1f0d968fd6726f5a80cb8bea7944ef10cc0" +dependencies = [ + "gix-actor", + "gix-attributes", + "gix-config", + "gix-credentials", + "gix-date", + "gix-diff", + "gix-discover", + "gix-features", + "gix-glob", + "gix-hash", + "gix-hashtable", + "gix-index", + "gix-lock", + "gix-mailmap", + "gix-object", + "gix-odb", + "gix-pack", + "gix-path", + "gix-prompt", + "gix-protocol", + "gix-ref", + "gix-refspec", + "gix-revision", + "gix-sec", + "gix-tempfile", + "gix-transport", + "gix-traverse", + "gix-url", + "gix-validate", + "gix-worktree", + "log", + "once_cell", + "prodash", + "signal-hook", + "smallvec", + "thiserror", + "unicode-normalization", +] + +[[package]] +name = "gix-actor" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc22b0cdc52237667c301dd7cdc6ead8f8f73c9f824e9942c8ebd6b764f6c0bf" +dependencies = [ + "bstr", + "btoi", + "gix-date", + "itoa 1.0.6", + "nom", + "thiserror", +] + +[[package]] +name = "gix-attributes" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2231a25934a240d0a4b6f4478401c73ee81d8be52de0293eedbc172334abf3e1" +dependencies = [ + "bstr", + "gix-features", + "gix-glob", + "gix-path", + "gix-quote", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-bitmap" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "024bca0c7187517bda5ea24ab148c9ca8208dd0c3e2bea88cdb2008f91791a6d" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-chunk" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0d39583cab06464b8bf73b3f1707458270f0e7383cb24c3c9c1a16e6f792978" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-command" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2c6f75c1e0f924de39e750880a6e21307194bb1ab773efe3c7d2d787277f8ab" +dependencies = [ + "bstr", +] + +[[package]] +name = "gix-config" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c62e26ce11f607712e4f49a0a192ed87675d30187fd61be070abbd607d12f1" +dependencies = [ + "bstr", + "gix-config-value", + "gix-features", + "gix-glob", + "gix-path", + "gix-ref", + "gix-sec", + "memchr", + "nom", + "once_cell", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-config-value" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d09154c0c8677e4da0ec35e896f56ee3e338e741b9599fae06075edd83a4081c" +dependencies = [ + "bitflags", + "bstr", + "gix-path", + "libc", + "thiserror", +] + +[[package]] +name = "gix-credentials" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be32b5fe339a31b8e53fa854081dc914c45020dcb64637f3c21baf69c96fc1b" +dependencies = [ + "bstr", + "gix-command", + "gix-config-value", + "gix-path", + "gix-prompt", + "gix-sec", + "gix-url", + "thiserror", +] + +[[package]] +name = "gix-date" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96271912ce39822501616f177dea7218784e6c63be90d5f36322ff3a722aae2" +dependencies = [ + "bstr", + "itoa 1.0.6", + "thiserror", + "time", +] + +[[package]] +name = "gix-diff" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "103a0fa79b0d438f5ecb662502f052e530ace4fe1fe8e1c83c0c6da76d728e67" +dependencies = [ + "gix-hash", + "gix-object", + "imara-diff", + "thiserror", +] + +[[package]] +name = "gix-discover" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c204adba5ebd211c74735cbb65817d277e154486bac0dffa3701f163b80350" +dependencies = [ + "bstr", + "dunce", + "gix-hash", + "gix-path", + "gix-ref", + "gix-sec", + "thiserror", +] + +[[package]] +name = "gix-features" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b76f9a80f6dd7be66442ae86e1f534effad9546676a392acc95e269d0c21c22" +dependencies = [ + "bytes", + "crc32fast", + "crossbeam-channel", + "flate2", + "gix-hash", + "libc", + "once_cell", + "parking_lot", + "prodash", + "sha1_smol", + "thiserror", + "walkdir", +] + +[[package]] +name = "gix-glob" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993" +dependencies = [ + "bitflags", + "bstr", +] + +[[package]] +name = "gix-hash" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a258595457bc192d1f1c59d0d168a1e34e2be9b97a614e14995416185de41a7" +dependencies = [ + "hex", + "thiserror", +] + +[[package]] +name = "gix-hashtable" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e55e40dfd694884f0eb78796c5bddcf2f8b295dace47039099dd7e76534973" +dependencies = [ + "gix-hash", + "hashbrown 0.13.2", + "parking_lot", +] + +[[package]] +name = "gix-index" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12caf7886c7ba06f2b28835cdc2be1dca86bd047d00299d2d49e707ce1c2616" +dependencies = [ + "bitflags", + "bstr", + "btoi", + "filetime", + "gix-bitmap", + "gix-features", + "gix-hash", + "gix-lock", + "gix-object", + "gix-traverse", + "itoa 1.0.6", + "memmap2", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-lock" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66119ff8a4a395d0ea033fef718bc85f8b4f0855874f4ce1e005fc16cfe1f66e" +dependencies = [ + "fastrand", + "gix-tempfile", + "thiserror", +] + +[[package]] +name = "gix-mailmap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b66aea5e52875cd4915f4957a6f4b75831a36981e2ec3f5fad9e370e444fe1a" +dependencies = [ + "bstr", + "gix-actor", + "thiserror", +] + +[[package]] +name = "gix-object" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df068db9180ee935fbb70504848369e270bdcb576b05c0faa8b9fd3b86fc017" +dependencies = [ + "bstr", + "btoi", + "gix-actor", + "gix-features", + "gix-hash", + "gix-validate", + "hex", + "itoa 1.0.6", + "nom", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-odb" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9a5f9e1afbd509761977a2ea02869cedaaba500b4e783deb2e4de5179a55a80" +dependencies = [ + "arc-swap", + "gix-features", + "gix-hash", + "gix-object", + "gix-pack", + "gix-path", + "gix-quote", + "parking_lot", + "tempfile", + "thiserror", +] + +[[package]] +name = "gix-pack" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51db84e1459a8022e518d40a8778028d793dbb28e4d35c9a5eaf92658fb0775" +dependencies = [ + "clru", + "gix-chunk", + "gix-diff", + "gix-features", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-traverse", + "memmap2", + "parking_lot", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-packetline" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63e5e5a9a92d4fc6b63ff9d94954d25c779ce25c98d5bbe2e4399aa42f7073c" +dependencies = [ + "bstr", + "hex", + "thiserror", +] + +[[package]] +name = "gix-path" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32370dce200bb951df013e03dff35b4233fc7a89458642b047629b91734a7e19" +dependencies = [ + "bstr", + "thiserror", +] + +[[package]] +name = "gix-prompt" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3034d4d935aef2c7bf719aaa54b88c520e82413118d886ae880a31d5bdee57" +dependencies = [ + "gix-command", + "gix-config-value", + "nix", + "parking_lot", + "thiserror", +] + +[[package]] +name = "gix-protocol" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d372ab11d5d28ac21800e3f1a6603a67c1ead57f6f5fab07e1e73e960f331c1" +dependencies = [ + "bstr", + "btoi", + "gix-credentials", + "gix-features", + "gix-hash", + "gix-transport", + "maybe-async", + "nom", + "thiserror", +] + +[[package]] +name = "gix-quote" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a282f5a8d9ee0b09ec47390ac727350c48f2f5c76d803cd8da6b3e7ad56e0bcb" +dependencies = [ + "bstr", + "btoi", + "thiserror", +] + +[[package]] +name = "gix-ref" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90a0ed29e581f04b904ecd0c32b11f33b8209b5a0af9c43f415249a4f2fba632" +dependencies = [ + "gix-actor", + "gix-features", + "gix-hash", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-validate", + "memmap2", + "nom", + "thiserror", +] + +[[package]] +name = "gix-refspec" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aba332462bda2e8efeae4302b39a6ed01ad56ef772fd5b7ef197cf2798294d65" +dependencies = [ + "bstr", + "gix-hash", + "gix-revision", + "gix-validate", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-revision" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c6f6ff53f888858afc24bf12628446a14279ceec148df6194481f306f553ad2" +dependencies = [ + "bstr", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", + "thiserror", +] + +[[package]] +name = "gix-sec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ffa5bf0772f9b01de501c035b6b084cf9b8bb07dec41e3afc6a17336a65f47" +dependencies = [ + "bitflags", + "dirs", + "gix-path", + "libc", + "windows", +] + +[[package]] +name = "gix-tempfile" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88751f247234b1f73c8e8056fd835a0999b04e596e052302cb71186005dc4b27" +dependencies = [ + "libc", + "once_cell", + "parking_lot", + "signal-hook", + "signal-hook-registry", + "tempfile", +] + +[[package]] +name = "gix-transport" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d633947b36a2fbbc089195bdc71621158f1660c2ff2a6b12b0279c16e2f764bc" +dependencies = [ + "base64", + "bstr", + "curl", + "gix-command", + "gix-credentials", + "gix-features", + "gix-packetline", + "gix-quote", + "gix-sec", + "gix-url", + "thiserror", +] + +[[package]] +name = "gix-traverse" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd9a4a07bb22168dc79c60e1a6a41919d198187ca83d8a5940ad8d7122a45df3" +dependencies = [ + "gix-hash", + "gix-hashtable", + "gix-object", + "thiserror", +] + +[[package]] +name = "gix-url" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "044072b7ce8601b62dcec841b92129f5cc677072823324121b395d766ac5f528" +dependencies = [ + "bstr", + "gix-features", + "gix-path", + "home 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "url", +] + +[[package]] +name = "gix-validate" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd629d3680773e1785e585d76fd4295b740b559cad9141517300d99a0c8c049" +dependencies = [ + "bstr", + "thiserror", +] + +[[package]] +name = "gix-worktree" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7cb9af6e56152953d8fe113c4f9d7cf60cf7a982362711e9200a255579b49cb" +dependencies = [ + "bstr", + "gix-attributes", + "gix-features", + "gix-glob", + "gix-hash", + "gix-index", + "gix-object", + "gix-path", + "io-close", + "thiserror", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "globset" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "handlebars" +version = "3.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" +dependencies = [ + "log", + "pest", + "pest_derive", + "quick-error 2.0.1", + "serde", + "serde_json", + "walkdir", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.4" +dependencies = [ + "windows-sys 0.45.0", +] + +[[package]] +name = "home" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +dependencies = [ + "winapi", +] + +[[package]] +name = "http-auth" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5430cacd7a1f9a02fbeb350dfc81a0e5ed42d81f3398cb0ba184017f85bdcfbc" +dependencies = [ + "memchr", +] + +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error 1.2.3", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[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 = "ignore" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +dependencies = [ + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "im-rc" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe" +dependencies = [ + "bitmaps", + "rand_core", + "rand_xoshiro", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "imara-diff" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" +dependencies = [ + "ahash", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-close" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +dependencies = [ + "hermit-abi 0.3.1", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "is-terminal" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.141" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" + +[[package]] +name = "libgit2-sys" +version = "0.15.0+1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "032e537ae4dd4e50c877f258dc55fcd0657b5021f454094a425bb6bcc9edea4c" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "libnghttp2-sys" +version = "0.1.7+1.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "libssh2-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "maybe-async" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "mdman" +version = "0.1.0" +dependencies = [ + "anyhow", + "handlebars", + "pretty_assertions", + "pulldown-cmark", + "same-file", + "serde_json", + "url", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "miow" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ffbca2f655e33c08be35d87278e5b18b89550a37dbd598c20db92f6a471123" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "nix" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "static_assertions", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +dependencies = [ + "hermit-abi 0.2.6", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "opener" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "293c15678e37254c15bd2f092314abb4e51d7fdde05c2021279c12631b54f005" +dependencies = [ + "bstr", + "winapi", +] + +[[package]] +name = "openssl" +version = "0.10.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e30d8bc91859781f0a943411186324d580f2bbeb71b452fe91ae344806af3f1" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.14", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-src" +version = "111.25.2+1.1.1t" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320708a054ad9b3bf314688b5db87cf4d6683d64cfc835e2337924ae62bf4431" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d3d193fb1488ad46ffe3aaabc912cc931d02ee8518fe2959aea8ef52718b0c0" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "ordered-float" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" +dependencies = [ + "num-traits", +] + +[[package]] +name = "orion" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbe74a766292f94f7e69db5a7bf010eadd944f24186c463fe578a7e637582066" +dependencies = [ + "fiat-crypto", + "subtle", + "zeroize", +] + +[[package]] +name = "os_info" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" +dependencies = [ + "log", + "serde", + "winapi", +] + +[[package]] +name = "output_vt100" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" +dependencies = [ + "winapi", +] + +[[package]] +name = "p384" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.45.0", +] + +[[package]] +name = "partial_ref" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f728bc9b1479656e40cba507034904a8c44027c0efdbbaf6a4bdc5f2d3a910c" +dependencies = [ + "partial_ref_derive", +] + +[[package]] +name = "partial_ref_derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e1d2cb5b898b5a5342e994e0d0c367dbfe69cbf717cd307045ec9fb057581" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pasetors" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824bf633b85dc1dece2eb07161627ba5d90a951597cd5dbf8d85f4d82b7aea69" +dependencies = [ + "ct-codecs", + "ed25519-compact", + "getrandom", + "orion", + "p384", + "rand_core", + "regex", + "serde", + "serde_json", + "sha2", + "subtle", + "time", + "zeroize", +] + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1403e8401ad5dedea73c626b99758535b342502f8d1e361f4a2dd952749122" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be99c4c1d2fc2769b1d00239431d711d08f6efedcecb8b6e30707160aee99c15" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e56094789873daa36164de2e822b3888c6ae4b4f9da555a1103587658c805b1e" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.14", +] + +[[package]] +name = "pest_meta" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6733073c7cff3d8459fda0e42f13a047870242aed8b509fe98000928975f359e" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "plotters" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" +dependencies = [ + "num-traits", + "plotters-backend", + "plotters-svg", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" + +[[package]] +name = "plotters-svg" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "pretty_assertions" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" +dependencies = [ + "ctor", + "diff", + "output_vt100", + "yansi", +] + +[[package]] +name = "pretty_env_logger" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "926d36b9553851b8b0005f1275891b392ee4d2d833852c417ed025477350fb9d" +dependencies = [ + "env_logger 0.7.1", + "log", +] + +[[package]] +name = "primeorder" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8d3875361e28f7753baefef104386e7aa47642c93023356d97fdef4003bfb5" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prodash" +version = "23.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9516b775656bc3e8985e19cd4b8c0c0de045095074e453d2c0a513b5f978392d" +dependencies = [ + "parking_lot", +] + +[[package]] +name = "proptest" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f1b898011ce9595050a68e60f90bad083ff2987a695a42357134c8381fba70" +dependencies = [ + "bit-set", + "bitflags", + "byteorder", + "lazy_static", + "num-traits", + "quick-error 2.0.1", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "pulldown-cmark" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" +dependencies = [ + "bitflags", + "memchr", + "unicase", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "resolver-tests" +version = "0.1.0" +dependencies = [ + "cargo", + "cargo-util", + "is-terminal", + "lazy_static", + "proptest", + "varisat", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-workspace-hack" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc71d2faa173b74b232dedc235e3ee1696581bb132fc116fa3626d6151a1a8fb" + +[[package]] +name = "rustfix" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" +dependencies = [ + "anyhow", + "log", + "serde", + "serde_json", +] + +[[package]] +name = "rustix" +version = "0.37.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error 1.2.3", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +dependencies = [ + "windows-sys 0.42.0", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sec1" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[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.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.14", +] + +[[package]] +name = "serde_ignored" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94eb4a4087ba8bdf14a9208ac44fddbf55c01a6195f7edfc511ddaff6cae45a6" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_json" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +dependencies = [ + "itoa 1.0.6", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +dependencies = [ + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + +[[package]] +name = "signal-hook" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "similar" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "snapbox" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9615402f9cff539301119bdf2c2f328739cf2b45c2116666618fb6ac399f75bb" +dependencies = [ + "anstream", + "anstyle", + "content_inspector", + "dunce", + "filetime", + "normalize-line-endings", + "similar", + "snapbox-macros", + "tempfile", + "walkdir", +] + +[[package]] +name = "snapbox-macros" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8e40c667388ed1cb5060f545d0013bf0a23efdfa6c5c3e9ef592de391cd860f" +dependencies = [ + "anstream", +] + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spki" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a5be806ab6f127c3da44b7378837ebf01dadca8510a0e572460216b228bd0e" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strip-ansi-escapes" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "011cbb39cf7c1f62871aea3cc46e5817b0937b49e9447370c93cacbe93a766d8" +dependencies = [ + "vte", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf316d5356ed6847742d036f8a39c3b8435cac10bd528a4bd461928a6ab34d5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.14", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +dependencies = [ + "itoa 1.0.6", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-bom" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63ec69f541d875b783ca40184d655f2927c95f0bffd486faa83cd3ac3529ec32" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[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", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "varisat" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe609851d1e9196674ac295f656bd8601200a1077343d22b345013497807caf" +dependencies = [ + "anyhow", + "itoa 0.4.8", + "leb128", + "log", + "ordered-float", + "partial_ref", + "rustc-hash", + "serde", + "thiserror", + "varisat-checker", + "varisat-dimacs", + "varisat-formula", + "varisat-internal-macros", + "varisat-internal-proof", + "vec_mut_scan", +] + +[[package]] +name = "varisat-checker" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135c977c5913ed6e98f6b81b8e4d322211303b7d40dae773caef7ad1de6c763b" +dependencies = [ + "anyhow", + "log", + "partial_ref", + "rustc-hash", + "smallvec", + "thiserror", + "varisat-dimacs", + "varisat-formula", + "varisat-internal-proof", +] + +[[package]] +name = "varisat-dimacs" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1dee4e21be1f04c0a939f7ae710cced47233a578de08a1b3c7d50848402636" +dependencies = [ + "anyhow", + "itoa 0.4.8", + "thiserror", + "varisat-formula", +] + +[[package]] +name = "varisat-formula" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395c5543b9bfd9076d6d3af49d6c34a4b91b0b355998c0a5ec6ed7265d364520" + +[[package]] +name = "varisat-internal-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602ece773543d066aa7848455486c6c0422a3f214da7a2b899100f3c4f12408d" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "varisat-internal-proof" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6163bb7bc9018af077b76d64f976803d141c36a27d640f1437dddc4fd527d207" +dependencies = [ + "anyhow", + "varisat-formula", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_mut_scan" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ed610a8d5e63d9c0e31300e8fdb55104c5f21e422743a9dc74848fa8317fd2" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "vte" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" +dependencies = [ + "arrayvec", + "utf8parse", + "vte_generate_state_changes", +] + +[[package]] +name = "vte_generate_state_changes" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "web-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winnow" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +dependencies = [ + "memchr", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" From 144b22346de7a6b2e0ac0f6b743c69ede2c9573c Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Tue, 14 Mar 2023 15:12:54 +0000 Subject: [PATCH 006/104] chore: remove dependency `rustc-workspace-hack` Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org> --- Cargo.lock | 7 ------- Cargo.toml | 5 ----- 2 files changed, 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c6d9347027f..62eccdc50b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -284,7 +284,6 @@ dependencies = [ "pathdiff", "pretty_env_logger", "rand", - "rustc-workspace-hack", "rustfix", "same-file", "semver", @@ -2665,12 +2664,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc-workspace-hack" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc71d2faa173b74b232dedc235e3ee1696581bb132fc116fa3626d6151a1a8fb" - [[package]] name = "rustfix" version = "0.6.1" diff --git a/Cargo.toml b/Cargo.toml index 393091afccd..6e1460e8e4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,11 +100,6 @@ unicode-xid = "0.2.0" url = "2.2.2" walkdir = "2.2" -# A noop dependency that changes in the Rust repository, it's a bit of a hack. -# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` -# for more information. -rustc-workspace-hack = "1.0.0" - [target.'cfg(windows)'.dependencies] fwdansi = "1.1.0" From 11f06506636e09d84e142663e7eef3e1b43e01b3 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Sun, 16 Apr 2023 07:56:54 +0100 Subject: [PATCH 007/104] chore: use openssl only on non-Windows platforms --- Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6e1460e8e4f..554c275b4b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,6 @@ libgit2-sys = "0.15.0" log = "0.4.6" memchr = "2.1.3" opener = "0.5" -openssl = { version = '0.10.11', optional = true } os_info = "3.5.0" pasetors = { version = "0.6.4", features = ["v3", "paserk", "std", "serde"] } pathdiff = "0.2" @@ -100,6 +99,9 @@ unicode-xid = "0.2.0" url = "2.2.2" walkdir = "2.2" +[target.'cfg(not(windows))'.dependencies] +openssl = { version = "0.10.50", optional = true } + [target.'cfg(windows)'.dependencies] fwdansi = "1.1.0" From 936a99b7636242ceb0fb8da8e4d6a021082c3534 Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Sun, 16 Apr 2023 18:28:05 -0700 Subject: [PATCH 008/104] Clarify some 1.69 changelog entries. --- CHANGELOG.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3d488d9249..37f08909803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,7 +72,7 @@ [#11558](https://github.com/rust-lang/cargo/pull/11558) - Cargo now suggests `cargo add` if you try to install a library crate. [#11410](https://github.com/rust-lang/cargo/pull/11410) -- Cargo now sets `CARGO_BIN_NAME` environment variable also for binary examples. +- Cargo now sets the `CARGO_BIN_NAME` environment variable also for binary examples. [#11705](https://github.com/rust-lang/cargo/pull/11705) ### Changed @@ -82,13 +82,12 @@ Cargo will enable default features of that dependency. [#11409](https://github.com/rust-lang/cargo/pull/11409) - ❗ Deny `CARGO_HOME` in `[env]` configuration table. Cargo itself doesn't - pick up this value, but recursive calls to cargo will. We consider it as a - wrong behavior to only pass it to recursive invocations. + pick up this value, but recursive calls to cargo would, which was not intended. [#11644](https://github.com/rust-lang/cargo/pull/11644) -- ❗ Debuginfo for build dependencies is now off if not explicit set. This is - expected to boost the overall build time. +- ❗ Debuginfo for build dependencies is now off if not explicitly set. This is + expected to improve the overall build time. [#11252](https://github.com/rust-lang/cargo/pull/11252) -- Cargo now emits errors on invalid alphanumeric token for crates.io. +- Cargo now emits errors on invalid alphanumeric characters in a registry token. [#11600](https://github.com/rust-lang/cargo/pull/11600) - `cargo add` now checks only the order of `[dependencies]` without considering `[dependencies.*]`. From e7b5dad10208b2ac66f9588d6cd25ee9cfc3f3d6 Mon Sep 17 00:00:00 2001 From: Systemcluster <me@systemcluster.me> Date: Mon, 17 Apr 2023 01:27:35 +0200 Subject: [PATCH 009/104] Add rustflags profile option to comparable profile properties --- src/cargo/core/profiles.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cargo/core/profiles.rs b/src/cargo/core/profiles.rs index 51d19e32e62..053df853c38 100644 --- a/src/cargo/core/profiles.rs +++ b/src/cargo/core/profiles.rs @@ -704,7 +704,7 @@ impl Profile { /// Compares all fields except `name`, which doesn't affect compilation. /// This is necessary for `Unit` deduplication for things like "test" and /// "dev" which are essentially the same. - fn comparable(&self) -> impl Hash + Eq { + fn comparable(&self) -> impl Hash + Eq + '_ { ( self.opt_level, self.lto, @@ -715,9 +715,8 @@ impl Profile { self.debug_assertions, self.overflow_checks, self.rpath, - self.incremental, - self.panic, - self.strip, + (self.incremental, self.panic, self.strip), + &self.rustflags, ) } } From 667e0baa4bfa1ddc1c36d92a00f04012028c35bc Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Tue, 18 Apr 2023 17:20:37 +0100 Subject: [PATCH 010/104] ci: check if Cargo.lock is up-to-date --- .github/workflows/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3146e7c4e9a..94cfb044f1b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,14 @@ jobs: # TODO: check every members - run: cargo clippy -p cargo --lib --no-deps -- -D warnings + # Ensure Cargo.lock is up-to-date + lockfile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: rustup update stable && rustup default stable + - run: cargo update -p cargo --locked + test: runs-on: ${{ matrix.os }} env: From d1f18ebc9d627657e5ba1446a4ab3af4742b1b60 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel <sebastian.thiel@icloud.com> Date: Tue, 18 Apr 2023 12:36:09 +0200 Subject: [PATCH 011/104] Prevent false positives when checking for changes in src/doc. When changing cargo versions from stable to nightly, it's possible that the Cargo.lock format changes ever so slightly. This leaves the `Cargo.lock` file changed which is picked up by `git status`. This patch adjusts the `git status` invocation to limit itself to the CWD. --- ci/validate-man.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/validate-man.sh b/ci/validate-man.sh index 92df4978143..f636b46059c 100755 --- a/ci/validate-man.sh +++ b/ci/validate-man.sh @@ -5,7 +5,7 @@ set -e cd src/doc -changes=$(git status --porcelain) +changes=$(git status --porcelain -- .) if [ -n "$changes" ] then echo "git directory must be clean before running this script." @@ -14,10 +14,10 @@ fi ./build-man.sh -changes=$(git status --porcelain) +changes=$(git status --porcelain -- .) if [ -n "$changes" ] then - echo "Detected changes in man pages:" + echo "Detected changes of man pages in src/doc:" echo "$changes" echo echo "Please run './build-man.sh' in the src/doc directory to rebuild the" From d1ecebfa69bcc7e50995f56d7b4f7fa5ac971bdc Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Tue, 18 Apr 2023 11:36:30 -0700 Subject: [PATCH 012/104] Add S-triage auto-label. --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index f465e124037..5cee9c65c80 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug Report description: Create a report to help us improve -labels: ["C-bug"] +labels: ["C-bug", "S-triage"] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index bae2469d100..e6ed547f82f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,6 +1,6 @@ name: Feature Request description: Suggest an idea for enhancing Cargo -labels: ["C-feature-request"] +labels: ["C-feature-request", "S-triage"] body: - type: markdown attributes: From 0138c0b1d60c06cc0bbff0af577322a3444e3055 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 18 Apr 2023 09:00:55 -0500 Subject: [PATCH 013/104] feat(cred): Common unsupported credentials --- crates/credential/cargo-credential/src/lib.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/credential/cargo-credential/src/lib.rs b/crates/credential/cargo-credential/src/lib.rs index 3baf42d77db..c751722423e 100644 --- a/crates/credential/cargo-credential/src/lib.rs +++ b/crates/credential/cargo-credential/src/lib.rs @@ -34,6 +34,26 @@ pub trait Credential { fn erase(&self, index_url: &str) -> Result<(), Error>; } +pub struct UnsupportedCredential; + +impl Credential for UnsupportedCredential { + fn name(&self) -> &'static str { + "unsupported" + } + + fn get(&self, _index_url: &str) -> Result<String, Error> { + Err("unsupported".into()) + } + + fn store(&self, _index_url: &str, _token: &str, _name: Option<&str>) -> Result<(), Error> { + Err("unsupported".into()) + } + + fn erase(&self, _index_url: &str) -> Result<(), Error> { + Err("unsupported".into()) + } +} + /// Runs the credential interaction by processing the command-line and /// environment variables. pub fn main(credential: impl Credential) { From c4df4f685ac829c5fbc98d570b691948b558b40f Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 18 Apr 2023 09:05:02 -0500 Subject: [PATCH 014/104] refactor(cred): Move macos impl to inline mod --- .../src/main.rs | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/crates/credential/cargo-credential-macos-keychain/src/main.rs b/crates/credential/cargo-credential-macos-keychain/src/main.rs index 3fef3f92a6f..eba4e29b902 100644 --- a/crates/credential/cargo-credential-macos-keychain/src/main.rs +++ b/crates/credential/cargo-credential-macos-keychain/src/main.rs @@ -1,50 +1,52 @@ //! Cargo registry macos keychain credential process. -use cargo_credential::{Credential, Error}; -use security_framework::os::macos::keychain::SecKeychain; +mod macos { + use cargo_credential::{Credential, Error}; + use security_framework::os::macos::keychain::SecKeychain; -struct MacKeychain; + pub(crate) struct MacKeychain; -/// The account name is not used. -const ACCOUNT: &'static str = ""; + /// The account name is not used. + const ACCOUNT: &'static str = ""; -fn registry(registry_name: &str) -> String { - format!("cargo-registry:{}", registry_name) -} - -impl Credential for MacKeychain { - fn name(&self) -> &'static str { - env!("CARGO_PKG_NAME") + fn registry(registry_name: &str) -> String { + format!("cargo-registry:{}", registry_name) } - fn get(&self, index_url: &str) -> Result<String, Error> { - let keychain = SecKeychain::default().unwrap(); - let service_name = registry(index_url); - let (pass, _item) = keychain.find_generic_password(&service_name, ACCOUNT)?; - String::from_utf8(pass.as_ref().to_vec()) - .map_err(|_| "failed to convert token to UTF8".into()) - } + impl Credential for MacKeychain { + fn name(&self) -> &'static str { + env!("CARGO_PKG_NAME") + } - fn store(&self, index_url: &str, token: &str, name: Option<&str>) -> Result<(), Error> { - let keychain = SecKeychain::default().unwrap(); - let service_name = registry(name.unwrap_or(index_url)); - if let Ok((_pass, mut item)) = keychain.find_generic_password(&service_name, ACCOUNT) { - item.set_password(token.as_bytes())?; - } else { - keychain.add_generic_password(&service_name, ACCOUNT, token.as_bytes())?; + fn get(&self, index_url: &str) -> Result<String, Error> { + let keychain = SecKeychain::default().unwrap(); + let service_name = registry(index_url); + let (pass, _item) = keychain.find_generic_password(&service_name, ACCOUNT)?; + String::from_utf8(pass.as_ref().to_vec()) + .map_err(|_| "failed to convert token to UTF8".into()) + } + + fn store(&self, index_url: &str, token: &str, name: Option<&str>) -> Result<(), Error> { + let keychain = SecKeychain::default().unwrap(); + let service_name = registry(name.unwrap_or(index_url)); + if let Ok((_pass, mut item)) = keychain.find_generic_password(&service_name, ACCOUNT) { + item.set_password(token.as_bytes())?; + } else { + keychain.add_generic_password(&service_name, ACCOUNT, token.as_bytes())?; + } + Ok(()) } - Ok(()) - } - fn erase(&self, index_url: &str) -> Result<(), Error> { - let keychain = SecKeychain::default().unwrap(); - let service_name = registry(index_url); - let (_pass, item) = keychain.find_generic_password(&service_name, ACCOUNT)?; - item.delete(); - Ok(()) + fn erase(&self, index_url: &str) -> Result<(), Error> { + let keychain = SecKeychain::default().unwrap(); + let service_name = registry(index_url); + let (_pass, item) = keychain.find_generic_password(&service_name, ACCOUNT)?; + item.delete(); + Ok(()) + } } } fn main() { - cargo_credential::main(MacKeychain); + cargo_credential::main(macos::MacKeychain); } From 24e649962bf9425da4af737da1f37afaba959d52 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 18 Apr 2023 09:06:09 -0500 Subject: [PATCH 015/104] fix(cred): Get macos building on all platforms --- .../cargo-credential-macos-keychain/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/credential/cargo-credential-macos-keychain/src/main.rs b/crates/credential/cargo-credential-macos-keychain/src/main.rs index eba4e29b902..4d6ea96d05b 100644 --- a/crates/credential/cargo-credential-macos-keychain/src/main.rs +++ b/crates/credential/cargo-credential-macos-keychain/src/main.rs @@ -1,5 +1,6 @@ //! Cargo registry macos keychain credential process. +#[cfg(target_os = "macos")] mod macos { use cargo_credential::{Credential, Error}; use security_framework::os::macos::keychain::SecKeychain; @@ -47,6 +48,11 @@ mod macos { } } +#[cfg(not(target_os = "macos"))] +use cargo_credential::UnsupportedCredential as MacKeychain; +#[cfg(target_os = "macos")] +use macos::MacKeychain; + fn main() { - cargo_credential::main(macos::MacKeychain); + cargo_credential::main(MacKeychain); } From 5b3cbc70a4cbfe01a2591c5e74a073adc81d20c0 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 18 Apr 2023 09:07:17 -0500 Subject: [PATCH 016/104] refactor(cred): Move win impl to inline mod --- .../cargo-credential-wincred/src/main.rs | 183 +++++++++--------- 1 file changed, 94 insertions(+), 89 deletions(-) diff --git a/crates/credential/cargo-credential-wincred/src/main.rs b/crates/credential/cargo-credential-wincred/src/main.rs index 8ae48f34899..4f848611d10 100644 --- a/crates/credential/cargo-credential-wincred/src/main.rs +++ b/crates/credential/cargo-credential-wincred/src/main.rs @@ -1,111 +1,116 @@ //! Cargo registry windows credential process. -use cargo_credential::{Credential, Error}; -use std::ffi::OsStr; -use std::os::windows::ffi::OsStrExt; +mod win { + use cargo_credential::{Credential, Error}; + use std::ffi::OsStr; + use std::os::windows::ffi::OsStrExt; -use windows_sys::core::PWSTR; -use windows_sys::Win32::Foundation::ERROR_NOT_FOUND; -use windows_sys::Win32::Foundation::FILETIME; -use windows_sys::Win32::Foundation::TRUE; -use windows_sys::Win32::Security::Credentials::CredDeleteW; -use windows_sys::Win32::Security::Credentials::CredReadW; -use windows_sys::Win32::Security::Credentials::CredWriteW; -use windows_sys::Win32::Security::Credentials::CREDENTIALW; -use windows_sys::Win32::Security::Credentials::CRED_PERSIST_LOCAL_MACHINE; -use windows_sys::Win32::Security::Credentials::CRED_TYPE_GENERIC; + use windows_sys::core::PWSTR; + use windows_sys::Win32::Foundation::ERROR_NOT_FOUND; + use windows_sys::Win32::Foundation::FILETIME; + use windows_sys::Win32::Foundation::TRUE; + use windows_sys::Win32::Security::Credentials::CredDeleteW; + use windows_sys::Win32::Security::Credentials::CredReadW; + use windows_sys::Win32::Security::Credentials::CredWriteW; + use windows_sys::Win32::Security::Credentials::CREDENTIALW; + use windows_sys::Win32::Security::Credentials::CRED_PERSIST_LOCAL_MACHINE; + use windows_sys::Win32::Security::Credentials::CRED_TYPE_GENERIC; -struct WindowsCredential; + pub(crate) struct WindowsCredential; -/// Converts a string to a nul-terminated wide UTF-16 byte sequence. -fn wstr(s: &str) -> Vec<u16> { - let mut wide: Vec<u16> = OsStr::new(s).encode_wide().collect(); - if wide.iter().any(|b| *b == 0) { - panic!("nul byte in wide string"); + /// Converts a string to a nul-terminated wide UTF-16 byte sequence. + fn wstr(s: &str) -> Vec<u16> { + let mut wide: Vec<u16> = OsStr::new(s).encode_wide().collect(); + if wide.iter().any(|b| *b == 0) { + panic!("nul byte in wide string"); + } + wide.push(0); + wide } - wide.push(0); - wide -} -fn target_name(registry_name: &str) -> Vec<u16> { - wstr(&format!("cargo-registry:{}", registry_name)) -} - -impl Credential for WindowsCredential { - fn name(&self) -> &'static str { - env!("CARGO_PKG_NAME") + fn target_name(registry_name: &str) -> Vec<u16> { + wstr(&format!("cargo-registry:{}", registry_name)) } - fn get(&self, index_url: &str) -> Result<String, Error> { - let target_name = target_name(index_url); - let p_credential: *mut CREDENTIALW = std::ptr::null_mut() as *mut _; - unsafe { - if CredReadW( - target_name.as_ptr(), - CRED_TYPE_GENERIC, - 0, - p_credential as *mut _ as *mut _, - ) != TRUE - { - return Err( - format!("failed to fetch token: {}", std::io::Error::last_os_error()).into(), + impl Credential for WindowsCredential { + fn name(&self) -> &'static str { + env!("CARGO_PKG_NAME") + } + + fn get(&self, index_url: &str) -> Result<String, Error> { + let target_name = target_name(index_url); + let p_credential: *mut CREDENTIALW = std::ptr::null_mut() as *mut _; + unsafe { + if CredReadW( + target_name.as_ptr(), + CRED_TYPE_GENERIC, + 0, + p_credential as *mut _ as *mut _, + ) != TRUE + { + return Err(format!( + "failed to fetch token: {}", + std::io::Error::last_os_error() + ) + .into()); + } + let bytes = std::slice::from_raw_parts( + (*p_credential).CredentialBlob, + (*p_credential).CredentialBlobSize as usize, ); + String::from_utf8(bytes.to_vec()) + .map_err(|_| "failed to convert token to UTF8".into()) } - let bytes = std::slice::from_raw_parts( - (*p_credential).CredentialBlob, - (*p_credential).CredentialBlobSize as usize, - ); - String::from_utf8(bytes.to_vec()).map_err(|_| "failed to convert token to UTF8".into()) } - } - fn store(&self, index_url: &str, token: &str, name: Option<&str>) -> Result<(), Error> { - let token = token.as_bytes(); - let target_name = target_name(index_url); - let comment = match name { - Some(name) => wstr(&format!("Cargo registry token for {}", name)), - None => wstr("Cargo registry token"), - }; - let mut credential = CREDENTIALW { - Flags: 0, - Type: CRED_TYPE_GENERIC, - TargetName: target_name.as_ptr() as PWSTR, - Comment: comment.as_ptr() as PWSTR, - LastWritten: FILETIME { - dwLowDateTime: 0, - dwHighDateTime: 0, - }, - CredentialBlobSize: token.len() as u32, - CredentialBlob: token.as_ptr() as *mut u8, - Persist: CRED_PERSIST_LOCAL_MACHINE, - AttributeCount: 0, - Attributes: std::ptr::null_mut(), - TargetAlias: std::ptr::null_mut(), - UserName: std::ptr::null_mut(), - }; - let result = unsafe { CredWriteW(&mut credential, 0) }; - if result != TRUE { - let err = std::io::Error::last_os_error(); - return Err(format!("failed to store token: {}", err).into()); + fn store(&self, index_url: &str, token: &str, name: Option<&str>) -> Result<(), Error> { + let token = token.as_bytes(); + let target_name = target_name(index_url); + let comment = match name { + Some(name) => wstr(&format!("Cargo registry token for {}", name)), + None => wstr("Cargo registry token"), + }; + let mut credential = CREDENTIALW { + Flags: 0, + Type: CRED_TYPE_GENERIC, + TargetName: target_name.as_ptr() as PWSTR, + Comment: comment.as_ptr() as PWSTR, + LastWritten: FILETIME { + dwLowDateTime: 0, + dwHighDateTime: 0, + }, + CredentialBlobSize: token.len() as u32, + CredentialBlob: token.as_ptr() as *mut u8, + Persist: CRED_PERSIST_LOCAL_MACHINE, + AttributeCount: 0, + Attributes: std::ptr::null_mut(), + TargetAlias: std::ptr::null_mut(), + UserName: std::ptr::null_mut(), + }; + let result = unsafe { CredWriteW(&mut credential, 0) }; + if result != TRUE { + let err = std::io::Error::last_os_error(); + return Err(format!("failed to store token: {}", err).into()); + } + Ok(()) } - Ok(()) - } - fn erase(&self, index_url: &str) -> Result<(), Error> { - let target_name = target_name(index_url); - let result = unsafe { CredDeleteW(target_name.as_ptr(), CRED_TYPE_GENERIC, 0) }; - if result != TRUE { - let err = std::io::Error::last_os_error(); - if err.raw_os_error() == Some(ERROR_NOT_FOUND as i32) { - eprintln!("not currently logged in to `{}`", index_url); - return Ok(()); + fn erase(&self, index_url: &str) -> Result<(), Error> { + let target_name = target_name(index_url); + let result = unsafe { CredDeleteW(target_name.as_ptr(), CRED_TYPE_GENERIC, 0) }; + if result != TRUE { + let err = std::io::Error::last_os_error(); + if err.raw_os_error() == Some(ERROR_NOT_FOUND as i32) { + eprintln!("not currently logged in to `{}`", index_url); + return Ok(()); + } + return Err(format!("failed to remove token: {}", err).into()); } - return Err(format!("failed to remove token: {}", err).into()); + Ok(()) } - Ok(()) } } fn main() { - cargo_credential::main(WindowsCredential); + cargo_credential::main(win::WindowsCredential); } From fb8e1c8c8559274e27329160988a6eb6b2bc1157 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 18 Apr 2023 09:10:20 -0500 Subject: [PATCH 017/104] fix(cred): Get wincred building on all platforms --- crates/credential/cargo-credential-wincred/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/credential/cargo-credential-wincred/src/main.rs b/crates/credential/cargo-credential-wincred/src/main.rs index 4f848611d10..4377172e8f7 100644 --- a/crates/credential/cargo-credential-wincred/src/main.rs +++ b/crates/credential/cargo-credential-wincred/src/main.rs @@ -1,5 +1,6 @@ //! Cargo registry windows credential process. +#[cfg(windows)] mod win { use cargo_credential::{Credential, Error}; use std::ffi::OsStr; @@ -111,6 +112,11 @@ mod win { } } +#[cfg(not(windows))] +use cargo_credential::UnsupportedCredential as WindowsCredential; +#[cfg(windows)] +use win::WindowsCredential; + fn main() { - cargo_credential::main(win::WindowsCredential); + cargo_credential::main(WindowsCredential); } From 6e3f665333149bc5ee9751e287ed5dd0c5771c6d Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 18 Apr 2023 20:02:21 -0500 Subject: [PATCH 018/104] chore: Use globs for workspace members This is a short-term option until we can have a better solution for globbing. This does not update `benches/` to support which has a README in there preventing globbing; this seems low-churn enough not to find a solution for it. On the next sync-up with rust-lang/rust, we'll need to update https://github.com/rust-lang/rust/blob/4e463012580415a932ae4fc255aff45982c70369/src/bootstrap/tool.rs#L588-L603 Fixes #11988 --- Cargo.toml | 11 ++--------- {crates/credential => credential}/README.md | 0 .../cargo-credential-1password/Cargo.toml | 0 .../cargo-credential-1password/src/main.rs | 0 .../cargo-credential-gnome-secret/Cargo.toml | 0 .../cargo-credential-gnome-secret/build.rs | 0 .../cargo-credential-gnome-secret/src/main.rs | 0 .../cargo-credential-macos-keychain/Cargo.toml | 0 .../cargo-credential-macos-keychain/src/main.rs | 0 .../cargo-credential-wincred/Cargo.toml | 0 .../cargo-credential-wincred/src/main.rs | 0 .../cargo-credential/Cargo.toml | 0 .../cargo-credential/README.md | 2 +- .../cargo-credential/src/lib.rs | 0 src/cargo/lib.rs | 2 +- triagebot.toml | 2 +- 16 files changed, 5 insertions(+), 12 deletions(-) rename {crates/credential => credential}/README.md (100%) rename {crates/credential => credential}/cargo-credential-1password/Cargo.toml (100%) rename {crates/credential => credential}/cargo-credential-1password/src/main.rs (100%) rename {crates/credential => credential}/cargo-credential-gnome-secret/Cargo.toml (100%) rename {crates/credential => credential}/cargo-credential-gnome-secret/build.rs (100%) rename {crates/credential => credential}/cargo-credential-gnome-secret/src/main.rs (100%) rename {crates/credential => credential}/cargo-credential-macos-keychain/Cargo.toml (100%) rename {crates/credential => credential}/cargo-credential-macos-keychain/src/main.rs (100%) rename {crates/credential => credential}/cargo-credential-wincred/Cargo.toml (100%) rename {crates/credential => credential}/cargo-credential-wincred/src/main.rs (100%) rename {crates/credential => credential}/cargo-credential/Cargo.toml (100%) rename {crates/credential => credential}/cargo-credential/README.md (93%) rename {crates/credential => credential}/cargo-credential/src/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 554c275b4b4..7ad57a16c9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,17 +1,10 @@ [workspace] resolver = "2" members = [ + "crates/*", + "credential/*", "benches/benchsuite", "benches/capture", - "crates/cargo-platform", - "crates/cargo-test-macro", - "crates/cargo-test-support", - "crates/cargo-util", - "crates/crates-io", - "crates/credential/*", - "crates/home", - "crates/mdman", - "crates/resolver-tests", ] exclude = [ # For linkchecker (downloaded during CI) and semver-check diff --git a/crates/credential/README.md b/credential/README.md similarity index 100% rename from crates/credential/README.md rename to credential/README.md diff --git a/crates/credential/cargo-credential-1password/Cargo.toml b/credential/cargo-credential-1password/Cargo.toml similarity index 100% rename from crates/credential/cargo-credential-1password/Cargo.toml rename to credential/cargo-credential-1password/Cargo.toml diff --git a/crates/credential/cargo-credential-1password/src/main.rs b/credential/cargo-credential-1password/src/main.rs similarity index 100% rename from crates/credential/cargo-credential-1password/src/main.rs rename to credential/cargo-credential-1password/src/main.rs diff --git a/crates/credential/cargo-credential-gnome-secret/Cargo.toml b/credential/cargo-credential-gnome-secret/Cargo.toml similarity index 100% rename from crates/credential/cargo-credential-gnome-secret/Cargo.toml rename to credential/cargo-credential-gnome-secret/Cargo.toml diff --git a/crates/credential/cargo-credential-gnome-secret/build.rs b/credential/cargo-credential-gnome-secret/build.rs similarity index 100% rename from crates/credential/cargo-credential-gnome-secret/build.rs rename to credential/cargo-credential-gnome-secret/build.rs diff --git a/crates/credential/cargo-credential-gnome-secret/src/main.rs b/credential/cargo-credential-gnome-secret/src/main.rs similarity index 100% rename from crates/credential/cargo-credential-gnome-secret/src/main.rs rename to credential/cargo-credential-gnome-secret/src/main.rs diff --git a/crates/credential/cargo-credential-macos-keychain/Cargo.toml b/credential/cargo-credential-macos-keychain/Cargo.toml similarity index 100% rename from crates/credential/cargo-credential-macos-keychain/Cargo.toml rename to credential/cargo-credential-macos-keychain/Cargo.toml diff --git a/crates/credential/cargo-credential-macos-keychain/src/main.rs b/credential/cargo-credential-macos-keychain/src/main.rs similarity index 100% rename from crates/credential/cargo-credential-macos-keychain/src/main.rs rename to credential/cargo-credential-macos-keychain/src/main.rs diff --git a/crates/credential/cargo-credential-wincred/Cargo.toml b/credential/cargo-credential-wincred/Cargo.toml similarity index 100% rename from crates/credential/cargo-credential-wincred/Cargo.toml rename to credential/cargo-credential-wincred/Cargo.toml diff --git a/crates/credential/cargo-credential-wincred/src/main.rs b/credential/cargo-credential-wincred/src/main.rs similarity index 100% rename from crates/credential/cargo-credential-wincred/src/main.rs rename to credential/cargo-credential-wincred/src/main.rs diff --git a/crates/credential/cargo-credential/Cargo.toml b/credential/cargo-credential/Cargo.toml similarity index 100% rename from crates/credential/cargo-credential/Cargo.toml rename to credential/cargo-credential/Cargo.toml diff --git a/crates/credential/cargo-credential/README.md b/credential/cargo-credential/README.md similarity index 93% rename from crates/credential/cargo-credential/README.md rename to credential/cargo-credential/README.md index 1f75e598a3f..53dc8e6b7d6 100644 --- a/crates/credential/cargo-credential/README.md +++ b/credential/cargo-credential/README.md @@ -8,7 +8,7 @@ Documentation about credential processes may be found at https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#credential-process Example implementations may be found at -https://github.com/rust-lang/cargo/tree/master/crates/credential +https://github.com/rust-lang/cargo/tree/master/credential ## Usage diff --git a/crates/credential/cargo-credential/src/lib.rs b/credential/cargo-credential/src/lib.rs similarity index 100% rename from crates/credential/cargo-credential/src/lib.rs rename to credential/cargo-credential/src/lib.rs diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs index f4c671fd3ba..5924c5d1856 100644 --- a/src/cargo/lib.rs +++ b/src/cargo/lib.rs @@ -86,7 +86,7 @@ //! - [`cargo-test-macro`](https://github.com/rust-lang/cargo/tree/master/crates/cargo-test-macro) //! ([nightly docs](https://doc.rust-lang.org/nightly/nightly-rustc/cargo_test_macro/index.html)): //! This is the `#[cargo_test]` proc-macro used by the test suite to define tests. -//! - [`credential`](https://github.com/rust-lang/cargo/tree/master/crates/credential) +//! - [`credential`](https://github.com/rust-lang/cargo/tree/master/credential) //! This subdirectory contains several packages for implementing the //! experimental //! [credential-process](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#credential-process) diff --git a/triagebot.toml b/triagebot.toml index 192859537af..1700ba74eda 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -165,7 +165,7 @@ trigger_files = ["src/cargo/core/compiler/fingerprint/"] trigger_files = ["src/cargo/sources/registry/", "src/cargo/core/registry.rs"] [autolabel."A-registry-authentication"] -trigger_files = ["src/cargo/util/auth.rs", "crates/credential/"] +trigger_files = ["src/cargo/util/auth.rs", "credential/"] [autolabel."A-semver"] trigger_files = [ From 502ddcf15aad371c525490c85ed672859c6412ce Mon Sep 17 00:00:00 2001 From: WANG Rui <wangrui@loongson.cn> Date: Wed, 19 Apr 2023 10:29:54 +0800 Subject: [PATCH 019/104] Update linux-raw-sys to 0.3.2 Adds support for LoongArch. --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62eccdc50b8..78ba8e2faf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1953,9 +1953,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" +checksum = "3f508063cc7bb32987c71511216bd5a32be15bccb6a80b52df8b9d7f01fc3aa2" [[package]] name = "lock_api" From 653f5b30677bf84aa4fe8a6210c26f9fe300ea01 Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Wed, 19 Apr 2023 20:30:58 -0700 Subject: [PATCH 020/104] Fix broken links in contributor guide. --- src/doc/contrib/src/implementation/console.md | 2 +- src/doc/contrib/src/implementation/filesystem.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/contrib/src/implementation/console.md b/src/doc/contrib/src/implementation/console.md index a73d232e0ce..99d31b951ae 100644 --- a/src/doc/contrib/src/implementation/console.md +++ b/src/doc/contrib/src/implementation/console.md @@ -19,7 +19,7 @@ the [`JobQueue`] as it processes each message. [`Shell`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/shell.rs [`Config`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/util/config/mod.rs [`drop_print`]: https://github.com/rust-lang/cargo/blob/e4b65bdc80f2a293447f2f6a808fa7c84bf9a357/src/cargo/util/config/mod.rs#L1820-L1848 -[`JobQueue`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/job_queue.rs +[`JobQueue`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/job_queue/mod.rs ## Errors diff --git a/src/doc/contrib/src/implementation/filesystem.md b/src/doc/contrib/src/implementation/filesystem.md index 0f70c5833f0..3c1b2dbd5d5 100644 --- a/src/doc/contrib/src/implementation/filesystem.md +++ b/src/doc/contrib/src/implementation/filesystem.md @@ -17,5 +17,5 @@ its best to handle them. Some examples of issues to deal with: fractional part of the time stamp. * Symlinks are not always supported, particularly on Windows. -[`fingerprint`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/fingerprint.rs +[`fingerprint`]: https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/fingerprint/mod.rs [`fs::canonicalize`]: https://doc.rust-lang.org/std/fs/fn.canonicalize.html From aeb0c46fc3f5f8c37a5d04ca83f7cdf133589f86 Mon Sep 17 00:00:00 2001 From: hi-rustin <rustin.liu@gmail.com> Date: Wed, 19 Apr 2023 09:14:50 +0800 Subject: [PATCH 021/104] Better error message when getting an empty dep table Signed-off-by: hi-rustin <rustin.liu@gmail.com> --- src/cargo/util/toml_mut/dependency.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cargo/util/toml_mut/dependency.rs b/src/cargo/util/toml_mut/dependency.rs index d8a2f2750aa..cb375cc8d17 100644 --- a/src/cargo/util/toml_mut/dependency.rs +++ b/src/cargo/util/toml_mut/dependency.rs @@ -279,7 +279,13 @@ impl Dependency { let src = WorkspaceSource::new(); src.into() } else { - anyhow::bail!("Unrecognized dependency source for `{key}`"); + let mut msg = format!("Unrecognized dependency source for `{key}`"); + if table.is_empty() { + msg.push_str( + ", expected a table with a `version`, `git`, `path`, or `workspace` key", + ); + } + anyhow::bail!(msg); }; let registry = if let Some(value) = table.get("registry") { Some( From dee29bec0ba45e7ccc4196b1eaec02a52d542589 Mon Sep 17 00:00:00 2001 From: hi-rustin <rustin.liu@gmail.com> Date: Wed, 19 Apr 2023 09:39:33 +0800 Subject: [PATCH 022/104] Add test for empty dep table error Signed-off-by: hi-rustin <rustin.liu@gmail.com> --- .../cargo_add/empty_dep_table/in/Cargo.toml | 8 ++++++ .../cargo_add/empty_dep_table/in/src/lib.rs | 1 + .../cargo_add/empty_dep_table/mod.rs | 25 +++++++++++++++++++ .../cargo_add/empty_dep_table/out/Cargo.toml | 8 ++++++ .../cargo_add/empty_dep_table/stderr.log | 1 + .../cargo_add/empty_dep_table/stdout.log | 0 tests/testsuite/cargo_add/mod.rs | 1 + 7 files changed, 44 insertions(+) create mode 100644 tests/testsuite/cargo_add/empty_dep_table/in/Cargo.toml create mode 100644 tests/testsuite/cargo_add/empty_dep_table/in/src/lib.rs create mode 100644 tests/testsuite/cargo_add/empty_dep_table/mod.rs create mode 100644 tests/testsuite/cargo_add/empty_dep_table/out/Cargo.toml create mode 100644 tests/testsuite/cargo_add/empty_dep_table/stderr.log create mode 100644 tests/testsuite/cargo_add/empty_dep_table/stdout.log diff --git a/tests/testsuite/cargo_add/empty_dep_table/in/Cargo.toml b/tests/testsuite/cargo_add/empty_dep_table/in/Cargo.toml new file mode 100644 index 00000000000..cac16bb9472 --- /dev/null +++ b/tests/testsuite/cargo_add/empty_dep_table/in/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +your-face = { } diff --git a/tests/testsuite/cargo_add/empty_dep_table/in/src/lib.rs b/tests/testsuite/cargo_add/empty_dep_table/in/src/lib.rs new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/tests/testsuite/cargo_add/empty_dep_table/in/src/lib.rs @@ -0,0 +1 @@ + diff --git a/tests/testsuite/cargo_add/empty_dep_table/mod.rs b/tests/testsuite/cargo_add/empty_dep_table/mod.rs new file mode 100644 index 00000000000..f6c507188ad --- /dev/null +++ b/tests/testsuite/cargo_add/empty_dep_table/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::prelude::*; +use cargo_test_support::Project; + +use crate::cargo_add::init_registry; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .arg_line("your-face --features eyes") + .current_dir(cwd) + .assert() + .code(101) + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/testsuite/cargo_add/empty_dep_table/out/Cargo.toml b/tests/testsuite/cargo_add/empty_dep_table/out/Cargo.toml new file mode 100644 index 00000000000..cac16bb9472 --- /dev/null +++ b/tests/testsuite/cargo_add/empty_dep_table/out/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +your-face = { } diff --git a/tests/testsuite/cargo_add/empty_dep_table/stderr.log b/tests/testsuite/cargo_add/empty_dep_table/stderr.log new file mode 100644 index 00000000000..00b1db5e369 --- /dev/null +++ b/tests/testsuite/cargo_add/empty_dep_table/stderr.log @@ -0,0 +1 @@ +error: Unrecognized dependency source for `your-face`, expected a table with a `version`, `git`, `path`, or `workspace` key diff --git a/tests/testsuite/cargo_add/empty_dep_table/stdout.log b/tests/testsuite/cargo_add/empty_dep_table/stdout.log new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/testsuite/cargo_add/mod.rs b/tests/testsuite/cargo_add/mod.rs index ca58474d219..26a11dd8a49 100644 --- a/tests/testsuite/cargo_add/mod.rs +++ b/tests/testsuite/cargo_add/mod.rs @@ -15,6 +15,7 @@ mod dev; mod dev_build_conflict; mod dev_prefer_existing_version; mod dry_run; +mod empty_dep_table; mod features; mod features_empty; mod features_multiple_occurrences; From 22740a910db249e0540f99817fb69a7548fd15b6 Mon Sep 17 00:00:00 2001 From: hi-rustin <rustin.liu@gmail.com> Date: Thu, 20 Apr 2023 08:52:10 +0800 Subject: [PATCH 023/104] Update error message to not start with capital letters Signed-off-by: hi-rustin <rustin.liu@gmail.com> --- src/cargo/util/toml_mut/dependency.rs | 104 +++++++++--------- .../cargo_add/empty_dep_table/stderr.log | 2 +- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/src/cargo/util/toml_mut/dependency.rs b/src/cargo/util/toml_mut/dependency.rs index cb375cc8d17..1b24833c1ee 100644 --- a/src/cargo/util/toml_mut/dependency.rs +++ b/src/cargo/util/toml_mut/dependency.rs @@ -225,68 +225,72 @@ impl Dependency { (key.to_owned(), None) }; - let source: Source = - if let Some(git) = table.get("git") { - let mut src = GitSource::new( - git.as_str() - .ok_or_else(|| invalid_type(key, "git", git.type_name(), "string"))?, - ); - if let Some(value) = table.get("branch") { - src = src.set_branch(value.as_str().ok_or_else(|| { + let source: Source = if let Some(git) = table.get("git") { + let mut src = GitSource::new( + git.as_str() + .ok_or_else(|| invalid_type(key, "git", git.type_name(), "string"))?, + ); + if let Some(value) = table.get("branch") { + src = + src.set_branch(value.as_str().ok_or_else(|| { invalid_type(key, "branch", value.type_name(), "string") })?); - } - if let Some(value) = table.get("tag") { - src = src.set_tag(value.as_str().ok_or_else(|| { + } + if let Some(value) = table.get("tag") { + src = + src.set_tag(value.as_str().ok_or_else(|| { invalid_type(key, "tag", value.type_name(), "string") })?); - } - if let Some(value) = table.get("rev") { - src = src.set_rev(value.as_str().ok_or_else(|| { + } + if let Some(value) = table.get("rev") { + src = + src.set_rev(value.as_str().ok_or_else(|| { invalid_type(key, "rev", value.type_name(), "string") })?); - } - if let Some(value) = table.get("version") { - src = src.set_version(value.as_str().ok_or_else(|| { - invalid_type(key, "version", value.type_name(), "string") - })?); - } - src.into() - } else if let Some(path) = table.get("path") { - let path = crate_root + } + if let Some(value) = table.get("version") { + src = src.set_version(value.as_str().ok_or_else(|| { + invalid_type(key, "version", value.type_name(), "string") + })?); + } + src.into() + } else if let Some(path) = table.get("path") { + let path = + crate_root .join(path.as_str().ok_or_else(|| { invalid_type(key, "path", path.type_name(), "string") })?); - let mut src = PathSource::new(path); - if let Some(value) = table.get("version") { - src = src.set_version(value.as_str().ok_or_else(|| { - invalid_type(key, "version", value.type_name(), "string") - })?); - } - src.into() - } else if let Some(version) = table.get("version") { - let src = RegistrySource::new(version.as_str().ok_or_else(|| { + let mut src = PathSource::new(path); + if let Some(value) = table.get("version") { + src = src.set_version(value.as_str().ok_or_else(|| { + invalid_type(key, "version", value.type_name(), "string") + })?); + } + src.into() + } else if let Some(version) = table.get("version") { + let src = + RegistrySource::new(version.as_str().ok_or_else(|| { invalid_type(key, "version", version.type_name(), "string") })?); - src.into() - } else if let Some(workspace) = table.get("workspace") { - let workspace_bool = workspace.as_bool().ok_or_else(|| { - invalid_type(key, "workspace", workspace.type_name(), "bool") - })?; - if !workspace_bool { - anyhow::bail!("`{key}.workspace = false` is unsupported") - } - let src = WorkspaceSource::new(); - src.into() - } else { - let mut msg = format!("Unrecognized dependency source for `{key}`"); - if table.is_empty() { - msg.push_str( - ", expected a table with a `version`, `git`, `path`, or `workspace` key", + src.into() + } else if let Some(workspace) = table.get("workspace") { + let workspace_bool = workspace + .as_bool() + .ok_or_else(|| invalid_type(key, "workspace", workspace.type_name(), "bool"))?; + if !workspace_bool { + anyhow::bail!("`{key}.workspace = false` is unsupported") + } + let src = WorkspaceSource::new(); + src.into() + } else { + let mut msg = format!("unrecognized dependency source for `{key}`"); + if table.is_empty() { + msg.push_str( + ", expected a local path, Git repository, version, or workspace dependency to be specified", ); - } - anyhow::bail!(msg); - }; + } + anyhow::bail!(msg); + }; let registry = if let Some(value) = table.get("registry") { Some( value diff --git a/tests/testsuite/cargo_add/empty_dep_table/stderr.log b/tests/testsuite/cargo_add/empty_dep_table/stderr.log index 00b1db5e369..3acd7b944ec 100644 --- a/tests/testsuite/cargo_add/empty_dep_table/stderr.log +++ b/tests/testsuite/cargo_add/empty_dep_table/stderr.log @@ -1 +1 @@ -error: Unrecognized dependency source for `your-face`, expected a table with a `version`, `git`, `path`, or `workspace` key +error: unrecognized dependency source for `your-face`, expected a local path, Git repository, version, or workspace dependency to be specified From f34068c69189d75c756ed23ecb9c74116d1b0f38 Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Wed, 19 Apr 2023 20:29:05 -0700 Subject: [PATCH 024/104] Update contributor guide with new issue labels. --- src/doc/contrib/src/index.md | 7 +- src/doc/contrib/src/issues.md | 212 +++++++++++++++++++----- src/doc/contrib/src/process/index.md | 58 +++---- src/doc/contrib/src/process/unstable.md | 22 ++- 4 files changed, 224 insertions(+), 75 deletions(-) diff --git a/src/doc/contrib/src/index.md b/src/doc/contrib/src/index.md index 5ab169ea799..848b0efaa46 100644 --- a/src/doc/contrib/src/index.md +++ b/src/doc/contrib/src/index.md @@ -5,8 +5,8 @@ overview of how to contribute to Cargo, how to dive into the code, and how the testing infrastructure works. There are many ways to contribute, such as [helping other users], [filing -issues], [improving the documentation], [fixing bugs], and working on [small] -and [large features]. +issues], [improving the documentation], [triaging issues], [fixing bugs], and +working on [small] and [large features]. If you have a general question about Cargo or its internals, feel free to ask on [Zulip]. @@ -24,6 +24,7 @@ Please also read the [Rust Code of Conduct]. [rustup]: https://rust-lang.github.io/rustup/ [git]: https://git-scm.com/ [improving the documentation]: https://github.com/rust-lang/cargo/tree/master/src/doc -[fixing bugs]: process/index.md#working-on-small-bugs +[fixing bugs]: process/index.md#working-on-issues [small]: process/index.md#working-on-small-features [large features]: process/index.md#working-on-large-features +[triaging issues]: issues.md#triaging-issues diff --git a/src/doc/contrib/src/issues.md b/src/doc/contrib/src/issues.md index 8fc69544c61..40f0b4100bd 100644 --- a/src/doc/contrib/src/issues.md +++ b/src/doc/contrib/src/issues.md @@ -57,53 +57,185 @@ necessary. ## Issue labels [Issue labels] are very helpful to identify the types of issues and which -category they are related to. The Cargo team typically manages assigning -labels. The labels use a naming convention with short prefixes and colors to -indicate the kind of label: +category they are related to. -* Yellow, **A**-prefixed labels state which **area** of the project an issue - relates to. +Anyone can apply most labels by posting comments with a form such as: -* Light purple, **C**-prefixed labels represent the **category** of an issue. - In particular, **[C-feature-request]** marks *proposals* for new features. If - an issue is **C-feature-request**, but is not **[Feature accepted]** or - **[I-nominated]**, then it was not thoroughly discussed, and might need some - additional design or perhaps should be implemented as an external subcommand - first. Ping @rust-lang/cargo if you want to send a PR for such issue. +```text +@rustbot label: +A-doctests, -A-dependency-resolution +``` -* Dark purple, **Command**-prefixed labels mean the issue has to do with a - specific cargo command. +This example will add the [`A-doctests`] label and remove the +[`A-dependency-resolution`] label. -* Green, **E**-prefixed labels indicate the level of **experience** or - **effort** necessary to fix the issue. **[E-mentor]** issues also - have some instructions on how to get started. Generally, all of the - **E**-prefixed labels are issues that are ready for someone to contribute - to! - -* Red, **I**-prefixed labels indicate the **importance** of the issue. The - **[I-nominated]** label indicates that an issue has been nominated for - prioritizing at the next triage meeting. +[Issue labels]: https://github.com/rust-lang/cargo/labels +[`A-doctests`]: https://github.com/rust-lang/cargo/labels/A-doctests +[`A-dependency-resolution`]: https://github.com/rust-lang/cargo/labels/A-dependency-resolution + +The labels use a naming convention with short prefixes and colors to indicate +the kind of label: + +<style> +.label-color { + border-radius:0.5em; +} +table td:nth-child(2) { + white-space: nowrap; +} + +</style> + +| Labels | Color | Description | +|--------|-------|-------------| +| [A-] | <span class="label-color" style="background-color:#fbca04;"> </span> Yellow | The **area** of the project an issue relates to. | +| [beta-] | <span class="label-color" style="background-color:#1e76d9;"> </span> Dark Blue | Tracks changes which need to be [backported to beta][beta-backport] | +| [C-] | <span class="label-color" style="background-color:#f5f1fd;"> </span> Light Purple | The **category** of an issue. | +| [Command-] | <span class="label-color" style="background-color:#5319e7;"> </span> Dark Purple | The `cargo` command it is related to. | +| [E-] | <span class="label-color" style="background-color:#02e10c;"> </span> Green | The **experience** level necessary to fix an issue. | +| [I-] | <span class="label-color" style="background-color:#fc2929;"> </span> Red | The **importance** of the issue. | +| [O-] | <span class="label-color" style="background-color:#7e7ec8;"> </span> Purple Grey | The **operating system** or platform that the issue is specific to. | +| [P-] | <span class="label-color" style="background-color:#eb6420;"> </span> Orange | The issue **priority**. | +| [regression-] | <span class="label-color" style="background-color:#e4008a;"> </span> Pink | Tracks regressions from a stable release. | +| [relnotes] | <span class="label-color" style="background-color:#fad8c7;"> </span> Light Orange | Marks issues or PRs that should be highlighted in the [Rust release notes] of the next release. | +| [S-] | Varies | Tracks the **status** of issues and pull requests (see [Issue status labels](#issue-status-labels)) | +| [Z-] | <span class="label-color" style="background-color:#453574;"> </span> Dark Blue | Unstable, [nightly features]. | + + +[A-]: https://github.com/rust-lang/cargo/labels?q=A +[beta-]: https://github.com/rust-lang/cargo/labels?q=beta +[beta-backport]: https://forge.rust-lang.org/release/backporting.html#beta-backporting-in-rust-langcargo +[C-]: https://github.com/rust-lang/cargo/labels?q=C +[Command-]: https://github.com/rust-lang/cargo/labels?q=Command +[E-]: https://github.com/rust-lang/cargo/labels?q=E +[I-]: https://github.com/rust-lang/cargo/labels?q=I +[nightly features]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html +[O-]: https://github.com/rust-lang/cargo/labels?q=O +[P-]: https://github.com/rust-lang/cargo/labels?q=P +[regression-]: https://github.com/rust-lang/cargo/labels?q=regression +[relnotes]: https://github.com/rust-lang/cargo/issues?q=label%3Arelnotes +[Rust release notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md +[S-]: https://github.com/rust-lang/cargo/labels?q=S +[Z-]: https://github.com/rust-lang/cargo/labels?q=nightly -* Purple gray, **O**-prefixed labels are the **operating system** or platform - that this issue is specific to. +### Issue status labels -* Orange, **P**-prefixed labels indicate a bug's **priority**. +The `S-` prefixed *status* labels are the primary mechanism we use to track +what is happening with an issue and what it is waiting on. The following is a +list of the status labels and what they mean. This is listed roughly in the +order that an issue might go through, though issues will often jump to +different steps, or in rare cases have multiple statuses. -* **S**-prefixed labels are "status" labels, typically used for PRs, but can - also indicate an issue is **[S-blocked]**. +* **[S-triage]** --- New issues get this label automatically assigned to them + to indicate that nobody has yet looked at them, and they need someone to + assign other labels and decide what the next step is. -* The light orange **[relnotes]** label marks issues that should be highlighted - in the [Rust release notes] of the next release. +* **[S-needs-info]** --- Needs more info, such as a reproduction or more + background for a feature request. -* Dark blue, **Z**-prefixed labels are for unstable, [nightly features]. + Anyone is welcome to help with providing additional info to help reproduce + or provide more detail on use cases and such. But usually this is a request + to the initial author. + + When adding this label, there should also usually be a comment that goes + along with it stating the information requested. + +* **[S-needs-team-input]** --- Needs input from team on whether/how to + proceed. + + Here it is essentially blocked waiting for a team member to move it to the + next stage. + +* **[S-needs-design]** --- Needs someone to work further on the design for the + feature or fix. + + Anyone is welcome to help at this stage, but it should be clear that it is + not yet accepted. It is expected that people should contribute comments and + ideas to the issue which furthers the process of fleshing out what is + needed, or alternate ideas. This may also require reaching out to the wider + community via forums and such. + +* **[S-needs-rfc]** --- Needs an [RFC] before this can make more progress. + + Anyone is welcome to help at this stage, but it should be clear that it is + not yet accepted. However, this should only be tagged for changes that are + somewhat likely to be accepted. + +* **[S-needs-mentor]** --- Needs a Cargo team member to commit to helping and + reviewing. + + This is for something that is accepted, such as after an RFC or a team + discussion, or an obvious issue that just needs fixing, but no team member + is available to help or review. + +* **[S-accepted]** --- Issue or feature is accepted, and has a team member + available to help mentor or review. + +* **[S-waiting-on-feedback]** --- An implemented feature is waiting on + community feedback for bugs or design concerns. + + This is typically used on a [tracking issue] after it has been implemented + to indicate what it is waiting on. + + +[S-triage]: https://github.com/rust-lang/cargo/labels/S-triage +[S-needs-info]: https://github.com/rust-lang/cargo/labels/S-needs-info +[S-needs-team-input]: https://github.com/rust-lang/cargo/labels/S-needs-team-input +[S-needs-design]: https://github.com/rust-lang/cargo/labels/S-needs-design +[S-needs-rfc]: https://github.com/rust-lang/cargo/labels/S-needs-rfc +[S-needs-mentor]: https://github.com/rust-lang/cargo/labels/S-needs-mentor +[S-accepted]: https://github.com/rust-lang/cargo/labels/S-accepted +[S-waiting-on-feedback]: https://github.com/rust-lang/cargo/labels/S-waiting-on-feedback +[RFC]: https://github.com/rust-lang/rfcs/ +[tracking issue]: https://github.com/rust-lang/cargo/labels/C-tracking-issue + +## Triaging issues + +Triaging issues involves processing issues to assign appropriate labels, make +sure the issue has sufficient information, and to decide the next steps. +When new issues are filed, they should automatically get the [S-triage] label +assuming the author uses one of the templates. This helps identify which +issues have not yet been triaged. + +There are several things to consider when triaging an issue: + +* Is this a duplicate? Search the issue tracker (including closed issues) to + see if there is something similar or identical to what is reported. If it is + obviously a duplicate, write a comment that it is a duplicate of the other + issue, and close the issue. If it isn't obvious that it is a duplicate, + leave a comment asking the author if it the other issue covers what they + reported. + +* For a bug, check if the report contains enough information to reproduce it. + If you can't reproduce it, solicit more information from the author to + better understand the issue. + Change the label from [S-triage] to [S-needs-info] if this is the case. + +* Add labels that describe what the issue is related to. + + * Add the appropriate [A-], [Command-], [O-], and [Z-] prefixed labels. + * If this is a regression from stable, add one of the [regression-] + prefixed labels (depending on if it is a regression in an already + released stable release, or it is in nightly). -[Issue labels]: https://github.com/rust-lang/cargo/labels -[E-easy]: https://github.com/rust-lang/cargo/labels/E-easy -[E-mentor]: https://github.com/rust-lang/cargo/labels/E-mentor -[I-nominated]: https://github.com/rust-lang/cargo/labels/I-nominated -[C-feature-request]: https://github.com/rust-lang/cargo/labels/C-feature-request -[Feature accepted]: https://github.com/rust-lang/cargo/labels/Feature%20accepted -[S-blocked]: https://github.com/rust-lang/cargo/labels/S-blocked -[Rust release notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md -[nightly features]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html -[relnotes]: https://github.com/rust-lang/cargo/issues?q=label%3Arelnotes +* Assuming the issue looks valid, remove the [S-triage] label and move it onto + a new status: + + * [S-needs-rfc] --- This is a large feature request that will require a + public design process. + * [S-needs-design] --- The resolution of the issue or small feature request + will need more work to come up with the appropriate design. + * [S-needs-team-input] --- The next steps are not clear, and the Cargo team + needs to discuss whether or not to proceed and what needs to be done to + address the issue. + * [S-needs-mentor] --- This is something the Cargo team wants to address, + but does not currently have the capacity to help with reviewing. + * [S-accepted] --- This is something that clearly needs to be addressed, and + a Cargo team member has volunteered to help review. + +Anyone is welcome to help with the triaging process. You can help with +reproducing issues, checking for duplicates, gathering more information from +the reporter, assigning labels using [`@rustbot` comments](#issue-labels), and +creating a test using [Cargo's testsuite] ([example][cargotest-example]). + +[Cargo's testsuite]: tests/writing.md +[cargotest-example]: https://github.com/rust-lang/cargo/issues/11628#issuecomment-1411088951 diff --git a/src/doc/contrib/src/process/index.md b/src/doc/contrib/src/process/index.md index 348c49ba944..af019659b90 100644 --- a/src/doc/contrib/src/process/index.md +++ b/src/doc/contrib/src/process/index.md @@ -38,44 +38,40 @@ The [RFC Project Board] is used for tracking [RFCs]. [RFC Project Board]: https://github.com/rust-lang/cargo/projects/2 [RFCs]: https://github.com/rust-lang/rfcs/ -## Working on small bugs +## Working on issues -Issues labeled with the [E-help-wanted], [E-easy], or [E-mentor] [labels] are -typically issues that the Cargo team wants to see addressed, and are -relatively easy to get started with. If you are interested in one of those, -and it has not already been assigned to someone, leave a comment. See [Issue +Issues labeled with the [S-accepted] [label] are typically issues that the +Cargo team wants to see addressed. If you are interested in one of those, and +it has not already been assigned to someone, leave a comment. See [Issue assignment](#issue-assignment) below for assigning yourself. -If there is a specific issue that you are interested in, but it doesn't have -one of the `E-` labels, leave a comment on the issue. If a Cargo team member -has the time to help out, they will respond to help with the next steps. +When possible, the Cargo team will try to also include [E-easy], [E-medium], +or [E-hard] labels to try to give an estimate of the difficulty involved with +the issue. -[E-help-wanted]: https://github.com/rust-lang/cargo/labels/E-help-wanted -[E-easy]: https://github.com/rust-lang/cargo/labels/E-easy -[E-mentor]: https://github.com/rust-lang/cargo/labels/E-mentor -[labels]: ../issues.md#issue-labels - -## Working on large bugs - -Some issues may be difficult to fix. They may require significant code -changes, or major design decisions. The [E-medium] and [E-hard] [labels] can -be used to tag such issues. These will typically involve some discussion with -the Cargo team on how to tackle it. +If there is a specific issue that you are interested in, but it is not marked +as [S-accepted], leave a comment on the issue. If a Cargo team member has the +time to help out, they will respond to help with the next steps. +[E-easy]: https://github.com/rust-lang/cargo/labels/E-easy [E-medium]: https://github.com/rust-lang/cargo/labels/E-medium [E-hard]: https://github.com/rust-lang/cargo/labels/E-hard +[S-accepted]: https://github.com/rust-lang/cargo/labels/S-accepted +[label]: ../issues.md#issue-labels ## Working on small features Small feature requests are typically managed on the [issue tracker][issue-feature-request]. Features that the Cargo team have approved -will have the [Feature accepted] label or the [E-mentor] label. If there is a -feature request that you are interested in, feel free to leave a comment -expressing your interest. If a Cargo team member has the time to help out, -they will respond to help with the next steps. Keep in mind that the Cargo -team has limited time, and may not be able to help with every feature request. -Most of them require some design work, which can be difficult. Check out the -[design principles chapter] for some guidance. +will have the [S-accepted] label. + +If there is a feature request that you are interested in, but it is not marked +as [S-accepted], feel free to leave a comment expressing your interest. If a +Cargo team member has the time to help out, they will respond to help with the +next steps. Keep in mind that the Cargo team has limited time, and may not be +able to help with every feature request. Most of them require some design +work, which can be difficult. Check out the [design principles chapter] for +some guidance. ## Working on large features @@ -114,11 +110,11 @@ The Cargo project uses several bots: ## Issue assignment -Normally, if you plan to work on an issue that has been marked with one of the -`E-` tags or [Feature accepted], it is sufficient just to leave a comment that -you are working on it. We also have a bot that allows you to formally "claim" -an issue by entering the text `@rustbot claim` in a comment. See the -[Assignment] docs on how this works. +Normally, if you plan to work on an issue that has been marked with the +[S-accepted] label, it is sufficient just to leave a comment that you are +working on it. We also have a bot that allows you to formally claim an issue +by entering the text `@rustbot claim` in a comment. See the [Assignment] docs +on how this works. [Assignment]: https://github.com/rust-lang/triagebot/wiki/Assignment diff --git a/src/doc/contrib/src/process/unstable.md b/src/doc/contrib/src/process/unstable.md index d59b9aa3429..9b05efc2e1e 100644 --- a/src/doc/contrib/src/process/unstable.md +++ b/src/doc/contrib/src/process/unstable.md @@ -33,10 +33,30 @@ typically created when a PR is close to being merged, or soon after it is merged. Use the [tracking issue template] when creating a tracking issue. Larger features should also get a new label in the issue tracker so that when -issues are filed, they can be easily tied together. +issues are filed, they can be easily tied together. Typically this would be +one of the `Z-` prefixed labels for nightly features. + +When opening a tracking issue, be sure to also add an `S-` status label to +indicate what needs to happen for it to move forward: + +* [S-needs-mentor] --- The feature isn't yet implemented, and needs a Cargo + team member to commit to helping guide and review the implementation. +* [S-accepted] --- The feature isn't yet implemented, and has a Cargo team + member willing to help review the implementation. +* [S-waiting-on-feedback] --- After the feature has been implemented, this + label indicates that it is waiting on community feedback for bugs or design + concerns. + +Tracking issues may have multiple status labels if necessary, for example if +something is only partially implemented, it may have both +[S-waiting-on-feedback] (for what is implemented) and [S-needs-mentor] or +[S-accepted] to finish the rest of the work. [tracking issue]: https://github.com/rust-lang/cargo/labels/C-tracking-issue [tracking issue template]: https://github.com/rust-lang/cargo/issues/new?labels=C-tracking-issue&template=tracking_issue.md +[S-needs-mentor]: https://github.com/rust-lang/cargo/labels/S-needs-mentor +[S-accepted]: https://github.com/rust-lang/cargo/labels/S-accepted +[S-waiting-on-feedback]: https://github.com/rust-lang/cargo/labels/S-waiting-on-feedback ## Pre-Stabilization From 8aa6a718c63bbfdc9ae1f3b8975bbcdec13d89ca Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Thu, 20 Apr 2023 07:31:59 -0700 Subject: [PATCH 025/104] Fix wording Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com> --- src/doc/contrib/src/issues.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/doc/contrib/src/issues.md b/src/doc/contrib/src/issues.md index 40f0b4100bd..b82492d2785 100644 --- a/src/doc/contrib/src/issues.md +++ b/src/doc/contrib/src/issues.md @@ -202,8 +202,7 @@ There are several things to consider when triaging an issue: see if there is something similar or identical to what is reported. If it is obviously a duplicate, write a comment that it is a duplicate of the other issue, and close the issue. If it isn't obvious that it is a duplicate, - leave a comment asking the author if it the other issue covers what they - reported. + leave a comment asking the author if the other issue covers what they reported. * For a bug, check if the report contains enough information to reproduce it. If you can't reproduce it, solicit more information from the author to From 2bb63495679b72cfdc004e115c84c93f0cb54817 Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Thu, 20 Apr 2023 15:31:35 -0700 Subject: [PATCH 026/104] Fix semver checks for 1.69 --- src/doc/src/reference/semver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index c8d7167fc45..22c42610f17 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -944,7 +944,7 @@ pub fn foo<T, U>() {} use updated_crate::foo; fn main() { - foo::<u8>(); // Error: this function takes 2 generic arguments but 1 generic argument was supplied + foo::<u8>(); // Error: function takes 2 generic arguments but 1 generic argument was supplied } ``` From 3f200c7250daf7480d5f3a530947964c3bb07ce9 Mon Sep 17 00:00:00 2001 From: QiangHeisenberg <liziqiang5@huawei.com> Date: Fri, 21 Apr 2023 11:25:09 +0800 Subject: [PATCH 027/104] output use line wrap --- Cargo.lock | 11 +++++++++++ Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 78ba8e2faf8..e37a66212eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -476,6 +476,7 @@ dependencies = [ "bitflags", "clap_lex", "strsim", + "terminal_size", ] [[package]] @@ -3073,6 +3074,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "textwrap" version = "0.11.0" diff --git a/Cargo.toml b/Cargo.toml index 7ad57a16c9b..0959271a302 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ base64 = "0.21.0" bytesize = "1.0" cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } cargo-util = { path = "crates/cargo-util", version = "0.2.4" } -clap = "4.2.0" +clap = { version = "4.2.0", features = ["wrap_help"] } crates-io = { path = "crates/crates-io", version = "0.36.0" } curl = { version = "0.4.44", features = ["http2"] } curl-sys = "0.4.61" From 0c564d3eddc3d1be4a398123d9fa46badfd94872 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Wed, 19 Apr 2023 22:37:40 +0100 Subject: [PATCH 028/104] chore: make `server-check` a workspace member --- .github/workflows/main.yml | 3 ++- Cargo.lock | 7 +++++++ {src/doc => crates}/semver-check/Cargo.toml | 0 {src/doc => crates}/semver-check/src/main.rs | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) rename {src/doc => crates}/semver-check/Cargo.toml (100%) rename {src/doc => crates}/semver-check/src/main.rs (99%) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94cfb044f1b..b3900da0cfd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -185,7 +185,8 @@ jobs: - run: rustup component add rust-docs - run: ci/validate-man.sh # This requires rustfmt, use stable. - - run: cd src/doc/semver-check && cargo +stable run + - name: Run semver-check + run: cargo +stable run -p semver-check - run: | mkdir mdbook curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook diff --git a/Cargo.lock b/Cargo.lock index e37a66212eb..818ca172783 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2779,6 +2779,13 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-check" +version = "0.1.0" +dependencies = [ + "tempfile", +] + [[package]] name = "serde" version = "1.0.160" diff --git a/src/doc/semver-check/Cargo.toml b/crates/semver-check/Cargo.toml similarity index 100% rename from src/doc/semver-check/Cargo.toml rename to crates/semver-check/Cargo.toml diff --git a/src/doc/semver-check/src/main.rs b/crates/semver-check/src/main.rs similarity index 99% rename from src/doc/semver-check/src/main.rs rename to crates/semver-check/src/main.rs index 51aacbe1105..f1630f519f4 100644 --- a/src/doc/semver-check/src/main.rs +++ b/crates/semver-check/src/main.rs @@ -25,7 +25,7 @@ const SEPARATOR: &str = "/////////////////////////////////////////////////////// fn doit() -> Result<(), Box<dyn Error>> { let filename = std::env::args() .nth(1) - .unwrap_or_else(|| "../src/reference/semver.md".to_string()); + .unwrap_or_else(|| "src/doc/src/reference/semver.md".to_string()); let contents = fs::read_to_string(filename)?; let mut lines = contents.lines().enumerate(); From 1aa1ce623bfcbbed419bdb7250121c085923b18d Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Wed, 19 Apr 2023 22:24:38 +0100 Subject: [PATCH 029/104] ci: run linkchekcer from target dir This helps us remove `src/doc` from `exclude` list in Cargo.toml --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3900da0cfd..303082018d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -196,11 +196,11 @@ jobs: env: RUSTDOCFLAGS: -D warnings - run: cd src/doc && mdbook build --dest-dir ../../target/doc - - run: | - cd src/doc - curl -sSLo linkcheck.sh \ - https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh - sh linkcheck.sh --all cargo + - name: Run linkchecker.sh + run: | + cd target + curl -sSLO https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh + sh linkcheck.sh --all --path ../src/doc cargo success: permissions: From 88e54ab646a801fc6760d9092fde0b9c0e16c6ab Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Wed, 19 Apr 2023 22:41:07 +0100 Subject: [PATCH 030/104] chore: remove `src/doc` from `exclude` list in Cargo.toml --- Cargo.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0959271a302..cb5aeb54234 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,10 +7,6 @@ members = [ "benches/capture", ] exclude = [ - # For linkchecker (downloaded during CI) and semver-check - # TODO: Either move semver-check to crates/ folder, - # or make linkchecker run from a given directory. - "src/doc/", "target/", # exclude bench testing ] From 212a79a016a3e02c60210e98f82a4793d8b5f855 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 20 Apr 2023 19:14:19 +0100 Subject: [PATCH 031/104] Bump to 0.72.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 818ca172783..fbc74b851a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "cargo" -version = "0.71.0" +version = "0.72.0" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index cb5aeb54234..99a71418856 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ exclude = [ [package] name = "cargo" -version = "0.71.0" +version = "0.72.0" edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://crates.io" From 029e31e9ae9003025e610bf179cc51b66085ffd0 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 20 Apr 2023 23:47:20 +0100 Subject: [PATCH 032/104] Update changelog for 1.70 --- CHANGELOG.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 87 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f08909803..0359085c6fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,18 @@ # Changelog ## Cargo 1.70 (2023-06-01) -[9880b408...HEAD](https://github.com/rust-lang/cargo/compare/9880b408...HEAD) +[9880b408...rust-1.70.0](https://github.com/rust-lang/cargo/compare/9880b408...rust-1.70.0) ### Added +- 🎉 Added `cargo logout` command for removing an API token from the registry locally. + [docs](https://doc.rust-lang.org/nightly/cargo/commands/cargo-logout.html) + [#11919](https://github.com/rust-lang/cargo/pull/11919) + [#11950](https://github.com/rust-lang/cargo/pull/11950) +- Added `--ignore-rust-version` flag to `cargo install`. + [#11859](https://github.com/rust-lang/cargo/pull/11859) - The `CARGO_PKG_README` environment variable is now set to the path to the - README file when compiling a crate. + README file when compiling a crate. [#11645](https://github.com/rust-lang/cargo/pull/11645) - Cargo now displays richer information of Cargo target failed to compile. [#11636](https://github.com/rust-lang/cargo/pull/11636) @@ -18,6 +24,20 @@ ([docs](https://doc.rust-lang.org/nightly/cargo/reference/registries.html#registry-protocols)) [#11791](https://github.com/rust-lang/cargo/pull/11791) [#11783](https://github.com/rust-lang/cargo/pull/11783) +- ❗ `cargo login` and `cargo logout` now uses the registry specified in + `registry.default`. This was an unintentional regression. + [#11949](https://github.com/rust-lang/cargo/pull/11949) +- `cargo update` accurately shows `Downgrading` status when downgrading dependencies. + [#11839](https://github.com/rust-lang/cargo/pull/11839) +- Added more information to HTTP errors to help with debugging. + [#11878](https://github.com/rust-lang/cargo/pull/11878) +- Added delays to network retries in Cargo. + [#11881](https://github.com/rust-lang/cargo/pull/11881) +- Refined `cargo puslish` message when waiting for a publish complete. + [#11713](https://github.com/rust-lang/cargo/pull/11713) +- Better error message when `cargo install` from a git repository but found + multiple packages. + [#11835](https://github.com/rust-lang/cargo/pull/11835) ### Fixed @@ -29,6 +49,15 @@ [#11805](https://github.com/rust-lang/cargo/pull/11805) - Don't panic when [`patch`] involved in dependency resolution results in a conflict. [#11770](https://github.com/rust-lang/cargo/pull/11770) +- Fixed credential token format validation. + [#11951](https://github.com/rust-lang/cargo/pull/11951) +- Added the missing token format validation on publish. + [#11952](https://github.com/rust-lang/cargo/pull/11952) +- Fixed case mismatches when looking up env vars in the Config snapshot. + [#11824](https://github.com/rust-lang/cargo/pull/11824) +- `cargo new` generates the correct `.hgignore` aligning semantics with other + VCS ignore files. + [#11855](https://github.com/rust-lang/cargo/pull/11855) ### Nightly only @@ -42,6 +71,8 @@ ([docs](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html##gitoxide)) [#11448](https://github.com/rust-lang/cargo/pull/11448) [#11800](https://github.com/rust-lang/cargo/pull/11800) + [#11822](https://github.com/rust-lang/cargo/pull/11822) + [#11830](https://github.com/rust-lang/cargo/pull/11830) - Removed `-Zjobserver-per-rustc`. Its rustc counterpart never got landed. [#11764](https://github.com/rust-lang/cargo/pull/11764) @@ -51,16 +82,69 @@ [#11793](https://github.com/rust-lang/cargo/pull/11793) - Enhanced the documentation of timing report with graphs. [#11798](https://github.com/rust-lang/cargo/pull/11798) +- Clarified requirements about the state of the registry index after publish. + [#11926](https://github.com/rust-lang/cargo/pull/11926) +- Clarified docs on `-C` that it appears before the command. + [#11947](https://github.com/rust-lang/cargo/pull/11947) +- Clarified working directory behaviour for `cargo test`, `cargo bench` and + `cargo run`. + [#11901](https://github.com/rust-lang/cargo/pull/11901) +- Fixed the doc of `registries.name.index` configuration. + [#11880](https://github.com/rust-lang/cargo/pull/11880) +- Notice for potential unexpected shell expansions in help text of `cargo-add`. + [#11826](https://github.com/rust-lang/cargo/pull/11826) +- Updated external-tools JSON docs. + [#11918](https://github.com/rust-lang/cargo/pull/11918) +- Call out the differences between the index JSON and the API or metadata. + [#11927](https://github.com/rust-lang/cargo/pull/11927) +- Consistently use `@` when mentioning pkgid format. + [#11956](https://github.com/rust-lang/cargo/pull/11956) +- Stopped using `UncanonicalizedIter` for `QueryKind::Exact`. + [#11937](https://github.com/rust-lang/cargo/pull/11937) +- Don't query permutations of the path prefix of a dependency in the registry index. + [#11936](https://github.com/rust-lang/cargo/pull/11936) +- Enabled clippy warning on `disallowed_methods` for `std::env::var` and friends. + [#11828](https://github.com/rust-lang/cargo/pull/11828) +- Enhanced Cargo Contributor Guide. + [#11825](https://github.com/rust-lang/cargo/pull/11825) + [#11842](https://github.com/rust-lang/cargo/pull/11842) + [#11869](https://github.com/rust-lang/cargo/pull/11869) + [#11876](https://github.com/rust-lang/cargo/pull/11876) +- Moved a part of Cargo Contributor Guide to Cargo API documentation. + [docs](https://doc.rust-lang.org/nightly/nightly-rustc/cargo) + [#11809](https://github.com/rust-lang/cargo/pull/11809) + [#11841](https://github.com/rust-lang/cargo/pull/11841) + [#11850](https://github.com/rust-lang/cargo/pull/11850) + [#11870](https://github.com/rust-lang/cargo/pull/11870) +- Cargo team now arranges + [office hours](https://github.com/rust-lang/cargo/wiki/Office-Hours)! + [#11903](https://github.com/rust-lang/cargo/pull/11903) ### Internal - Switched to `sha2` crate for SHA256 calculation. [#11795](https://github.com/rust-lang/cargo/pull/11795) [#11807](https://github.com/rust-lang/cargo/pull/11807) -- Updated to `base64` v0.21.0. +- Switched benchsuite to the index archive. + [#11933](https://github.com/rust-lang/cargo/pull/11933) +- Updated to `base64` 0.21.0. [#11796](https://github.com/rust-lang/cargo/pull/11796) +- Updated to `curl-sys` 0.4.61, which corresponds to curl 8.0.1. + [#11871](https://github.com/rust-lang/cargo/pull/11871) +- Updated to `proptest` 1.1.0. + [#11886](https://github.com/rust-lang/cargo/pull/11886) +- Updated to `git2` 0.17.0, which corresponds to libgit2 1.6.3. + [#11928](https://github.com/rust-lang/cargo/pull/11928) +- Updated to `clap` 4.2. + [#11904](https://github.com/rust-lang/cargo/pull/11904) - Integrated `cargo-deny` in Cargo its own CI pipeline. [#11761](https://github.com/rust-lang/cargo/pull/11761) +- Made non-blocking IO calls more robust. + [#11624](https://github.com/rust-lang/cargo/pull/11624) +- Dropped `derive` feature from `serde` in `cargo-platform`. + [#11915](https://github.com/rust-lang/cargo/pull/11915) +- Replaced `std::fs::canonicalize` with a more robust `try_canonicalize`. + [#11866](https://github.com/rust-lang/cargo/pull/11866) ## Cargo 1.69 (2023-04-20) [985d561f...rust-1.69.0](https://github.com/rust-lang/cargo/compare/985d561f...rust-1.69.0) From fbc69c8610cc73b7fc24da44e2d4b1450fe4bcc3 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 20 Apr 2023 23:48:24 +0100 Subject: [PATCH 033/104] Update changelog for 1.71 --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0359085c6fb..40b55ed0e36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,45 @@ # Changelog +## Cargo 1.71 (2023-07-13) +[84b7041f...HEAD](https://github.com/rust-lang/cargo/compare/84b7041f...HEAD) + +### Added + +### Changed + +- Better error message when getting an empty dependency table in Cargo.toml. + [#11997](https://github.com/rust-lang/cargo/pull/11997) +- Use restricted Damerau-Levenshtein algorithm to provide typo suggestions. + [#11963](https://github.com/rust-lang/cargo/pull/11963) + +### Fixed + +- Corrected the bug report URL for `cargo clippy --fix`. + [#11882](https://github.com/rust-lang/cargo/pull/11882) + +### Nightly only + +- Recompile on profile rustflags changes. + [#11981](https://github.com/rust-lang/cargo/pull/11981) + +### Documentation + +### Internal + +- Cargo is now a Cargo workspace. We dogfood ourselves finally. + [#11851](https://github.com/rust-lang/cargo/pull/11851) + [#11994](https://github.com/rust-lang/cargo/pull/11994) + [#11996](https://github.com/rust-lang/cargo/pull/11996) +- Allow win/mac credential managers to build on all platforms. + [#11993](https://github.com/rust-lang/cargo/pull/11993) +- Use `openssl` only on non-Windows platforms. + [#11979](https://github.com/rust-lang/cargo/pull/11979) +- A new, straightforward issue labels system for Cargo contributors. + [docs](https://doc.crates.io/contrib/issues.html) + [#11995](https://github.com/rust-lang/cargo/pull/11995) + [#12002](https://github.com/rust-lang/cargo/pull/12002) + [#12003](https://github.com/rust-lang/cargo/pull/12003) + ## Cargo 1.70 (2023-06-01) [9880b408...rust-1.70.0](https://github.com/rust-lang/cargo/compare/9880b408...rust-1.70.0) From 9d17eb18d271c6375368e76d80b2dc3b08130a69 Mon Sep 17 00:00:00 2001 From: Joshua Nelson <github@jyn.dev> Date: Mon, 10 Apr 2023 23:59:08 -0500 Subject: [PATCH 034/104] Allow named debuginfo options in Cargo.toml Rustc supports these since rust-lang/rust#109808. It's technically possible to set a named debuginfo level through `RUSTFLAGS`, but in practice cargo always passes its own opinion of what the debuginfo level is, so allow it to be configured through cargo too. --- src/cargo/core/compiler/mod.rs | 14 ++++- src/cargo/core/profiles.rs | 39 ++++++------ src/cargo/util/machine_message.rs | 10 ++- src/cargo/util/toml/mod.rs | 101 +++++++++++++++++++++++++++--- tests/testsuite/bad_config.rs | 34 +++++++++- tests/testsuite/config.rs | 8 +-- tests/testsuite/profile_config.rs | 7 ++- 7 files changed, 174 insertions(+), 39 deletions(-) diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs index 7b43fd27d99..1c37cc1aa17 100644 --- a/src/cargo/core/compiler/mod.rs +++ b/src/cargo/core/compiler/mod.rs @@ -92,6 +92,7 @@ use crate::core::{Feature, PackageId, Target, Verbosity}; use crate::util::errors::{CargoResult, VerboseError}; use crate::util::interning::InternedString; use crate::util::machine_message::{self, Message}; +use crate::util::toml::TomlDebugInfo; use crate::util::{add_path_args, internal, iter_join_onto, profile}; use cargo_util::{paths, ProcessBuilder, ProcessError}; use rustfix::diagnostics::Applicability; @@ -603,9 +604,20 @@ fn link_targets(cx: &mut Context<'_, '_>, unit: &Unit, fresh: bool) -> CargoResu } if json_messages { + let debuginfo = profile.debuginfo.to_option().map(|d| match d { + TomlDebugInfo::None => machine_message::ArtifactDebuginfo::Int(0), + TomlDebugInfo::Limited => machine_message::ArtifactDebuginfo::Int(1), + TomlDebugInfo::Full => machine_message::ArtifactDebuginfo::Int(2), + TomlDebugInfo::LineDirectivesOnly => { + machine_message::ArtifactDebuginfo::Named("line-directives-only") + } + TomlDebugInfo::LineTablesOnly => { + machine_message::ArtifactDebuginfo::Named("line-tables-only") + } + }); let art_profile = machine_message::ArtifactProfile { opt_level: profile.opt_level.as_str(), - debuginfo: profile.debuginfo.to_option(), + debuginfo, debug_assertions: profile.debug_assertions, overflow_checks: profile.overflow_checks, test: unit_mode.is_any_test(), diff --git a/src/cargo/core/profiles.rs b/src/cargo/core/profiles.rs index 053df853c38..d6e6c3ccb38 100644 --- a/src/cargo/core/profiles.rs +++ b/src/cargo/core/profiles.rs @@ -26,7 +26,9 @@ use crate::core::dependency::Artifact; use crate::core::resolver::features::FeaturesFor; use crate::core::{PackageId, PackageIdSpec, Resolve, Shell, Target, Workspace}; use crate::util::interning::InternedString; -use crate::util::toml::{ProfilePackageSpec, StringOrBool, TomlProfile, TomlProfiles, U32OrBool}; +use crate::util::toml::{ + ProfilePackageSpec, StringOrBool, TomlDebugInfo, TomlProfile, TomlProfiles, +}; use crate::util::{closest_msg, config, CargoResult, Config}; use anyhow::{bail, Context as _}; use std::collections::{BTreeMap, HashMap, HashSet}; @@ -276,15 +278,13 @@ impl Profiles { // platform which has a stable `-Csplit-debuginfo` option for rustc, // and it's typically much faster than running `dsymutil` on all builds // in incremental cases. - if let Some(debug) = profile.debuginfo.to_option() { - if profile.split_debuginfo.is_none() && debug > 0 { - let target = match &kind { - CompileKind::Host => self.rustc_host.as_str(), - CompileKind::Target(target) => target.short_name(), - }; - if target.contains("-apple-") { - profile.split_debuginfo = Some(InternedString::new("unpacked")); - } + if profile.debuginfo.is_turned_on() && profile.split_debuginfo.is_none() { + let target = match &kind { + CompileKind::Host => self.rustc_host.as_str(), + CompileKind::Target(target) => target.short_name(), + }; + if target.contains("-apple-") { + profile.split_debuginfo = Some(InternedString::new("unpacked")); } } @@ -528,11 +528,8 @@ fn merge_profile(profile: &mut Profile, toml: &TomlProfile) { if toml.codegen_units.is_some() { profile.codegen_units = toml.codegen_units; } - match toml.debug { - Some(U32OrBool::U32(debug)) => profile.debuginfo = DebugInfo::Explicit(debug), - Some(U32OrBool::Bool(true)) => profile.debuginfo = DebugInfo::Explicit(2), - Some(U32OrBool::Bool(false)) => profile.debuginfo = DebugInfo::None, - None => {} + if let Some(debuginfo) = toml.debug { + profile.debuginfo = DebugInfo::Explicit(debuginfo); } if let Some(debug_assertions) = toml.debug_assertions { profile.debug_assertions = debug_assertions; @@ -683,7 +680,7 @@ impl Profile { Profile { name: InternedString::new("dev"), root: ProfileRoot::Debug, - debuginfo: DebugInfo::Explicit(2), + debuginfo: DebugInfo::Explicit(TomlDebugInfo::Full), debug_assertions: true, overflow_checks: true, incremental: true, @@ -742,7 +739,7 @@ pub enum DebugInfo { /// No debuginfo level was set. None, /// A debuginfo level that is explicitly set, by a profile or a user. - Explicit(u32), + Explicit(TomlDebugInfo), /// For internal purposes: a deferred debuginfo level that can be optimized /// away, but has this value otherwise. /// @@ -752,22 +749,22 @@ pub enum DebugInfo { /// faster to build (see [DebugInfo::weaken]). /// /// In all other situations, this level value will be the one to use. - Deferred(u32), + Deferred(TomlDebugInfo), } impl DebugInfo { /// The main way to interact with this debuginfo level, turning it into an Option. - pub fn to_option(&self) -> Option<u32> { + pub fn to_option(self) -> Option<TomlDebugInfo> { match self { DebugInfo::None => None, - DebugInfo::Explicit(v) | DebugInfo::Deferred(v) => Some(*v), + DebugInfo::Explicit(v) | DebugInfo::Deferred(v) => Some(v), } } /// Returns true if the debuginfo level is high enough (at least 1). Helper /// for a common operation on the usual `Option` representation. pub(crate) fn is_turned_on(&self) -> bool { - self.to_option().unwrap_or(0) != 0 + !matches!(self.to_option(), None | Some(TomlDebugInfo::None)) } pub(crate) fn is_deferred(&self) -> bool { diff --git a/src/cargo/util/machine_message.rs b/src/cargo/util/machine_message.rs index baef5167b36..f1602ae57c3 100644 --- a/src/cargo/util/machine_message.rs +++ b/src/cargo/util/machine_message.rs @@ -55,12 +55,20 @@ impl<'a> Message for Artifact<'a> { #[derive(Serialize)] pub struct ArtifactProfile { pub opt_level: &'static str, - pub debuginfo: Option<u32>, + pub debuginfo: Option<ArtifactDebuginfo>, pub debug_assertions: bool, pub overflow_checks: bool, pub test: bool, } +/// Internally this is an enum with different variants, but keep using 0/1/2 as integers for compatibility. +#[derive(Serialize)] +#[serde(untagged)] +pub enum ArtifactDebuginfo { + Int(u32), + Named(&'static str), +} + #[derive(Serialize)] pub struct BuildScript<'a> { pub package_id: PackageId, diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 9e7c6f63e20..a119b343133 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -1,5 +1,5 @@ use std::collections::{BTreeMap, BTreeSet, HashMap}; -use std::fmt; +use std::fmt::{self, Display, Write}; use std::marker::PhantomData; use std::path::{Path, PathBuf}; use std::rc::Rc; @@ -12,8 +12,8 @@ use itertools::Itertools; use lazycell::LazyCell; use log::{debug, trace}; use semver::{self, VersionReq}; -use serde::de; use serde::de::IntoDeserializer as _; +use serde::de::{self, Unexpected}; use serde::ser; use serde::{Deserialize, Serialize}; use url::Url; @@ -442,11 +442,96 @@ impl ser::Serialize for TomlOptLevel { } } -#[derive(Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged, expecting = "expected a boolean or an integer")] -pub enum U32OrBool { - U32(u32), - Bool(bool), +#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)] +pub enum TomlDebugInfo { + None, + LineDirectivesOnly, + LineTablesOnly, + Limited, + Full, +} + +impl ser::Serialize for TomlDebugInfo { + fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> + where + S: ser::Serializer, + { + match self { + Self::None => 0.serialize(serializer), + Self::LineDirectivesOnly => "line-directives-only".serialize(serializer), + Self::LineTablesOnly => "line-tables-only".serialize(serializer), + Self::Limited => 1.serialize(serializer), + Self::Full => 2.serialize(serializer), + } + } +} + +impl<'de> de::Deserialize<'de> for TomlDebugInfo { + fn deserialize<D>(d: D) -> Result<TomlDebugInfo, D::Error> + where + D: de::Deserializer<'de>, + { + struct Visitor; + + impl<'de> de::Visitor<'de> for Visitor { + type Value = TomlDebugInfo; + + fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter + .write_str("a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\"") + } + + fn visit_i64<E>(self, value: i64) -> Result<TomlDebugInfo, E> + where + E: de::Error, + { + let debuginfo = match value { + 0 => TomlDebugInfo::None, + 1 => TomlDebugInfo::Limited, + 2 => TomlDebugInfo::Full, + _ => return Err(de::Error::invalid_value(Unexpected::Signed(value), &self)), + }; + Ok(debuginfo) + } + + fn visit_bool<E>(self, v: bool) -> Result<Self::Value, E> + where + E: de::Error, + { + Ok(if v { + TomlDebugInfo::Full + } else { + TomlDebugInfo::None + }) + } + + fn visit_str<E>(self, value: &str) -> Result<TomlDebugInfo, E> + where + E: de::Error, + { + let debuginfo = match value { + "line-directives-only" => TomlDebugInfo::LineDirectivesOnly, + "line-tables-only" => TomlDebugInfo::LineTablesOnly, + _ => return Err(de::Error::invalid_value(Unexpected::Str(value), &self)), + }; + Ok(debuginfo) + } + } + + d.deserialize_any(Visitor) + } +} + +impl Display for TomlDebugInfo { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + TomlDebugInfo::None => f.write_char('0'), + TomlDebugInfo::Limited => f.write_char('1'), + TomlDebugInfo::Full => f.write_char('2'), + TomlDebugInfo::LineDirectivesOnly => f.write_str("line-directives-only"), + TomlDebugInfo::LineTablesOnly => f.write_str("line-tables-only"), + } + } } #[derive(Deserialize, Serialize, Clone, Debug, Default, Eq, PartialEq)] @@ -456,7 +541,7 @@ pub struct TomlProfile { pub lto: Option<StringOrBool>, pub codegen_backend: Option<InternedString>, pub codegen_units: Option<u32>, - pub debug: Option<U32OrBool>, + pub debug: Option<TomlDebugInfo>, pub split_debuginfo: Option<String>, pub debug_assertions: Option<bool>, pub rpath: Option<bool>, diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs index ca51b101e39..aaf6accc532 100644 --- a/tests/testsuite/bad_config.rs +++ b/tests/testsuite/bad_config.rs @@ -1313,6 +1313,38 @@ fn bad_debuginfo() { .file("src/lib.rs", "") .build(); + p.cargo("check") + .with_status(101) + .with_stderr( + "\ +error: failed to parse manifest [..] + +Caused by: + invalid value: string \"a\", expected a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\" + in `profile.dev.debug` +", + ) + .run(); +} + +#[cargo_test] +fn bad_debuginfo2() { + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.0.0" + authors = [] + + [profile.dev] + debug = 3.6 + "#, + ) + .file("src/lib.rs", "") + .build(); + p.cargo("check") .with_status(101) .with_stderr( @@ -1320,7 +1352,7 @@ fn bad_debuginfo() { error: failed to parse manifest at `[..]` Caused by: - expected a boolean or an integer + invalid type: floating point `3.6`, expected a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\" in `profile.dev.debug` ", ) diff --git a/tests/testsuite/config.rs b/tests/testsuite/config.rs index 92e1f42643c..7c37106a786 100644 --- a/tests/testsuite/config.rs +++ b/tests/testsuite/config.rs @@ -401,7 +401,7 @@ lto = false opt_level: Some(cargo_toml::TomlOptLevel("s".to_string())), lto: Some(cargo_toml::StringOrBool::Bool(true)), codegen_units: Some(5), - debug: Some(cargo_toml::U32OrBool::Bool(true)), + debug: Some(cargo_toml::TomlDebugInfo::Full), debug_assertions: Some(true), rpath: Some(true), panic: Some("abort".to_string()), @@ -444,7 +444,7 @@ fn profile_env_var_prefix() { .build(); let p: cargo_toml::TomlProfile = config.get("profile.dev").unwrap(); assert_eq!(p.debug_assertions, None); - assert_eq!(p.debug, Some(cargo_toml::U32OrBool::U32(1))); + assert_eq!(p.debug, Some(cargo_toml::TomlDebugInfo::Limited)); let config = ConfigBuilder::new() .env("CARGO_PROFILE_DEV_DEBUG_ASSERTIONS", "false") @@ -452,7 +452,7 @@ fn profile_env_var_prefix() { .build(); let p: cargo_toml::TomlProfile = config.get("profile.dev").unwrap(); assert_eq!(p.debug_assertions, Some(false)); - assert_eq!(p.debug, Some(cargo_toml::U32OrBool::U32(1))); + assert_eq!(p.debug, Some(cargo_toml::TomlDebugInfo::Limited)); } #[cargo_test] @@ -1511,7 +1511,7 @@ fn all_profile_options() { lto: Some(cargo_toml::StringOrBool::String("thin".to_string())), codegen_backend: Some(InternedString::new("example")), codegen_units: Some(123), - debug: Some(cargo_toml::U32OrBool::U32(1)), + debug: Some(cargo_toml::TomlDebugInfo::Limited), split_debuginfo: Some("packed".to_string()), debug_assertions: Some(true), rpath: Some(true), diff --git a/tests/testsuite/profile_config.rs b/tests/testsuite/profile_config.rs index c59ed7a97f5..cf9807964e2 100644 --- a/tests/testsuite/profile_config.rs +++ b/tests/testsuite/profile_config.rs @@ -1,5 +1,6 @@ //! Tests for profiles defined in config files. +use cargo::util::toml::TomlDebugInfo; use cargo_test_support::paths::CargoPathExt; use cargo_test_support::registry::Package; use cargo_test_support::{basic_lib_manifest, paths, project}; @@ -436,7 +437,7 @@ fn named_config_profile() { assert_eq!(p.name, "foo"); assert_eq!(p.codegen_units, Some(2)); // "foo" from config assert_eq!(p.opt_level, "1"); // "middle" from manifest - assert_eq!(p.debuginfo.to_option(), Some(1)); // "bar" from config + assert_eq!(p.debuginfo.to_option(), Some(TomlDebugInfo::Limited)); // "bar" from config assert_eq!(p.debug_assertions, true); // "dev" built-in (ignore build-override) assert_eq!(p.overflow_checks, true); // "dev" built-in (ignore package override) @@ -445,7 +446,7 @@ fn named_config_profile() { assert_eq!(bo.name, "foo"); assert_eq!(bo.codegen_units, Some(6)); // "foo" build override from config assert_eq!(bo.opt_level, "0"); // default to zero - assert_eq!(bo.debuginfo.to_option(), Some(1)); // SAME as normal + assert_eq!(bo.debuginfo.to_option(), Some(TomlDebugInfo::Limited)); // SAME as normal assert_eq!(bo.debug_assertions, false); // "foo" build override from manifest assert_eq!(bo.overflow_checks, true); // SAME as normal @@ -454,7 +455,7 @@ fn named_config_profile() { assert_eq!(po.name, "foo"); assert_eq!(po.codegen_units, Some(7)); // "foo" package override from config assert_eq!(po.opt_level, "1"); // SAME as normal - assert_eq!(po.debuginfo.to_option(), Some(1)); // SAME as normal + assert_eq!(po.debuginfo.to_option(), Some(TomlDebugInfo::Limited)); // SAME as normal assert_eq!(po.debug_assertions, true); // SAME as normal assert_eq!(po.overflow_checks, false); // "middle" package override from manifest } From 7a776cfe28f09571b08255f4d23c89ef085d87fd Mon Sep 17 00:00:00 2001 From: Joshua Nelson <github@jyn.dev> Date: Tue, 11 Apr 2023 15:58:57 -0500 Subject: [PATCH 035/104] Allow none/limited/full as aliases for 0-2 --- src/cargo/util/toml/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index a119b343133..18aef026310 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -510,6 +510,9 @@ impl<'de> de::Deserialize<'de> for TomlDebugInfo { E: de::Error, { let debuginfo = match value { + "none" => TomlDebugInfo::None, + "limited" => TomlDebugInfo::Limited, + "full" => TomlDebugInfo::Full, "line-directives-only" => TomlDebugInfo::LineDirectivesOnly, "line-tables-only" => TomlDebugInfo::LineTablesOnly, _ => return Err(de::Error::invalid_value(Unexpected::Str(value), &self)), From 2700195c97341d1a026cdc2d08629b430cc8772f Mon Sep 17 00:00:00 2001 From: jyn <github@jyn.dev> Date: Wed, 12 Apr 2023 11:36:14 -0500 Subject: [PATCH 036/104] Address review comments - Update the documentation and doc-comments - Improve the error message for parsing Cargo.toml --- src/cargo/core/profiles.rs | 2 +- src/cargo/util/toml/mod.rs | 5 +++-- src/doc/src/reference/profiles.md | 8 +++++--- tests/testsuite/bad_config.rs | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/cargo/core/profiles.rs b/src/cargo/core/profiles.rs index d6e6c3ccb38..afaf3fb4fe4 100644 --- a/src/cargo/core/profiles.rs +++ b/src/cargo/core/profiles.rs @@ -761,7 +761,7 @@ impl DebugInfo { } } - /// Returns true if the debuginfo level is high enough (at least 1). Helper + /// Returns true if any debuginfo will be generated. Helper /// for a common operation on the usual `Option` representation. pub(crate) fn is_turned_on(&self) -> bool { !matches!(self.to_option(), None | Some(TomlDebugInfo::None)) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 18aef026310..a28b8240ae7 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -477,8 +477,9 @@ impl<'de> de::Deserialize<'de> for TomlDebugInfo { type Value = TomlDebugInfo; fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter - .write_str("a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\"") + formatter.write_str( + "a boolean, 0, 1, 2, \"line-tables-only\", or \"line-directives-only\"", + ) } fn visit_i64<E>(self, value: i64) -> Result<TomlDebugInfo, E> diff --git a/src/doc/src/reference/profiles.md b/src/doc/src/reference/profiles.md index 56c8538f80b..6b58d088883 100644 --- a/src/doc/src/reference/profiles.md +++ b/src/doc/src/reference/profiles.md @@ -67,9 +67,11 @@ amount of debug information included in the compiled binary. The valid options are: -* `0` or `false`: no debug info at all -* `1`: line tables only -* `2` or `true`: full debug info +* `0`, `false`, or `"none"`: no debug info at all +* `"line-directives-only"`: line info directives only. For the nvptx* targets this enables [profiling](https://reviews.llvm.org/D46061). For other use cases, `line-tables-only` is the better, more compatible choice. +* `"line-tables-only"`: line tables only. Generates the minimal amount of debug info for backtraces with filename/line number info, but not anything else, i.e. no variable or function parameter info. +* `1` or `"limited"`: debug info without type or variable-level information. Generates more detailed module-level info than `line-tables-only`. +* `2`, `true`, or `"full"`: full debug info You may wish to also configure the [`split-debuginfo`](#split-debuginfo) option depending on your needs as well. diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs index aaf6accc532..2d3242837ff 100644 --- a/tests/testsuite/bad_config.rs +++ b/tests/testsuite/bad_config.rs @@ -1320,7 +1320,7 @@ fn bad_debuginfo() { error: failed to parse manifest [..] Caused by: - invalid value: string \"a\", expected a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\" + invalid value: string \"a\", expected a boolean, 0, 1, 2, \"line-tables-only\", or \"line-directives-only\" in `profile.dev.debug` ", ) @@ -1352,7 +1352,7 @@ fn bad_debuginfo2() { error: failed to parse manifest at `[..]` Caused by: - invalid type: floating point `3.6`, expected a boolean, 0-2, \"line-tables-only\", or \"line-directives-only\" + invalid type: floating point `3.6`, expected a boolean, 0, 1, 2, \"line-tables-only\", or \"line-directives-only\" in `profile.dev.debug` ", ) From f6cf96c63cb7aa4c6fe886a146ac9d22ce479f72 Mon Sep 17 00:00:00 2001 From: jyn <github@jyn.dev> Date: Wed, 19 Apr 2023 19:31:22 -0500 Subject: [PATCH 037/104] add more debuginfo tests --- tests/testsuite/config.rs | 59 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/tests/testsuite/config.rs b/tests/testsuite/config.rs index 7c37106a786..b0f9d167b85 100644 --- a/tests/testsuite/config.rs +++ b/tests/testsuite/config.rs @@ -3,7 +3,7 @@ use cargo::core::{PackageIdSpec, Shell}; use cargo::util::config::{self, Config, Definition, SslVersionConfig, StringList}; use cargo::util::interning::InternedString; -use cargo::util::toml::{self as cargo_toml, VecStringOrBool as VSOB}; +use cargo::util::toml::{self as cargo_toml, TomlDebugInfo, VecStringOrBool as VSOB}; use cargo::CargoResult; use cargo_test_support::compare; use cargo_test_support::{panic_error, paths, project, symlink_supported, t}; @@ -1594,3 +1594,60 @@ known-hosts = [ Definition::Environment("CARGO_NET_SSH_KNOWN_HOSTS".to_string()) ); } + +#[cargo_test] +fn debuginfo_parsing() { + let config = ConfigBuilder::new().build(); + let p: cargo_toml::TomlProfile = config.get("profile.dev").unwrap(); + assert_eq!(p.debug, None); + + let env_test_cases = [ + (TomlDebugInfo::None, ["false", "0", "none"].as_slice()), + (TomlDebugInfo::LineDirectivesOnly, &["line-directives-only"]), + (TomlDebugInfo::LineTablesOnly, &["line-tables-only"]), + (TomlDebugInfo::Limited, &["1", "limited"]), + (TomlDebugInfo::Full, &["true", "2", "full"]), + ]; + for (expected, config_strs) in env_test_cases { + for &val in config_strs { + let config = ConfigBuilder::new() + .env("CARGO_PROFILE_DEV_DEBUG", val) + .build(); + let debug: TomlDebugInfo = config.get("profile.dev.debug").unwrap(); + assert_eq!(debug, expected, "failed to parse {val}"); + } + } + + let toml_test_cases = [ + (TomlDebugInfo::None, ["false", "0", "\"none\""].as_slice()), + ( + TomlDebugInfo::LineDirectivesOnly, + &["\"line-directives-only\""], + ), + (TomlDebugInfo::LineTablesOnly, &["\"line-tables-only\""]), + (TomlDebugInfo::Limited, &["1", "\"limited\""]), + (TomlDebugInfo::Full, &["true", "2", "\"full\""]), + ]; + for (expected, config_strs) in toml_test_cases { + for &val in config_strs { + let config = ConfigBuilder::new() + .config_arg(format!("profile.dev.debug={val}")) + .build(); + let debug: TomlDebugInfo = config.get("profile.dev.debug").unwrap(); + assert_eq!(debug, expected, "failed to parse {val}"); + } + } + + let toml_err_cases = ["\"\"", "\"unrecognized\"", "3"]; + for err_val in toml_err_cases { + let config = ConfigBuilder::new() + .config_arg(format!("profile.dev.debug={err_val}")) + .build(); + let err = config + .get::<TomlDebugInfo>("profile.dev.debug") + .unwrap_err(); + assert!(err + .to_string() + .ends_with("could not load config key `profile.dev.debug`")); + } +} From 5bd34a1e50f498dc96dc2e858a61e3a4320a5c58 Mon Sep 17 00:00:00 2001 From: jyn <github@jyn.dev> Date: Fri, 21 Apr 2023 18:58:37 -0500 Subject: [PATCH 038/104] Use relative links in documentation --- src/doc/src/reference/profiles.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/doc/src/reference/profiles.md b/src/doc/src/reference/profiles.md index 6b58d088883..124203d55f9 100644 --- a/src/doc/src/reference/profiles.md +++ b/src/doc/src/reference/profiles.md @@ -67,16 +67,20 @@ amount of debug information included in the compiled binary. The valid options are: -* `0`, `false`, or `"none"`: no debug info at all -* `"line-directives-only"`: line info directives only. For the nvptx* targets this enables [profiling](https://reviews.llvm.org/D46061). For other use cases, `line-tables-only` is the better, more compatible choice. +* `0`, `false`, or `"none"`: no debug info at all, default for [`release`](#release) +* `"line-directives-only"`: line info directives only. For the nvptx* targets this enables [profiling]. For other use cases, `line-tables-only` is the better, more compatible choice. * `"line-tables-only"`: line tables only. Generates the minimal amount of debug info for backtraces with filename/line number info, but not anything else, i.e. no variable or function parameter info. * `1` or `"limited"`: debug info without type or variable-level information. Generates more detailed module-level info than `line-tables-only`. -* `2`, `true`, or `"full"`: full debug info +* `2`, `true`, or `"full"`: full debug info, default for [`dev`](#dev) + +For more information on what each option does see `rustc`'s docs on [debuginfo]. You may wish to also configure the [`split-debuginfo`](#split-debuginfo) option depending on your needs as well. [`-C debuginfo` flag]: ../../rustc/codegen-options/index.html#debuginfo +[debuginfo]: ../../rustc/codegen-options/index.html#debuginfo +[profiling]: https://reviews.llvm.org/D46061 #### split-debuginfo From 6f1b0f06f1fa41349a062fd35962c9435e2f39bc Mon Sep 17 00:00:00 2001 From: Marcono1234 <Marcono1234@users.noreply.github.com> Date: Sat, 22 Apr 2023 16:27:43 +0200 Subject: [PATCH 039/104] Update outdated crates.io URLs in publishing guide --- src/doc/src/reference/publishing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/src/reference/publishing.md b/src/doc/src/reference/publishing.md index 98d572c346f..564dfb34e5b 100644 --- a/src/doc/src/reference/publishing.md +++ b/src/doc/src/reference/publishing.md @@ -12,10 +12,10 @@ limit to the number of versions which can be published, however. First things first, you’ll need an account on [crates.io] to acquire an API token. To do so, [visit the home page][crates.io] and log in via a GitHub -account (required for now). You will also need to verify your email address on the -[Account Settings](https://crates.io/me) page. Once that is done create an API token, -make sure you copy it. Once you leave the page you will not be able to see it -again. +account (required for now). You will also need to provide and verify your email +address on the [Account Settings](https://crates.io/settings/profile) page. Once +that is done [create an API token](https://crates.io/settings/tokens), make sure +you copy it. Once you leave the page you will not be able to see it again. Then run the [`cargo login`] command. From 2a805f63e6f3b47437c04aad83ef87d14a911285 Mon Sep 17 00:00:00 2001 From: Luca Barbato <lu_zero@gentoo.org> Date: Sat, 22 Apr 2023 13:24:59 +0200 Subject: [PATCH 040/104] Add the Win32_System_Console feature since it is used --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 99a71418856..aa456912901 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,6 +99,7 @@ version = "0.45" features = [ "Win32_Foundation", "Win32_Storage_FileSystem", + "Win32_System_Console", "Win32_System_IO", "Win32_System_Threading", "Win32_System_JobObjects", From 4a070dbd68203e83062f9f84eab3e974a6d898e5 Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Sun, 23 Apr 2023 11:51:43 -0700 Subject: [PATCH 041/104] Bump versions of local crates --- Cargo.lock | 12 ++++++------ Cargo.toml | 4 ++-- crates/cargo-platform/Cargo.toml | 2 +- crates/crates-io/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fbc74b851a3..4326d08b7a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -243,7 +243,7 @@ dependencies = [ "anyhow", "base64", "bytesize", - "cargo-platform 0.1.2", + "cargo-platform 0.1.3", "cargo-test-macro", "cargo-test-support", "cargo-util", @@ -348,15 +348,15 @@ dependencies = [ [[package]] name = "cargo-platform" version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +version = "0.1.3" dependencies = [ "serde", ] @@ -418,7 +418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", - "cargo-platform 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo-platform 0.1.2", "semver", "serde", "serde_json", @@ -548,7 +548,7 @@ dependencies = [ [[package]] name = "crates-io" -version = "0.36.0" +version = "0.36.1" dependencies = [ "anyhow", "curl", diff --git a/Cargo.toml b/Cargo.toml index aa456912901..c32b2d66731 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,10 +31,10 @@ path = "src/cargo/lib.rs" anyhow = "1.0.47" base64 = "0.21.0" bytesize = "1.0" -cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" } +cargo-platform = { path = "crates/cargo-platform", version = "0.1.3" } cargo-util = { path = "crates/cargo-util", version = "0.2.4" } clap = { version = "4.2.0", features = ["wrap_help"] } -crates-io = { path = "crates/crates-io", version = "0.36.0" } +crates-io = { path = "crates/crates-io", version = "0.36.1" } curl = { version = "0.4.44", features = ["http2"] } curl-sys = "0.4.61" env_logger = "0.10.0" diff --git a/crates/cargo-platform/Cargo.toml b/crates/cargo-platform/Cargo.toml index a5e51ee5de3..69a4e552ca2 100644 --- a/crates/cargo-platform/Cargo.toml +++ b/crates/cargo-platform/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" diff --git a/crates/crates-io/Cargo.toml b/crates/crates-io/Cargo.toml index 004e2daff9e..6a401294672 100644 --- a/crates/crates-io/Cargo.toml +++ b/crates/crates-io/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crates-io" -version = "0.36.0" +version = "0.36.1" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cargo" From 9deb9e7670ff362ccab674c9e079dca230a9a2de Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Sun, 23 Apr 2023 11:56:32 -0700 Subject: [PATCH 042/104] Remove wrong url in benchsuite manifest. --- benches/benchsuite/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/benches/benchsuite/Cargo.toml b/benches/benchsuite/Cargo.toml index f4bc3583a25..fba6f63cd91 100644 --- a/benches/benchsuite/Cargo.toml +++ b/benches/benchsuite/Cargo.toml @@ -5,7 +5,6 @@ edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" -documentation = "https://docs.rs/cargo-platform" description = "Benchmarking suite for Cargo." [dependencies] From cf49e4ac1da989b3822ab35e53740cf4cd8e44ed Mon Sep 17 00:00:00 2001 From: hi-rustin <rustin.liu@gmail.com> Date: Thu, 20 Apr 2023 09:32:24 +0800 Subject: [PATCH 043/104] Improve error message for empty dep Signed-off-by: hi-rustin <rustin.liu@gmail.com> --- src/cargo/util/toml/mod.rs | 4 ++-- tests/testsuite/bad_config.rs | 4 ++-- tests/testsuite/inheritable_workspace_fields.rs | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index a28b8240ae7..7b8c916cc65 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -2997,8 +2997,8 @@ impl<P: ResolveToPath + Clone> DetailedTomlDependency<P> { if self.version.is_none() && self.path.is_none() && self.git.is_none() { let msg = format!( "dependency ({}) specified without \ - providing a local path, Git repository, or \ - version to use. This will be considered an \ + providing a local path, Git repository, version, or \ + workspace dependency to use. This will be considered an \ error in future versions", name_in_toml ); diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs index 2d3242837ff..4434ea90da1 100644 --- a/tests/testsuite/bad_config.rs +++ b/tests/testsuite/bad_config.rs @@ -780,8 +780,8 @@ fn empty_dependencies() { p.cargo("check") .with_stderr_contains( "\ -warning: dependency (bar) specified without providing a local path, Git repository, or version \ -to use. This will be considered an error in future versions +warning: dependency (bar) specified without providing a local path, Git repository, version, \ +or workspace dependency to use. This will be considered an error in future versions ", ) .run(); diff --git a/tests/testsuite/inheritable_workspace_fields.rs b/tests/testsuite/inheritable_workspace_fields.rs index 92c96b985a5..d63437260fb 100644 --- a/tests/testsuite/inheritable_workspace_fields.rs +++ b/tests/testsuite/inheritable_workspace_fields.rs @@ -1269,7 +1269,9 @@ fn error_workspace_dependency_looked_for_workspace_itself() { .with_stderr( "\ [WARNING] [CWD]/Cargo.toml: unused manifest key: workspace.dependencies.dep.workspace -[WARNING] [CWD]/Cargo.toml: dependency (dep) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions +[WARNING] [CWD]/Cargo.toml: dependency (dep) specified without providing a local path, Git repository, version, \ +or workspace dependency to use. \ +This will be considered an error in future versions [UPDATING] `dummy-registry` index [ERROR] no matching package named `dep` found location searched: registry `crates-io` @@ -1589,7 +1591,9 @@ fn cannot_inherit_in_patch() { .with_stderr( "\ [WARNING] [CWD]/Cargo.toml: unused manifest key: patch.crates-io.bar.workspace -[WARNING] [CWD]/Cargo.toml: dependency (bar) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions +[WARNING] [CWD]/Cargo.toml: dependency (bar) specified without providing a local path, Git repository, version, \ +or workspace dependency to use. \ +This will be considered an error in future versions [UPDATING] `dummy-registry` index [ERROR] failed to resolve patches for `https://github.com/rust-lang/crates.io-index` From c162f5d233c0c50258df263d23100396b3737bc5 Mon Sep 17 00:00:00 2001 From: WANG Rui <wangrui@loongson.cn> Date: Thu, 20 Apr 2023 23:10:00 +0800 Subject: [PATCH 044/104] Update openssl-src to 111.25.3+1.1.1t Adds support for LoongArch. --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4326d08b7a0..597ad8e5099 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2162,9 +2162,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "111.25.2+1.1.1t" +version = "111.25.3+1.1.1t" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320708a054ad9b3bf314688b5db87cf4d6683d64cfc835e2337924ae62bf4431" +checksum = "924757a6a226bf60da5f7dd0311a34d2b52283dd82ddeb103208ddc66362f80c" dependencies = [ "cc", ] From 3027275b6fc5459ecb16a0457ff0eda7cd8eb089 Mon Sep 17 00:00:00 2001 From: Qiu Chaofan <qiucofan@cn.ibm.com> Date: Fri, 21 Apr 2023 18:01:52 +0800 Subject: [PATCH 045/104] Bump libc to 0.2.142 --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 597ad8e5099..8b09aa2462f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1892,9 +1892,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.141" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" [[package]] name = "libgit2-sys" From 3313a338abf9a02b1efe8380c2fec64898b30b3c Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Sun, 23 Apr 2023 12:39:27 -0700 Subject: [PATCH 046/104] Update windows-sys --- Cargo.lock | 22 +++++++++---------- Cargo.toml | 2 +- crates/cargo-test-support/Cargo.toml | 2 +- crates/cargo-util/Cargo.toml | 2 +- crates/home/CHANGELOG.md | 7 ++++-- crates/home/Cargo.toml | 4 ++-- crates/home/src/lib.rs | 2 +- .../cargo-credential-wincred/Cargo.toml | 2 +- src/cargo/core/shell.rs | 2 +- 9 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b09aa2462f..e774b5db0ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,7 +262,7 @@ dependencies = [ "glob", "hex", "hmac", - "home 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "home 0.5.4", "http-auth", "humantime 2.1.0", "ignore", @@ -305,7 +305,7 @@ dependencies = [ "unicode-xid", "url", "walkdir", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -342,7 +342,7 @@ name = "cargo-credential-wincred" version = "0.2.0" dependencies = [ "cargo-credential", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -388,7 +388,7 @@ dependencies = [ "time", "toml", "url", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -408,7 +408,7 @@ dependencies = [ "shell-escape", "tempfile", "walkdir", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1546,7 +1546,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "home 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "home 0.5.4", "thiserror", "url", ] @@ -1693,17 +1693,17 @@ dependencies = [ [[package]] name = "home" version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" dependencies = [ - "windows-sys 0.45.0", + "winapi", ] [[package]] name = "home" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +version = "0.5.5" dependencies = [ - "winapi", + "windows-sys 0.48.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c32b2d66731..54e2aaec130 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,7 @@ openssl = { version = "0.10.50", optional = true } fwdansi = "1.1.0" [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.45" +version = "0.48" features = [ "Win32_Foundation", "Win32_Storage_FileSystem", diff --git a/crates/cargo-test-support/Cargo.toml b/crates/cargo-test-support/Cargo.toml index 91e6e4e34c1..a3a83148b36 100644 --- a/crates/cargo-test-support/Cargo.toml +++ b/crates/cargo-test-support/Cargo.toml @@ -29,4 +29,4 @@ toml = "0.7.0" url = "2.2.2" [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.45.0", features = ["Win32_Storage_FileSystem"] } +windows-sys = { version = "0.48.0", features = ["Win32_Storage_FileSystem"] } diff --git a/crates/cargo-util/Cargo.toml b/crates/cargo-util/Cargo.toml index 7427ceb1a8e..9ee935ca1a2 100644 --- a/crates/cargo-util/Cargo.toml +++ b/crates/cargo-util/Cargo.toml @@ -25,4 +25,4 @@ core-foundation = { version = "0.9.0", features = ["mac_os_10_7_support"] } [target.'cfg(windows)'.dependencies] miow = "0.5.0" -windows-sys = { version = "0.45.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_Console"] } +windows-sys = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_Console"] } diff --git a/crates/home/CHANGELOG.md b/crates/home/CHANGELOG.md index 7674667c991..0ceed6bcd8c 100644 --- a/crates/home/CHANGELOG.md +++ b/crates/home/CHANGELOG.md @@ -4,7 +4,11 @@ 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). -<!-- ## [Unreleased] --> +## Unreleased +- The `home` crate has migrated to the <https://github.com/rust-lang/cargo/> repository. + [#11359](https://github.com/rust-lang/cargo/pull/11359) +- Replaced the winapi dependency with windows-sys. + [#11656](https://github.com/rust-lang/cargo/pull/11656) ## [0.5.4] - 2022-10-10 - Add `_with_env` variants of functions to support in-process threaded tests for @@ -38,7 +42,6 @@ Use Rust 1.36.0 as minimum Rust version. ### Removed - Remove support for `multirust` folder used in old version of `rustup`. -[Unreleased]: https://github.com/brson/home/compare/v0.5.4...HEAD [0.5.4]: https://github.com/brson/home/compare/v0.5.3...v0.5.4 [0.5.3]: https://github.com/brson/home/compare/v0.5.2...v0.5.3 [0.5.2]: https://github.com/brson/home/compare/v0.5.1...v0.5.2 diff --git a/crates/home/Cargo.toml b/crates/home/Cargo.toml index 2c5b92bcbb6..90211c28d78 100644 --- a/crates/home/Cargo.toml +++ b/crates/home/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "home" -version = "0.5.4" # also update `html_root_url` in `src/lib.rs` +version = "0.5.5" # also update `html_root_url` in `src/lib.rs` authors = ["Brian Anderson <andersrb@gmail.com>"] documentation = "https://docs.rs/home" edition = "2018" @@ -17,4 +17,4 @@ repository = "https://github.com/rust-lang/cargo" description = "Shared definitions of home directories." [target.'cfg(windows)'.dependencies] -windows-sys = { version = "0.45.0", features = ["Win32_Foundation", "Win32_UI_Shell"] } +windows-sys = { version = "0.48.0", features = ["Win32_Foundation", "Win32_UI_Shell"] } diff --git a/crates/home/src/lib.rs b/crates/home/src/lib.rs index 306026e4010..a8af963f34e 100644 --- a/crates/home/src/lib.rs +++ b/crates/home/src/lib.rs @@ -25,7 +25,7 @@ //! //! [discussion]: https://github.com/rust-lang/rust/pull/46799#issuecomment-361156935 -#![doc(html_root_url = "https://docs.rs/home/0.5.4")] +#![doc(html_root_url = "https://docs.rs/home/0.5.5")] #![deny(rust_2018_idioms)] pub mod env; diff --git a/credential/cargo-credential-wincred/Cargo.toml b/credential/cargo-credential-wincred/Cargo.toml index 83c38e80dbb..64f3496383a 100644 --- a/credential/cargo-credential-wincred/Cargo.toml +++ b/credential/cargo-credential-wincred/Cargo.toml @@ -8,4 +8,4 @@ description = "A Cargo credential process that stores tokens with Windows Creden [dependencies] cargo-credential = { version = "0.2.0", path = "../cargo-credential" } -windows-sys = { version = "0.45", features = ["Win32_Foundation", "Win32_Security_Credentials"] } +windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_Security_Credentials"] } diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs index fdae617c4f8..f74bde257d6 100644 --- a/src/cargo/core/shell.rs +++ b/src/cargo/core/shell.rs @@ -563,13 +563,13 @@ mod imp { use windows_sys::core::PCSTR; use windows_sys::Win32::Foundation::CloseHandle; use windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE; + use windows_sys::Win32::Foundation::{GENERIC_READ, GENERIC_WRITE}; use windows_sys::Win32::Storage::FileSystem::{ CreateFileA, FILE_SHARE_READ, FILE_SHARE_WRITE, OPEN_EXISTING, }; use windows_sys::Win32::System::Console::{ GetConsoleScreenBufferInfo, GetStdHandle, CONSOLE_SCREEN_BUFFER_INFO, STD_ERROR_HANDLE, }; - use windows_sys::Win32::System::SystemServices::{GENERIC_READ, GENERIC_WRITE}; pub(super) use super::{default_err_erase_line as err_erase_line, TtyWidth}; From f59ab5919d5d9f81729d56bdce865da636777ea8 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 12:29:21 +0100 Subject: [PATCH 047/104] ci: requires `test_gitoxide` and `lockfile` for both bors success and failure --- .github/workflows/main.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 303082018d5..89eed458370 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -206,7 +206,14 @@ jobs: permissions: contents: none name: bors build finished - needs: [docs, rustfmt, test, resolver, build_std, test_gitoxide] + needs: + - build_std + - docs + - lockfile + - resolver + - rustfmt + - test + - test_gitoxide runs-on: ubuntu-latest if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'" steps: @@ -215,7 +222,14 @@ jobs: permissions: contents: none name: bors build finished - needs: [docs, rustfmt, test, resolver, build_std] + needs: + - build_std + - docs + - lockfile + - resolver + - rustfmt + - test + - test_gitoxide runs-on: ubuntu-latest if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'" steps: From bc2001aebe18955aab3817e31f2dfff109ca5b71 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 12:20:35 +0100 Subject: [PATCH 048/104] ci: unnecessary `--manifest-path` against resolver-tests --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89eed458370..d9e1035ee74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,6 @@ jobs: - run: rustup update stable && rustup default stable - run: rustup component add rustfmt - run: cargo fmt --all --check - - run: cargo fmt --all --check --manifest-path crates/resolver-tests/Cargo.toml # Ensure there are no clippy warnings clippy: @@ -152,7 +151,7 @@ jobs: steps: - uses: actions/checkout@v3 - run: rustup update stable && rustup default stable - - run: cargo test --manifest-path crates/resolver-tests/Cargo.toml + - run: cargo test -p resolver-tests test_gitoxide: runs-on: ubuntu-latest From c18698141fc3c57e475262224a3296162ff26841 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 13:56:58 +0100 Subject: [PATCH 049/104] ci: unnecessary `--manifest-path` in build-man.sh --- src/doc/build-man.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/build-man.sh b/src/doc/build-man.sh index 7b1330b58f7..77af5b510d1 100755 --- a/src/doc/build-man.sh +++ b/src/doc/build-man.sh @@ -18,14 +18,14 @@ OPTIONS="--url https://doc.rust-lang.org/cargo/commands/ \ --man rustc:1=https://doc.rust-lang.org/rustc/index.html \ --man rustdoc:1=https://doc.rust-lang.org/rustdoc/index.html" -cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \ +cargo run -p mdman -- \ -t md -o src/commands man/cargo*.md \ $OPTIONS -cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \ +cargo run -p mdman -- \ -t txt -o man/generated_txt man/cargo*.md \ $OPTIONS -cargo run --manifest-path=../../crates/mdman/Cargo.toml -- \ +cargo run -p mdman -- \ -t man -o ../etc/man man/cargo*.md \ $OPTIONS From d6a53ba809cfd38188c7f32f253800f41de8d6f3 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 14:48:06 +0100 Subject: [PATCH 050/104] chore: make credential dependencies platform-specific --- credential/cargo-credential-macos-keychain/Cargo.toml | 2 ++ credential/cargo-credential-wincred/Cargo.toml | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/credential/cargo-credential-macos-keychain/Cargo.toml b/credential/cargo-credential-macos-keychain/Cargo.toml index c2c22a425ae..428e291002e 100644 --- a/credential/cargo-credential-macos-keychain/Cargo.toml +++ b/credential/cargo-credential-macos-keychain/Cargo.toml @@ -8,4 +8,6 @@ description = "A Cargo credential process that stores tokens in a macOS keychain [dependencies] cargo-credential = { version = "0.2.0", path = "../cargo-credential" } + +[target.'cfg(target_os = "macos")'.dependencies] security-framework = "2.0.0" diff --git a/credential/cargo-credential-wincred/Cargo.toml b/credential/cargo-credential-wincred/Cargo.toml index 64f3496383a..81325346690 100644 --- a/credential/cargo-credential-wincred/Cargo.toml +++ b/credential/cargo-credential-wincred/Cargo.toml @@ -8,4 +8,10 @@ description = "A Cargo credential process that stores tokens with Windows Creden [dependencies] cargo-credential = { version = "0.2.0", path = "../cargo-credential" } -windows-sys = { version = "0.48", features = ["Win32_Foundation", "Win32_Security_Credentials"] } + +[target.'cfg(windows)'.dependencies.windows-sys] +version = "0.48" +features = [ + "Win32_Foundation", + "Win32_Security_Credentials" +] From 30e3ea393be167309a820d031777451ff7874e18 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 13:43:24 +0100 Subject: [PATCH 051/104] ci: remove unnecessary condition for building cargo-credential-* --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9e1035ee74..d67487aab4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -127,12 +127,10 @@ jobs: - run: cargo test -p home - run: cargo test -p mdman - run: cargo build -p cargo-credential-1password - - run: cargo build -p cargo-credential-gnome-secret - if: matrix.os == 'ubuntu-latest' - run: cargo build -p cargo-credential-macos-keychain - if: matrix.os == 'macos-latest' - run: cargo build -p cargo-credential-wincred - if: matrix.os == 'windows-latest' + - run: cargo build -p cargo-credential-gnome-secret + if: matrix.os == 'ubuntu-latest' - name: Check benchmarks run: | # This only tests one benchmark since it can take over 10 minutes to From 125ee25e9b1151391d61a77aa0b282152a70026e Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 13:42:48 +0100 Subject: [PATCH 052/104] ci: ensure intra links for all members are checked --- .github/workflows/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d67487aab4d..306e28b602d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -184,14 +184,15 @@ jobs: # This requires rustfmt, use stable. - name: Run semver-check run: cargo +stable run -p semver-check - - run: | + - name: Ensure intradoc links are valid + run: cargo doc --workspace --document-private-items --no-deps + env: + RUSTDOCFLAGS: -D warnings + - name: Install mdbook + run: | mkdir mdbook curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook echo `pwd`/mdbook >> $GITHUB_PATH - # TODO: should check all workspace members - - run: cargo doc -p cargo --document-private-items --no-deps - env: - RUSTDOCFLAGS: -D warnings - run: cd src/doc && mdbook build --dest-dir ../../target/doc - name: Run linkchecker.sh run: | From 8826cc42439ea12e73a9be4753a3226367cef04b Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 19:44:52 +0100 Subject: [PATCH 053/104] test: `[env]` isn't applied to target info discovery rustc --- tests/testsuite/cargo_env_config.rs | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/tests/testsuite/cargo_env_config.rs b/tests/testsuite/cargo_env_config.rs index d80c38d0e4b..bdcf0043083 100644 --- a/tests/testsuite/cargo_env_config.rs +++ b/tests/testsuite/cargo_env_config.rs @@ -1,5 +1,6 @@ //! Tests for `[env]` config. +use cargo_test_support::basic_manifest; use cargo_test_support::{basic_bin_manifest, project}; #[cargo_test] @@ -179,3 +180,63 @@ fn env_no_override() { .with_stdout_contains("CARGO_PKG_NAME:unchanged") .run(); } + +#[cargo_test] +fn env_applied_to_target_info_discovery_rustc() { + let wrapper = project() + .at("wrapper") + .file("Cargo.toml", &basic_manifest("wrapper", "1.0.0")) + .file( + "src/main.rs", + r#" + fn main() { + let mut args = std::env::args().skip(1); + let env_test = std::env::var("ENV_TEST").unwrap(); + eprintln!("WRAPPER ENV_TEST:{env_test}"); + let status = std::process::Command::new(&args.next().unwrap()) + .args(args).status().unwrap(); + std::process::exit(status.code().unwrap_or(1)); + } + "#, + ) + .build(); + wrapper.cargo("build").run(); + let wrapper = &wrapper.bin("wrapper"); + + let p = project() + .file("Cargo.toml", &basic_bin_manifest("foo")) + .file( + "src/main.rs", + r#" + fn main() { + eprintln!( "MAIN ENV_TEST:{}", std::env!("ENV_TEST") ); + } + "#, + ) + .file( + ".cargo/config", + r#" + [env] + ENV_TEST = "from-config" + "#, + ) + .build(); + + p.cargo("run") + .env("RUSTC_WORKSPACE_WRAPPER", wrapper) + .with_stderr_contains("error: failed to run `rustc` to learn about target-specific information") + .with_stderr_contains("[..]thread '[..]' panicked at [..]unwrap[..]") // env::var().unwrap() + .with_stderr_does_not_contain("WRAPPER ENV_TEST:from-config") + .with_stderr_does_not_contain("MAIN ENV_TEST:from-config") + .with_status(101) + .run(); + + // Ensure wrapper also maintains the same overridden priority for envs. + p.cargo("clean").run(); + p.cargo("run") + .env("ENV_TEST", "from-env") + .env("RUSTC_WORKSPACE_WRAPPER", wrapper) + .with_stderr_contains("WRAPPER ENV_TEST:from-env") + .with_stderr_contains("MAIN ENV_TEST:from-env") + .run(); +} From 671954765ce370a4e51eaea5ca42f83271f57f1f Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Mon, 24 Apr 2023 18:59:01 +0100 Subject: [PATCH 054/104] fix: apply `[env]` to target info discovery rustc --- .../core/compiler/build_context/target_info.rs | 2 ++ src/cargo/core/compiler/compilation.rs | 15 +++------------ src/cargo/core/compiler/mod.rs | 15 +++++++++++++++ tests/testsuite/cargo_env_config.rs | 7 ++----- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index bf8bb157877..d134524e6c4 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -7,6 +7,7 @@ //! * [`RustcTargetData::info`] to get a [`TargetInfo`] for an in-depth query. //! * [`TargetInfo::rustc_outputs`] to get a list of supported file types. +use crate::core::compiler::apply_env_config; use crate::core::compiler::{ BuildOutput, CompileKind, CompileMode, CompileTarget, Context, CrateType, }; @@ -175,6 +176,7 @@ impl TargetInfo { // // Search `--print` to see what we query so far. let mut process = rustc.workspace_process(); + apply_env_config(config, &mut process)?; process .arg("-") .arg("--crate-name") diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs index 29642f13d79..b263119b039 100644 --- a/src/cargo/core/compiler/compilation.rs +++ b/src/cargo/core/compiler/compilation.rs @@ -7,7 +7,8 @@ use std::path::PathBuf; use cargo_platform::CfgExpr; use cargo_util::{paths, ProcessBuilder}; -use super::BuildContext; +use crate::core::compiler::apply_env_config; +use crate::core::compiler::BuildContext; use crate::core::compiler::{CompileKind, Metadata, Unit}; use crate::core::Package; use crate::util::{config, CargoResult, Config}; @@ -349,17 +350,7 @@ impl<'cfg> Compilation<'cfg> { ) .cwd(pkg.root()); - // Apply any environment variables from the config - for (key, value) in self.config.env_config()?.iter() { - // never override a value that has already been set by cargo - if cmd.get_envs().contains_key(key) { - continue; - } - - if value.is_force() || self.config.get_env_os(key).is_none() { - cmd.env(key, value.resolve(self.config)); - } - } + apply_env_config(self.config, &mut cmd)?; Ok(cmd) } diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs index 1c37cc1aa17..0af59049c24 100644 --- a/src/cargo/core/compiler/mod.rs +++ b/src/cargo/core/compiler/mod.rs @@ -1805,3 +1805,18 @@ fn descriptive_pkg_name(name: &str, target: &Target, mode: &CompileMode) -> Stri }; format!("`{name}` ({desc_name}{mode})") } + +/// Applies environment variables from config `[env]` to [`ProcessBuilder`]. +fn apply_env_config(config: &crate::Config, cmd: &mut ProcessBuilder) -> CargoResult<()> { + for (key, value) in config.env_config()?.iter() { + // never override a value that has already been set by cargo + if cmd.get_envs().contains_key(key) { + continue; + } + + if value.is_force() || config.get_env_os(key).is_none() { + cmd.env(key, value.resolve(config)); + } + } + Ok(()) +} diff --git a/tests/testsuite/cargo_env_config.rs b/tests/testsuite/cargo_env_config.rs index bdcf0043083..0b787bebd3c 100644 --- a/tests/testsuite/cargo_env_config.rs +++ b/tests/testsuite/cargo_env_config.rs @@ -224,11 +224,8 @@ fn env_applied_to_target_info_discovery_rustc() { p.cargo("run") .env("RUSTC_WORKSPACE_WRAPPER", wrapper) - .with_stderr_contains("error: failed to run `rustc` to learn about target-specific information") - .with_stderr_contains("[..]thread '[..]' panicked at [..]unwrap[..]") // env::var().unwrap() - .with_stderr_does_not_contain("WRAPPER ENV_TEST:from-config") - .with_stderr_does_not_contain("MAIN ENV_TEST:from-config") - .with_status(101) + .with_stderr_contains("WRAPPER ENV_TEST:from-config") + .with_stderr_contains("MAIN ENV_TEST:from-config") .run(); // Ensure wrapper also maintains the same overridden priority for envs. From 54dceead51c1a2d48734d97cc0304508564a83c0 Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Mon, 24 Apr 2023 20:19:15 -0700 Subject: [PATCH 055/104] Clarify documentation around test target setting. There was some confusion about the wording in this section regarding what happens with an example's `main` function. This tries to be more explicit to clarify what happens when an example is marked as a test. This also adds a few other clarifications and a link to the reference documentation. Closes #11528 --- src/doc/man/cargo-bench.md | 12 +++++++++--- src/doc/man/cargo-test.md | 11 +++++++++-- src/doc/man/generated_txt/cargo-bench.txt | 15 +++++++++++---- src/doc/man/generated_txt/cargo-test.txt | 17 +++++++++++++---- src/doc/src/commands/cargo-bench.md | 12 +++++++++--- src/doc/src/commands/cargo-test.md | 11 +++++++++-- src/etc/man/cargo-bench.1 | 12 +++++++++--- src/etc/man/cargo-test.1 | 11 +++++++++-- 8 files changed, 78 insertions(+), 23 deletions(-) diff --git a/src/doc/man/cargo-bench.md b/src/doc/man/cargo-bench.md index 80785891b5b..18771c3d21e 100644 --- a/src/doc/man/cargo-bench.md +++ b/src/doc/man/cargo-bench.md @@ -86,11 +86,17 @@ following targets of the selected packages: The default behavior can be changed by setting the `bench` flag for the target in the manifest settings. Setting examples to `bench = true` will build and -run the example as a benchmark. Setting targets to `bench = false` will stop -them from being benchmarked by default. Target selection options that take a -target by name ignore the `bench` flag and will always benchmark the given +run the example as a benchmark, replacing the example's `main` function with +the libtest harness. + +Setting targets to `bench = false` will stop them from being bencharmked by +default. Target selection options that take a target by name (such as +`--example foo`) ignore the `bench` flag and will always benchmark the given target. +See [Configuring a target](../reference/cargo-targets.html#configuring-a-target) +for more information on per-target settings. + {{> options-targets-bin-auto-built }} {{> options-targets }} diff --git a/src/doc/man/cargo-test.md b/src/doc/man/cargo-test.md index 3dce146e60d..49792d6bec2 100644 --- a/src/doc/man/cargo-test.md +++ b/src/doc/man/cargo-test.md @@ -89,13 +89,20 @@ following targets of the selected packages: The default behavior can be changed by setting the `test` flag for the target in the manifest settings. Setting examples to `test = true` will build and run -the example as a test. Setting targets to `test = false` will stop them from -being tested by default. Target selection options that take a target by name +the example as a test, replacing the example's `main` function with the +libtest harness. If you don't want the `main` function replaced, also include +`harness = false`, in which case the example will be built and executed as-is. + +Setting targets to `test = false` will stop them from being tested by default. +Target selection options that take a target by name (such as `--example foo`) ignore the `test` flag and will always test the given target. Doc tests for libraries may be disabled by setting `doctest = false` for the library in the manifest. +See [Configuring a target](../reference/cargo-targets.html#configuring-a-target) +for more information on per-target settings. + {{> options-targets-bin-auto-built }} {{> options-targets }} diff --git a/src/doc/man/generated_txt/cargo-bench.txt b/src/doc/man/generated_txt/cargo-bench.txt index 1ca72d577af..9108d6165b3 100644 --- a/src/doc/man/generated_txt/cargo-bench.txt +++ b/src/doc/man/generated_txt/cargo-bench.txt @@ -120,10 +120,17 @@ OPTIONS The default behavior can be changed by setting the bench flag for the target in the manifest settings. Setting examples to bench = true will - build and run the example as a benchmark. Setting targets to bench = - false will stop them from being benchmarked by default. Target selection - options that take a target by name ignore the bench flag and will always - benchmark the given target. + build and run the example as a benchmark, replacing the example’s main + function with the libtest harness. + + Setting targets to bench = false will stop them from being bencharmked + by default. Target selection options that take a target by name (such as + --example foo) ignore the bench flag and will always benchmark the given + target. + + See Configuring a target + <https://doc.rust-lang.org/cargo/reference/cargo-targets.html#configuring-a-target> + for more information on per-target settings. Binary targets are automatically built if there is an integration test or benchmark being selected to benchmark. This allows an integration diff --git a/src/doc/man/generated_txt/cargo-test.txt b/src/doc/man/generated_txt/cargo-test.txt index 3f4ed607235..9e26f8aaeb9 100644 --- a/src/doc/man/generated_txt/cargo-test.txt +++ b/src/doc/man/generated_txt/cargo-test.txt @@ -128,14 +128,23 @@ OPTIONS The default behavior can be changed by setting the test flag for the target in the manifest settings. Setting examples to test = true will - build and run the example as a test. Setting targets to test = false - will stop them from being tested by default. Target selection options - that take a target by name ignore the test flag and will always test the - given target. + build and run the example as a test, replacing the example’s main + function with the libtest harness. If you don’t want the main function + replaced, also include harness = false, in which case the example will + be built and executed as-is. + + Setting targets to test = false will stop them from being tested by + default. Target selection options that take a target by name (such as + --example foo) ignore the test flag and will always test the given + target. Doc tests for libraries may be disabled by setting doctest = false for the library in the manifest. + See Configuring a target + <https://doc.rust-lang.org/cargo/reference/cargo-targets.html#configuring-a-target> + for more information on per-target settings. + Binary targets are automatically built if there is an integration test or benchmark being selected to test. This allows an integration test to execute the binary to exercise and test its behavior. The diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md index e7e9b36fb8f..df0101be5cf 100644 --- a/src/doc/src/commands/cargo-bench.md +++ b/src/doc/src/commands/cargo-bench.md @@ -143,11 +143,17 @@ following targets of the selected packages: The default behavior can be changed by setting the `bench` flag for the target in the manifest settings. Setting examples to `bench = true` will build and -run the example as a benchmark. Setting targets to `bench = false` will stop -them from being benchmarked by default. Target selection options that take a -target by name ignore the `bench` flag and will always benchmark the given +run the example as a benchmark, replacing the example's `main` function with +the libtest harness. + +Setting targets to `bench = false` will stop them from being bencharmked by +default. Target selection options that take a target by name (such as +`--example foo`) ignore the `bench` flag and will always benchmark the given target. +See [Configuring a target](../reference/cargo-targets.html#configuring-a-target) +for more information on per-target settings. + Binary targets are automatically built if there is an integration test or benchmark being selected to benchmark. This allows an integration test to execute the binary to exercise and test its behavior. diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md index 2967d7381e9..24fcc70ffa7 100644 --- a/src/doc/src/commands/cargo-test.md +++ b/src/doc/src/commands/cargo-test.md @@ -146,13 +146,20 @@ following targets of the selected packages: The default behavior can be changed by setting the `test` flag for the target in the manifest settings. Setting examples to `test = true` will build and run -the example as a test. Setting targets to `test = false` will stop them from -being tested by default. Target selection options that take a target by name +the example as a test, replacing the example's `main` function with the +libtest harness. If you don't want the `main` function replaced, also include +`harness = false`, in which case the example will be built and executed as-is. + +Setting targets to `test = false` will stop them from being tested by default. +Target selection options that take a target by name (such as `--example foo`) ignore the `test` flag and will always test the given target. Doc tests for libraries may be disabled by setting `doctest = false` for the library in the manifest. +See [Configuring a target](../reference/cargo-targets.html#configuring-a-target) +for more information on per-target settings. + Binary targets are automatically built if there is an integration test or benchmark being selected to test. This allows an integration test to execute the binary to exercise and test its behavior. diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1 index b95902c4ecf..44ff593fdd8 100644 --- a/src/etc/man/cargo-bench.1 +++ b/src/etc/man/cargo-bench.1 @@ -145,11 +145,17 @@ available) .sp The default behavior can be changed by setting the \fBbench\fR flag for the target in the manifest settings. Setting examples to \fBbench = true\fR will build and -run the example as a benchmark. Setting targets to \fBbench = false\fR will stop -them from being benchmarked by default. Target selection options that take a -target by name ignore the \fBbench\fR flag and will always benchmark the given +run the example as a benchmark, replacing the example\[cq]s \fBmain\fR function with +the libtest harness. +.sp +Setting targets to \fBbench = false\fR will stop them from being bencharmked by +default. Target selection options that take a target by name (such as +\fB\-\-example foo\fR) ignore the \fBbench\fR flag and will always benchmark the given target. .sp +See \fIConfiguring a target\fR <https://doc.rust\-lang.org/cargo/reference/cargo\-targets.html#configuring\-a\-target> +for more information on per\-target settings. +.sp Binary targets are automatically built if there is an integration test or benchmark being selected to benchmark. This allows an integration test to execute the binary to exercise and test its behavior. diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1 index 85260b067b0..1ee2f76727f 100644 --- a/src/etc/man/cargo-test.1 +++ b/src/etc/man/cargo-test.1 @@ -149,13 +149,20 @@ available) .sp The default behavior can be changed by setting the \fBtest\fR flag for the target in the manifest settings. Setting examples to \fBtest = true\fR will build and run -the example as a test. Setting targets to \fBtest = false\fR will stop them from -being tested by default. Target selection options that take a target by name +the example as a test, replacing the example\[cq]s \fBmain\fR function with the +libtest harness. If you don\[cq]t want the \fBmain\fR function replaced, also include +\fBharness = false\fR, in which case the example will be built and executed as\-is. +.sp +Setting targets to \fBtest = false\fR will stop them from being tested by default. +Target selection options that take a target by name (such as \fB\-\-example foo\fR) ignore the \fBtest\fR flag and will always test the given target. .sp Doc tests for libraries may be disabled by setting \fBdoctest = false\fR for the library in the manifest. .sp +See \fIConfiguring a target\fR <https://doc.rust\-lang.org/cargo/reference/cargo\-targets.html#configuring\-a\-target> +for more information on per\-target settings. +.sp Binary targets are automatically built if there is an integration test or benchmark being selected to test. This allows an integration test to execute the binary to exercise and test its behavior. From e2528e54f84e2046a541fb299f92ca5bf8ea7669 Mon Sep 17 00:00:00 2001 From: Kyle Matsuda <kyle.yoshio.matsuda@gmail.com> Date: Mon, 24 Apr 2023 23:10:06 -0600 Subject: [PATCH 056/104] failing tests on empty readme and license-path fields --- tests/testsuite/package.rs | 136 +++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index 14bac6618bd..0505f836300 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -1774,6 +1774,142 @@ fn exclude_dot_files_and_directories_by_default() { ); } +#[cargo_test] +fn empty_readme_path() { + // Warn but don't fail if `readme` is empty. + // Issue #11522. + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "1.0.0" + readme = "" + license = "MIT" + description = "foo" + homepage = "foo" + "#, + ) + .file("src/lib.rs", "") + .build(); + + p.cargo("package --no-verify") + .with_stderr( + "\ +[WARNING] readme `` does not appear to exist (relative to `[..]/foo`). +Please update the readme setting in the manifest at `[..]/foo/Cargo.toml` +This may become a hard error in the future. +[PACKAGING] foo v1.0.0 ([..]/foo) +[PACKAGED] [..] files, [..] ([..] compressed) +", + ) + .run(); +} + +#[cargo_test] +fn invalid_readme_path() { + // Warn but don't fail if `readme` path is invalid. + // Issue #11522. + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "1.0.0" + readme = "DOES-NOT-EXIST" + license = "MIT" + description = "foo" + homepage = "foo" + "#, + ) + .file("src/lib.rs", "") + .build(); + + p.cargo("package --no-verify") + .with_stderr( + "\ +[WARNING] readme `DOES-NOT-EXIST` does not appear to exist (relative to `[..]/foo`). +Please update the readme setting in the manifest at `[..]/foo/Cargo.toml` +This may become a hard error in the future. +[PACKAGING] foo v1.0.0 ([..]/foo) +[PACKAGED] [..] files, [..] ([..] compressed) +", + ) + .run(); +} + +#[cargo_test] +fn readme_or_license_file_is_dir() { + // Test warning when `readme` or `license-file` is a directory, not a file. + // Issue #11522. + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "1.0.0" + readme = "./src" + license-file = "./src" + description = "foo" + homepage = "foo" + "#, + ) + .file("src/lib.rs", "") + .build(); + + p.cargo("package --no-verify") + .with_stderr( + "\ +[WARNING] license-file `./src` does not appear to exist (relative to `[..]/foo`). +Please update the license-file setting in the manifest at `[..]/foo/Cargo.toml` +This may become a hard error in the future. +[WARNING] readme `./src` does not appear to exist (relative to `[..]/foo`). +Please update the readme setting in the manifest at `[..]/foo/Cargo.toml` +This may become a hard error in the future. +[PACKAGING] foo v1.0.0 ([..]/foo) +[PACKAGED] [..] files, [..] ([..] compressed) +", + ) + .run(); +} + +#[cargo_test] +fn empty_license_file_path() { + // Warn but don't fail if license-file is empty. + // Issue #11522. + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "1.0.0" + license-file = "" + description = "foo" + homepage = "foo" + "#, + ) + .file("src/lib.rs", "") + .build(); + + p.cargo("package --no-verify") + .with_stderr( + "\ +[WARNING] manifest has no license or license-file. +See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info. +[WARNING] license-file `` does not appear to exist (relative to `[..]/foo`). +Please update the license-file setting in the manifest at `[..]/foo/Cargo.toml` +This may become a hard error in the future. +[PACKAGING] foo v1.0.0 ([..]/foo) +[PACKAGED] [..] files, [..] ([..] compressed) +", + ) + .run(); +} + #[cargo_test] fn invalid_license_file_path() { // Test warning when license-file points to a non-existent file. From 24cbd8e5131afac02474abf710743147d95d50eb Mon Sep 17 00:00:00 2001 From: Kyle Matsuda <kyle.yoshio.matsuda@gmail.com> Date: Tue, 25 Apr 2023 11:09:45 -0600 Subject: [PATCH 057/104] check if readme and license-file point to files --- src/cargo/ops/cargo_package.rs | 41 +++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index 35b213361a2..b78d0292882 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -281,7 +281,7 @@ fn build_ar_list( if let Some(license_file) = &pkg.manifest().metadata().license_file { let license_path = Path::new(license_file); let abs_file_path = paths::normalize_path(&pkg.root().join(license_path)); - if abs_file_path.exists() { + if abs_file_path.is_file() { check_for_file_and_add( "license-file", license_path, @@ -291,26 +291,16 @@ fn build_ar_list( ws, )?; } else { - let rel_msg = if license_path.is_absolute() { - "".to_string() - } else { - format!(" (relative to `{}`)", pkg.root().display()) - }; - ws.config().shell().warn(&format!( - "license-file `{}` does not appear to exist{}.\n\ - Please update the license-file setting in the manifest at `{}`\n\ - This may become a hard error in the future.", - license_path.display(), - rel_msg, - pkg.manifest_path().display() - ))?; + warn_on_nonexistent_file(&pkg, &license_path, "license-file", &ws)?; } } if let Some(readme) = &pkg.manifest().metadata().readme { let readme_path = Path::new(readme); let abs_file_path = paths::normalize_path(&pkg.root().join(readme_path)); - if abs_file_path.exists() { + if abs_file_path.is_file() { check_for_file_and_add("readme", readme_path, abs_file_path, pkg, &mut result, ws)?; + } else { + warn_on_nonexistent_file(&pkg, &readme_path, "readme", &ws)?; } } result.sort_unstable_by(|a, b| a.rel_path.cmp(&b.rel_path)); @@ -369,6 +359,27 @@ fn check_for_file_and_add( Ok(()) } +fn warn_on_nonexistent_file( + pkg: &Package, + path: &Path, + manifest_key_name: &'static str, + ws: &Workspace<'_>, +) -> CargoResult<()> { + let rel_msg = if path.is_absolute() { + "".to_string() + } else { + format!(" (relative to `{}`)", pkg.root().display()) + }; + ws.config().shell().warn(&format!( + "{manifest_key_name} `{}` does not appear to exist{}.\n\ + Please update the {manifest_key_name} setting in the manifest at `{}`\n\ + This may become a hard error in the future.", + path.display(), + rel_msg, + pkg.manifest_path().display() + )) +} + /// Construct `Cargo.lock` for the package to be published. fn build_lock(ws: &Workspace<'_>, orig_pkg: &Package) -> CargoResult<String> { let config = ws.config(); From bb0682681a5957f8068950d2c0eb8899e5b726c0 Mon Sep 17 00:00:00 2001 From: Kyle Matsuda <kyle.yoshio.matsuda@gmail.com> Date: Tue, 25 Apr 2023 11:25:58 -0600 Subject: [PATCH 058/104] update the publish_with_missing_readme test with new warning --- tests/testsuite/publish.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index 00a79fe7362..bae940eb7a6 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -1756,6 +1756,9 @@ fn publish_with_missing_readme() { .with_stderr(&format!( "\ [UPDATING] [..] +[WARNING] readme `foo.md` does not appear to exist (relative to `[..]/foo`). +Please update the readme setting in the manifest at `[..]/foo/Cargo.toml` +This may become a hard error in the future. [PACKAGING] foo v0.1.0 [..] [PACKAGED] [..] files, [..] ([..] compressed) [UPLOADING] foo v0.1.0 [..] From 7bae738c03cf0568f3c84fab1a857f89848c32da Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Tue, 25 Apr 2023 11:38:52 -0700 Subject: [PATCH 059/104] Update home dependency --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- crates/home/CHANGELOG.md | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e774b5db0ba..6801df5da93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,7 +262,7 @@ dependencies = [ "glob", "hex", "hmac", - "home 0.5.4", + "home 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "http-auth", "humantime 2.1.0", "ignore", @@ -1546,7 +1546,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "home 0.5.4", + "home 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror", "url", ] @@ -1692,16 +1692,16 @@ dependencies = [ [[package]] name = "home" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +version = "0.5.5" dependencies = [ - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "home" version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ "windows-sys 0.48.0", ] diff --git a/Cargo.toml b/Cargo.toml index 54e2aaec130..b16a062fd69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ gix-features-for-configuration-only = { version = "0.28.0", package = "gix-featu glob = "0.3.0" hex = "0.4" hmac = "0.12.1" -home = "0.5" +home = "0.5.5" http-auth = { version = "0.1.6", default-features = false } humantime = "2.0.0" ignore = "0.4.7" diff --git a/crates/home/CHANGELOG.md b/crates/home/CHANGELOG.md index 0ceed6bcd8c..425632ad5d5 100644 --- a/crates/home/CHANGELOG.md +++ b/crates/home/CHANGELOG.md @@ -4,7 +4,7 @@ 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). -## Unreleased +## 0.5.5 - 2023-04-25 - The `home` crate has migrated to the <https://github.com/rust-lang/cargo/> repository. [#11359](https://github.com/rust-lang/cargo/pull/11359) - Replaced the winapi dependency with windows-sys. From fbd6cfd11f295f97c14f7eb45bf884ab1f6f2a14 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Wed, 26 Apr 2023 07:54:54 -0500 Subject: [PATCH 060/104] docs(ref): Specify 'rust_version' in Index format See rust-lang/crates.io#6267 --- src/doc/src/reference/registry-index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/doc/src/reference/registry-index.md b/src/doc/src/reference/registry-index.md index 38e3dd5fe6a..1b779c2772f 100644 --- a/src/doc/src/reference/registry-index.md +++ b/src/doc/src/reference/registry-index.md @@ -199,6 +199,9 @@ explaining the format of the entry. "features2": { "serde": ["dep:serde", "chrono?/serde"] } + // The minimal supported Rust version (optional) + // This must be a valid version requirement without an operator (e.g. no `=`) + "rust_version": "1.60" } ``` @@ -221,6 +224,9 @@ The JSON objects should not be modified after they are added except for the > * The publish API includes several other fields, such as `description` and `readme`, which don't appear in the index. > These are intended to make it easier for a registry to obtain the metadata about the crate to display on a website without needing to extract and parse the `.crate` file. > This additional information is typically added to a database on the registry server. +> * `rust_version` is not included. If a registry chooses to support this +> field, they must read it from the `Cargo.toml` contained in the `.crate` +> file. > > For [`cargo metadata`], the differences are: > From ce87a5173545615dca1d7cf9555e23b9064d59d6 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 25 Apr 2023 02:13:56 -0500 Subject: [PATCH 061/104] chore(xtask): Add xtask skeleton --- .cargo/config.toml | 2 ++ .gitignore | 1 - Cargo.lock | 4 ++++ crates/xtask/Cargo.toml | 7 +++++++ crates/xtask/src/main.rs | 3 +++ 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .cargo/config.toml create mode 100644 crates/xtask/Cargo.toml create mode 100644 crates/xtask/src/main.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000000..35049cbcb13 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[alias] +xtask = "run --package xtask --" diff --git a/.gitignore b/.gitignore index 8e162b0ff42..1cd9ebdfa4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ target Cargo.lock -.cargo /config.stamp /Makefile /config.mk diff --git a/Cargo.lock b/Cargo.lock index 6801df5da93..da7a0cfca37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3712,6 +3712,10 @@ dependencies = [ "memchr", ] +[[package]] +name = "xtask" +version = "0.0.0" + [[package]] name = "yansi" version = "0.5.1" diff --git a/crates/xtask/Cargo.toml b/crates/xtask/Cargo.toml new file mode 100644 index 00000000000..6b30eaa3d09 --- /dev/null +++ b/crates/xtask/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "xtask" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies] diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs new file mode 100644 index 00000000000..e7a11a969c0 --- /dev/null +++ b/crates/xtask/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} From cfb0db6e64699e6bf0ed5017a9edca5a8bd5f998 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 25 Apr 2023 02:33:47 -0500 Subject: [PATCH 062/104] chore(xtask): Add core cargo flags --- Cargo.lock | 6 ++++ crates/xtask/Cargo.toml | 4 +++ crates/xtask/src/main.rs | 14 +++++++- crates/xtask/src/xtask.rs | 69 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 crates/xtask/src/xtask.rs diff --git a/Cargo.lock b/Cargo.lock index da7a0cfca37..ee697e89cc9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3715,6 +3715,12 @@ dependencies = [ [[package]] name = "xtask" version = "0.0.0" +dependencies = [ + "anyhow", + "cargo", + "clap 4.2.1", + "env_logger 0.10.0", +] [[package]] name = "yansi" diff --git a/crates/xtask/Cargo.toml b/crates/xtask/Cargo.toml index 6b30eaa3d09..8af48c88cfa 100644 --- a/crates/xtask/Cargo.toml +++ b/crates/xtask/Cargo.toml @@ -5,3 +5,7 @@ edition = "2021" publish = false [dependencies] +anyhow = "1.0.47" +cargo = { version = "0.71.0", path = "../.." } +clap = "4.2.0" +env_logger = "0.10.0" diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index e7a11a969c0..1942a3621cf 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -1,3 +1,15 @@ +mod xtask; + fn main() { - println!("Hello, world!"); + env_logger::init_from_env("CARGO_LOG"); + let cli = xtask::cli(); + let matches = cli.get_matches(); + + let mut config = cargo::util::config::Config::default().unwrap_or_else(|e| { + let mut eval = cargo::core::shell::Shell::new(); + cargo::exit_with_error(e.into(), &mut eval) + }); + if let Err(e) = xtask::exec(&matches, &mut config) { + cargo::exit_with_error(e, &mut config.shell()) + } } diff --git a/crates/xtask/src/xtask.rs b/crates/xtask/src/xtask.rs new file mode 100644 index 00000000000..00541358b17 --- /dev/null +++ b/crates/xtask/src/xtask.rs @@ -0,0 +1,69 @@ +use cargo::util::command_prelude::*; + +pub fn cli() -> clap::Command { + clap::Command::new("xtask") + .arg( + opt( + "verbose", + "Use verbose output (-vv very verbose/build.rs output)", + ) + .short('v') + .action(ArgAction::Count) + .global(true), + ) + .arg_quiet() + .arg( + opt("color", "Coloring: auto, always, never") + .value_name("WHEN") + .global(true), + ) + .arg(flag("frozen", "Require Cargo.lock and cache are up to date").global(true)) + .arg(flag("locked", "Require Cargo.lock is up to date").global(true)) + .arg(flag("offline", "Run without accessing the network").global(true)) + .arg(multi_opt("config", "KEY=VALUE", "Override a configuration value").global(true)) + .arg( + Arg::new("unstable-features") + .help("Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details") + .short('Z') + .value_name("FLAG") + .action(ArgAction::Append) + .global(true), + ) +} + +pub fn exec(args: &clap::ArgMatches, config: &mut cargo::util::Config) -> cargo::CliResult { + config_configure(config, args)?; + + Ok(()) +} + +fn config_configure(config: &mut Config, args: &ArgMatches) -> CliResult { + let verbose = args.verbose(); + // quiet is unusual because it is redefined in some subcommands in order + // to provide custom help text. + let quiet = args.flag("quiet"); + let color = args.get_one::<String>("color").map(String::as_str); + let frozen = args.flag("frozen"); + let locked = args.flag("locked"); + let offline = args.flag("offline"); + let mut unstable_flags = vec![]; + if let Some(values) = args.get_many::<String>("unstable-features") { + unstable_flags.extend(values.cloned()); + } + let mut config_args = vec![]; + if let Some(values) = args.get_many::<String>("config") { + config_args.extend(values.cloned()); + } + config.configure( + verbose, + quiet, + color, + frozen, + locked, + offline, + &None, + &unstable_flags, + &config_args, + )?; + Ok(()) +} From 1c9ad4371583ba65b1faa1e989c2d6bcaf53c7f0 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Tue, 25 Apr 2023 03:06:46 -0500 Subject: [PATCH 063/104] feat(xtask): First pass at 'cargo xtask unpublished' --- Cargo.lock | 1 + crates/xtask/Cargo.toml | 3 +- crates/xtask/src/main.rs | 1 + crates/xtask/src/unpublished.rs | 86 +++++++++++++++++++++++++++++++++ crates/xtask/src/xtask.rs | 14 ++++++ 5 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 crates/xtask/src/unpublished.rs diff --git a/Cargo.lock b/Cargo.lock index ee697e89cc9..6f3fe46247d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3720,6 +3720,7 @@ dependencies = [ "cargo", "clap 4.2.1", "env_logger 0.10.0", + "log", ] [[package]] diff --git a/crates/xtask/Cargo.toml b/crates/xtask/Cargo.toml index 8af48c88cfa..ffe4cafbe37 100644 --- a/crates/xtask/Cargo.toml +++ b/crates/xtask/Cargo.toml @@ -6,6 +6,7 @@ publish = false [dependencies] anyhow = "1.0.47" -cargo = { version = "0.71.0", path = "../.." } +cargo = { path = "../.." } clap = "4.2.0" env_logger = "0.10.0" +log = "0.4.17" diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index 1942a3621cf..9edb3c3d72a 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -1,3 +1,4 @@ +mod unpublished; mod xtask; fn main() { diff --git a/crates/xtask/src/unpublished.rs b/crates/xtask/src/unpublished.rs new file mode 100644 index 00000000000..7c1f44af41d --- /dev/null +++ b/crates/xtask/src/unpublished.rs @@ -0,0 +1,86 @@ +use cargo::core::registry::PackageRegistry; +use cargo::core::QueryKind; +use cargo::core::Registry; +use cargo::core::SourceId; +use cargo::util::command_prelude::*; + +pub fn cli() -> clap::Command { + clap::Command::new("unpublished") +} + +pub fn exec(args: &clap::ArgMatches, config: &mut cargo::util::Config) -> cargo::CliResult { + let ws = args.workspace(config)?; + let mut results = Vec::new(); + { + let mut registry = PackageRegistry::new(config)?; + let _lock = config.acquire_package_cache_lock()?; + registry.lock_patches(); + let source_id = SourceId::crates_io(config)?; + + for member in ws.members() { + let name = member.name(); + let current = member.version(); + if member.publish() == &Some(vec![]) { + log::trace!("skipping {name}, `publish = false`"); + continue; + } + + let version_req = format!("<={current}"); + let query = cargo::core::dependency::Dependency::parse( + name, + Some(&version_req), + source_id.clone(), + )?; + let possibilities = loop { + // Exact to avoid returning all for path/git + match registry.query_vec(&query, QueryKind::Exact) { + std::task::Poll::Ready(res) => { + break res?; + } + std::task::Poll::Pending => registry.block_until_ready()?, + } + }; + if let Some(last) = possibilities.iter().map(|s| s.version()).max() { + if last != current { + results.push(( + name.to_string(), + Some(last.to_string()), + current.to_string(), + )); + } else { + log::trace!("{name} {current} is published"); + } + } else { + results.push((name.to_string(), None, current.to_string())); + } + } + } + + if !results.is_empty() { + results.insert( + 0, + ( + "name".to_owned(), + Some("published".to_owned()), + "current".to_owned(), + ), + ); + results.insert( + 1, + ( + "====".to_owned(), + Some("=========".to_owned()), + "=======".to_owned(), + ), + ); + } + for (name, last, current) in results { + if let Some(last) = last { + println!("{name} {last} {current}"); + } else { + println!("{name} - {current}"); + } + } + + Ok(()) +} diff --git a/crates/xtask/src/xtask.rs b/crates/xtask/src/xtask.rs index 00541358b17..1d6948fc7d7 100644 --- a/crates/xtask/src/xtask.rs +++ b/crates/xtask/src/xtask.rs @@ -2,6 +2,8 @@ use cargo::util::command_prelude::*; pub fn cli() -> clap::Command { clap::Command::new("xtask") + .subcommand_required(true) + .arg_required_else_help(true) .arg( opt( "verbose", @@ -29,11 +31,18 @@ pub fn cli() -> clap::Command { .action(ArgAction::Append) .global(true), ) + .subcommands([crate::unpublished::cli()]) } pub fn exec(args: &clap::ArgMatches, config: &mut cargo::util::Config) -> cargo::CliResult { config_configure(config, args)?; + match args.subcommand() { + Some(("unpublished", args)) => crate::unpublished::exec(args, config)?, + Some((name, _)) => unreachable!("clap enforces {name} to not exist"), + None => unreachable!("clap enforces a subcommand is present"), + } + Ok(()) } @@ -67,3 +76,8 @@ fn config_configure(config: &mut Config, args: &ArgMatches) -> CliResult { )?; Ok(()) } + +#[test] +fn verify_cli() { + cli().debug_assert(); +} From f05e7d5a1faedf54472ebc495e694d45e4f19e72 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Wed, 26 Apr 2023 11:18:51 -0500 Subject: [PATCH 064/104] perf(xtask): Split xtask binaries This will allow running an xtask without requiring building the world. In most cases, a user will already have been building cargo but not in CI. The packages keep an `xtask-` prefix to help raise awareness of them but exposed as `cargo <suffix>` to avoid having a direction proxy to wrap `cargo run -p xtask-<suffix>` as `cargo xtask <suffix>`. --- .cargo/config.toml | 2 +- Cargo.lock | 2 +- .../{xtask => xtask-unpublished}/Cargo.toml | 2 +- .../{xtask => xtask-unpublished}/src/main.rs | 1 - .../src/xtask.rs} | 73 +++++++++++++++- crates/xtask/src/xtask.rs | 83 ------------------- 6 files changed, 75 insertions(+), 88 deletions(-) rename crates/{xtask => xtask-unpublished}/Cargo.toml (86%) rename crates/{xtask => xtask-unpublished}/src/main.rs (96%) rename crates/{xtask/src/unpublished.rs => xtask-unpublished/src/xtask.rs} (53%) delete mode 100644 crates/xtask/src/xtask.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index 35049cbcb13..3cea81f34c5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [alias] -xtask = "run --package xtask --" +unpublished = "run --package xtask-unpublished --" diff --git a/Cargo.lock b/Cargo.lock index 6f3fe46247d..45c3598405b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3713,7 +3713,7 @@ dependencies = [ ] [[package]] -name = "xtask" +name = "xtask-unpublished" version = "0.0.0" dependencies = [ "anyhow", diff --git a/crates/xtask/Cargo.toml b/crates/xtask-unpublished/Cargo.toml similarity index 86% rename from crates/xtask/Cargo.toml rename to crates/xtask-unpublished/Cargo.toml index ffe4cafbe37..a7a85323f81 100644 --- a/crates/xtask/Cargo.toml +++ b/crates/xtask-unpublished/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "xtask" +name = "xtask-unpublished" version = "0.0.0" edition = "2021" publish = false diff --git a/crates/xtask/src/main.rs b/crates/xtask-unpublished/src/main.rs similarity index 96% rename from crates/xtask/src/main.rs rename to crates/xtask-unpublished/src/main.rs index 9edb3c3d72a..1942a3621cf 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask-unpublished/src/main.rs @@ -1,4 +1,3 @@ -mod unpublished; mod xtask; fn main() { diff --git a/crates/xtask/src/unpublished.rs b/crates/xtask-unpublished/src/xtask.rs similarity index 53% rename from crates/xtask/src/unpublished.rs rename to crates/xtask-unpublished/src/xtask.rs index 7c1f44af41d..095b483b7f1 100644 --- a/crates/xtask/src/unpublished.rs +++ b/crates/xtask-unpublished/src/xtask.rs @@ -5,10 +5,76 @@ use cargo::core::SourceId; use cargo::util::command_prelude::*; pub fn cli() -> clap::Command { - clap::Command::new("unpublished") + clap::Command::new("xtask-unpublished") + .arg( + opt( + "verbose", + "Use verbose output (-vv very verbose/build.rs output)", + ) + .short('v') + .action(ArgAction::Count) + .global(true), + ) + .arg_quiet() + .arg( + opt("color", "Coloring: auto, always, never") + .value_name("WHEN") + .global(true), + ) + .arg(flag("frozen", "Require Cargo.lock and cache are up to date").global(true)) + .arg(flag("locked", "Require Cargo.lock is up to date").global(true)) + .arg(flag("offline", "Run without accessing the network").global(true)) + .arg(multi_opt("config", "KEY=VALUE", "Override a configuration value").global(true)) + .arg( + Arg::new("unstable-features") + .help("Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details") + .short('Z') + .value_name("FLAG") + .action(ArgAction::Append) + .global(true), + ) } pub fn exec(args: &clap::ArgMatches, config: &mut cargo::util::Config) -> cargo::CliResult { + config_configure(config, args)?; + + unpublished(args, config)?; + + Ok(()) +} + +fn config_configure(config: &mut Config, args: &ArgMatches) -> CliResult { + let verbose = args.verbose(); + // quiet is unusual because it is redefined in some subcommands in order + // to provide custom help text. + let quiet = args.flag("quiet"); + let color = args.get_one::<String>("color").map(String::as_str); + let frozen = args.flag("frozen"); + let locked = args.flag("locked"); + let offline = args.flag("offline"); + let mut unstable_flags = vec![]; + if let Some(values) = args.get_many::<String>("unstable-features") { + unstable_flags.extend(values.cloned()); + } + let mut config_args = vec![]; + if let Some(values) = args.get_many::<String>("config") { + config_args.extend(values.cloned()); + } + config.configure( + verbose, + quiet, + color, + frozen, + locked, + offline, + &None, + &unstable_flags, + &config_args, + )?; + Ok(()) +} + +fn unpublished(args: &clap::ArgMatches, config: &mut cargo::util::Config) -> cargo::CliResult { let ws = args.workspace(config)?; let mut results = Vec::new(); { @@ -84,3 +150,8 @@ pub fn exec(args: &clap::ArgMatches, config: &mut cargo::util::Config) -> cargo: Ok(()) } + +#[test] +fn verify_cli() { + cli().debug_assert(); +} diff --git a/crates/xtask/src/xtask.rs b/crates/xtask/src/xtask.rs deleted file mode 100644 index 1d6948fc7d7..00000000000 --- a/crates/xtask/src/xtask.rs +++ /dev/null @@ -1,83 +0,0 @@ -use cargo::util::command_prelude::*; - -pub fn cli() -> clap::Command { - clap::Command::new("xtask") - .subcommand_required(true) - .arg_required_else_help(true) - .arg( - opt( - "verbose", - "Use verbose output (-vv very verbose/build.rs output)", - ) - .short('v') - .action(ArgAction::Count) - .global(true), - ) - .arg_quiet() - .arg( - opt("color", "Coloring: auto, always, never") - .value_name("WHEN") - .global(true), - ) - .arg(flag("frozen", "Require Cargo.lock and cache are up to date").global(true)) - .arg(flag("locked", "Require Cargo.lock is up to date").global(true)) - .arg(flag("offline", "Run without accessing the network").global(true)) - .arg(multi_opt("config", "KEY=VALUE", "Override a configuration value").global(true)) - .arg( - Arg::new("unstable-features") - .help("Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details") - .short('Z') - .value_name("FLAG") - .action(ArgAction::Append) - .global(true), - ) - .subcommands([crate::unpublished::cli()]) -} - -pub fn exec(args: &clap::ArgMatches, config: &mut cargo::util::Config) -> cargo::CliResult { - config_configure(config, args)?; - - match args.subcommand() { - Some(("unpublished", args)) => crate::unpublished::exec(args, config)?, - Some((name, _)) => unreachable!("clap enforces {name} to not exist"), - None => unreachable!("clap enforces a subcommand is present"), - } - - Ok(()) -} - -fn config_configure(config: &mut Config, args: &ArgMatches) -> CliResult { - let verbose = args.verbose(); - // quiet is unusual because it is redefined in some subcommands in order - // to provide custom help text. - let quiet = args.flag("quiet"); - let color = args.get_one::<String>("color").map(String::as_str); - let frozen = args.flag("frozen"); - let locked = args.flag("locked"); - let offline = args.flag("offline"); - let mut unstable_flags = vec![]; - if let Some(values) = args.get_many::<String>("unstable-features") { - unstable_flags.extend(values.cloned()); - } - let mut config_args = vec![]; - if let Some(values) = args.get_many::<String>("config") { - config_args.extend(values.cloned()); - } - config.configure( - verbose, - quiet, - color, - frozen, - locked, - offline, - &None, - &unstable_flags, - &config_args, - )?; - Ok(()) -} - -#[test] -fn verify_cli() { - cli().debug_assert(); -} From 249323b18ada7f785fdd0c8531a8e2abebd44645 Mon Sep 17 00:00:00 2001 From: cassaundra <cass@cassaundra.org> Date: Fri, 24 Mar 2023 13:46:59 -0700 Subject: [PATCH 065/104] Include rust-version in publish request crates.io reads rust-version from the tarball directly, but we can include it in the publish request for the sake of consistency for third-party registries. --- crates/crates-io/lib.rs | 1 + src/cargo/core/manifest.rs | 1 + src/cargo/ops/registry.rs | 2 ++ src/cargo/util/toml/mod.rs | 5 +++++ tests/testsuite/alt_registry.rs | 3 +++ tests/testsuite/artifact_dep.rs | 1 + tests/testsuite/features_namespaced.rs | 2 ++ tests/testsuite/inheritable_workspace_fields.rs | 5 +++++ tests/testsuite/publish.rs | 9 +++++++++ tests/testsuite/weak_dep_features.rs | 1 + 10 files changed, 30 insertions(+) diff --git a/crates/crates-io/lib.rs b/crates/crates-io/lib.rs index e0197568a6c..3d7608a2900 100644 --- a/crates/crates-io/lib.rs +++ b/crates/crates-io/lib.rs @@ -57,6 +57,7 @@ pub struct NewCrate { pub repository: Option<String>, pub badges: BTreeMap<String, BTreeMap<String, String>>, pub links: Option<String>, + pub rust_version: Option<String>, } #[derive(Serialize, Deserialize)] diff --git a/src/cargo/core/manifest.rs b/src/cargo/core/manifest.rs index 182882dad75..9f77b1301fb 100644 --- a/src/cargo/core/manifest.rs +++ b/src/cargo/core/manifest.rs @@ -110,6 +110,7 @@ pub struct ManifestMetadata { pub documentation: Option<String>, // URL pub badges: BTreeMap<String, BTreeMap<String, String>>, pub links: Option<String>, + pub rust_version: Option<String>, } #[derive(Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index e04f7ba2cff..cc15d47f56a 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -345,6 +345,7 @@ fn transmit( ref categories, ref badges, ref links, + ref rust_version, } = *manifest.metadata(); let readme_content = readme .as_ref() @@ -398,6 +399,7 @@ fn transmit( license_file: license_file.clone(), badges: badges.clone(), links: links.clone(), + rust_version: rust_version.clone(), }, tarball, ) diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 7b8c916cc65..12698b70310 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -2433,6 +2433,11 @@ impl TomlManifest { .transpose()? .unwrap_or_default(), links: package.links.clone(), + rust_version: package + .rust_version + .clone() + .map(|mw| mw.resolve("rust-version", || inherit()?.rust_version())) + .transpose()?, }; package.description = metadata .description diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs index 97da909b83c..e9dd0071e06 100644 --- a/tests/testsuite/alt_registry.rs +++ b/tests/testsuite/alt_registry.rs @@ -366,6 +366,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "repository": null, "homepage": null, "documentation": null, + "rust_version": null, "vers": "0.0.1" }"#, "foo-0.0.1.crate", @@ -515,6 +516,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "repository": null, "homepage": null, "documentation": null, + "rust_version": null, "vers": "0.0.1" }"#, "foo-0.0.1.crate", @@ -607,6 +609,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "repository": null, "homepage": null, "documentation": null, + "rust_version": null, "vers": "0.0.1" }"#, "foo-0.0.1.crate", diff --git a/tests/testsuite/artifact_dep.rs b/tests/testsuite/artifact_dep.rs index ec6bb7103a2..08e413bf511 100644 --- a/tests/testsuite/artifact_dep.rs +++ b/tests/testsuite/artifact_dep.rs @@ -1956,6 +1956,7 @@ You may press ctrl-c [..] "readme": null, "readme_file": null, "repository": "foo", + "rust_version": null, "vers": "0.1.0" } "#, diff --git a/tests/testsuite/features_namespaced.rs b/tests/testsuite/features_namespaced.rs index 8ec2fc2e35d..d090235d5ab 100644 --- a/tests/testsuite/features_namespaced.rs +++ b/tests/testsuite/features_namespaced.rs @@ -942,6 +942,7 @@ You may press ctrl-c [..] "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.1.0" } "#, @@ -1057,6 +1058,7 @@ You may press ctrl-c [..] "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.1.0" } "#, diff --git a/tests/testsuite/inheritable_workspace_fields.rs b/tests/testsuite/inheritable_workspace_fields.rs index d63437260fb..cc261a47f47 100644 --- a/tests/testsuite/inheritable_workspace_fields.rs +++ b/tests/testsuite/inheritable_workspace_fields.rs @@ -201,6 +201,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "readme": null, "readme_file": null, "repository": "https://github.com/example/example", + "rust_version": "1.60", "vers": "1.2.3" } "#, @@ -376,6 +377,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.2.0" } "#, @@ -503,6 +505,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.2.0" } "#, @@ -734,6 +737,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "readme": "README.md", "readme_file": "../README.md", "repository": "https://github.com/example/example", + "rust_version": "1.60", "vers": "1.2.3" } "#, @@ -917,6 +921,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.2.0" } "#, diff --git a/tests/testsuite/publish.rs b/tests/testsuite/publish.rs index bae940eb7a6..45b7c7da5ab 100644 --- a/tests/testsuite/publish.rs +++ b/tests/testsuite/publish.rs @@ -25,6 +25,7 @@ const CLEAN_FOO_JSON: &str = r#" "readme": null, "readme_file": null, "repository": "foo", + "rust_version": null, "vers": "0.0.1" } "#; @@ -49,6 +50,7 @@ fn validate_upload_foo() { "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.0.1" } "#, @@ -77,6 +79,7 @@ fn validate_upload_li() { "readme": null, "readme_file": null, "repository": null, + "rust_version": "1.69", "vers": "0.0.1" } "#, @@ -1270,6 +1273,7 @@ You may press ctrl-c [..] "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.0.1" } "#, @@ -1469,6 +1473,7 @@ You may press ctrl-c [..] "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.1.0" } "#, @@ -1581,6 +1586,7 @@ You may press ctrl-c [..] "readme": null, "readme_file": null, "repository": "foo", + "rust_version": null, "vers": "0.1.0" } "#, @@ -2049,6 +2055,7 @@ fn in_package_workspace() { [package] name = "li" version = "0.0.1" + rust-version = "1.69" description = "li" license = "MIT" "#, @@ -2151,6 +2158,7 @@ fn in_package_workspace_with_members_with_features_old() { [package] name = "li" version = "0.0.1" + rust-version = "1.69" description = "li" license = "MIT" "#, @@ -2246,6 +2254,7 @@ fn in_virtual_workspace_with_p() { [package] name = "li" version = "0.0.1" + rust-version = "1.69" description = "li" license = "MIT" "#, diff --git a/tests/testsuite/weak_dep_features.rs b/tests/testsuite/weak_dep_features.rs index ee91114df5f..6f7c035476a 100644 --- a/tests/testsuite/weak_dep_features.rs +++ b/tests/testsuite/weak_dep_features.rs @@ -601,6 +601,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. "readme": null, "readme_file": null, "repository": null, + "rust_version": null, "vers": "0.1.0" } "#, From 0618034792ef6c37de36318050f64efb1811a66a Mon Sep 17 00:00:00 2001 From: cassaundra <cass@cassaundra.org> Date: Wed, 26 Apr 2023 12:36:33 -0700 Subject: [PATCH 066/104] Update docs regarding rust_version in the publish API --- src/doc/src/reference/registry-index.md | 5 ++--- src/doc/src/reference/registry-web-api.md | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/doc/src/reference/registry-index.md b/src/doc/src/reference/registry-index.md index 1b779c2772f..9e5be3e5bf6 100644 --- a/src/doc/src/reference/registry-index.md +++ b/src/doc/src/reference/registry-index.md @@ -224,9 +224,8 @@ The JSON objects should not be modified after they are added except for the > * The publish API includes several other fields, such as `description` and `readme`, which don't appear in the index. > These are intended to make it easier for a registry to obtain the metadata about the crate to display on a website without needing to extract and parse the `.crate` file. > This additional information is typically added to a database on the registry server. -> * `rust_version` is not included. If a registry chooses to support this -> field, they must read it from the `Cargo.toml` contained in the `.crate` -> file. +> * Although `rust_version` is included here, [crates.io] will ignore this field +> and instead read it from the `Cargo.toml` contained in the `.crate` file. > > For [`cargo metadata`], the differences are: > diff --git a/src/doc/src/reference/registry-web-api.md b/src/doc/src/reference/registry-web-api.md index 147ababd54e..347eb7280b9 100644 --- a/src/doc/src/reference/registry-web-api.md +++ b/src/doc/src/reference/registry-web-api.md @@ -161,7 +161,10 @@ considered as an exhaustive list of restrictions [crates.io] imposes. }, // The `links` string value from the package's manifest, or null if not // specified. This field is optional and defaults to null. - "links": null + "links": null, + // The minimal supported Rust version (optional) + // This must be a valid version requirement without an operator (e.g. no `=`) + "rust_version": null } ``` From fe8dc1dec3c8f60af6ccd8ada93d277a375ecd43 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Wed, 26 Apr 2023 17:51:16 -0500 Subject: [PATCH 067/104] chore: Mark unpublished crates as such This is a follow up to #12039. This makes it easier for tools to report less irrelevant information. I did both `publish = false` and `version = "0.0.0"` to help draw attention to the fact that these crates are internal (inspired by a matklad post). I left `cargo-test-macro` and `cargo-test-support` in for my own personal bias of one day wanting to see those crates published... The only one removed that had previously been published was `mdman` but seeing as that was a `0.0.0`, I'm assuming that was a mistake or just reserving the name. Before: ```console $ cargo unpublished name published current ==== ========= ======= cargo-platform 0.1.2 0.1.3 cargo-test-macro - 0.1.0 cargo-test-support - 0.1.0 cargo-util 0.2.3 0.2.4 crates-io 0.36.0 0.36.1 mdman 0.0.0 0.1.0 resolver-tests - 0.1.0 cargo 0.70.1 0.72.0 semver-check - 0.1.0 cargo-credential 0.1.0 0.2.0 cargo-credential-1password 0.1.0 0.2.0 cargo-credential-gnome-secret 0.1.0 0.2.0 cargo-credential-macos-keychain 0.1.0 0.2.0 cargo-credential-wincred 0.1.0 0.2.0 benchsuite - 0.1.0 ``` After: ```console name published current ==== ========= ======= cargo-platform 0.1.2 0.1.3 cargo-test-macro - 0.1.0 cargo-test-support - 0.1.0 cargo-util 0.2.3 0.2.4 crates-io 0.36.0 0.36.1 cargo 0.70.1 0.72.0 cargo-credential 0.1.0 0.2.0 cargo-credential-1password 0.1.0 0.2.0 cargo-credential-gnome-secret 0.1.0 0.2.0 cargo-credential-macos-keychain 0.1.0 0.2.0 cargo-credential-wincred 0.1.0 0.2.0 ``` --- Cargo.lock | 8 ++++---- benches/benchsuite/Cargo.toml | 3 ++- crates/mdman/Cargo.toml | 3 ++- crates/resolver-tests/Cargo.toml | 3 ++- crates/semver-check/Cargo.toml | 3 ++- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 45c3598405b..46188d1606c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,7 +124,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "benchsuite" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cargo", "criterion", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "mdman" -version = "0.1.0" +version = "0.0.0" dependencies = [ "anyhow", "handlebars", @@ -2639,7 +2639,7 @@ dependencies = [ [[package]] name = "resolver-tests" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cargo", "cargo-util", @@ -2781,7 +2781,7 @@ dependencies = [ [[package]] name = "semver-check" -version = "0.1.0" +version = "0.0.0" dependencies = [ "tempfile", ] diff --git a/benches/benchsuite/Cargo.toml b/benches/benchsuite/Cargo.toml index fba6f63cd91..5cd4b2330cd 100644 --- a/benches/benchsuite/Cargo.toml +++ b/benches/benchsuite/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "benchsuite" -version = "0.1.0" +version = "0.0.0" edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" description = "Benchmarking suite for Cargo." +publish = false [dependencies] cargo = { path = "../.." } diff --git a/crates/mdman/Cargo.toml b/crates/mdman/Cargo.toml index 92cdf2eb634..def3cad9d56 100644 --- a/crates/mdman/Cargo.toml +++ b/crates/mdman/Cargo.toml @@ -1,9 +1,10 @@ [package] name = "mdman" -version = "0.1.0" +version = "0.0.0" edition = "2021" license = "MIT OR Apache-2.0" description = "Creates a man page page from markdown." +publish = false [dependencies] anyhow = "1.0.31" diff --git a/crates/resolver-tests/Cargo.toml b/crates/resolver-tests/Cargo.toml index e4aab4325f7..3de0e945ac3 100644 --- a/crates/resolver-tests/Cargo.toml +++ b/crates/resolver-tests/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "resolver-tests" -version = "0.1.0" +version = "0.0.0" edition = "2018" +publish = false [dependencies] cargo = { path = "../.." } diff --git a/crates/semver-check/Cargo.toml b/crates/semver-check/Cargo.toml index bdfd8d7d7c1..e40b499ee06 100644 --- a/crates/semver-check/Cargo.toml +++ b/crates/semver-check/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "semver-check" -version = "0.1.0" +version = "0.0.0" authors = ["Eric Huss"] edition = "2021" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From ccf223fa290d8152b201213578a3ae0dec9806a8 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta <utkarshgupta137@gmail.com> Date: Thu, 27 Apr 2023 16:54:48 +0530 Subject: [PATCH 068/104] home: fix & enhance documentation --- crates/home/src/lib.rs | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/crates/home/src/lib.rs b/crates/home/src/lib.rs index a8af963f34e..b57f0bc2366 100644 --- a/crates/home/src/lib.rs +++ b/crates/home/src/lib.rs @@ -1,14 +1,5 @@ //! Canonical definitions of `home_dir`, `cargo_home`, and `rustup_home`. //! -//! This provides the definition of `home_dir` used by Cargo and -//! rustup, as well functions to find the correct value of -//! `CARGO_HOME` and `RUSTUP_HOME`. -//! -//! See also the [`dirs`](https://docs.rs/dirs) crate. -//! -//! _Note that as of 2019/08/06 it appears that cargo uses this crate. And -//! rustup has used this crate since 2019/08/21._ -//! //! The definition of `home_dir` provided by the standard library is //! incorrect because it considers the `HOME` environment variable on //! Windows. This causes surprising situations where a Rust program @@ -17,9 +8,11 @@ //! rustup use the standard libraries definition - they use the //! definition here. //! -//! This crate further provides two functions, `cargo_home` and +//! This crate provides two additional functions, `cargo_home` and //! `rustup_home`, which are the canonical way to determine the -//! location that Cargo and rustup store their data. +//! location that Cargo and rustup use to store their data. +//! The `env` module contains utilities for mocking the process environment +//! by Cargo and rustup. //! //! See also this [discussion]. //! @@ -36,29 +29,34 @@ mod windows; use std::io; use std::path::{Path, PathBuf}; -/// Returns the path of the current user's home directory if known. +/// Returns the path of the current user's home directory using environment +/// variables or OS-specific APIs. /// /// # Unix /// /// Returns the value of the `HOME` environment variable if it is set -/// and not equal to the empty string. Otherwise, it tries to determine the -/// home directory by invoking the `getpwuid_r` function on the UID of the -/// current user. +/// **even** if it is an empty string. Otherwise, it tries to determine the +/// home directory by invoking the [`getpwuid_r`][getpwuid] function with +/// the UID of the current user. +/// +/// [getpwuid]: https://linux.die.net/man/3/getpwuid_r /// /// # Windows /// -/// Returns the value of the `USERPROFILE` environment variable if it -/// is set and not equal to the empty string. If both do not exist, -/// [`SHGetFolderPathW`][msdn] is used to return the appropriate path. +/// Returns the value of the `USERPROFILE` environment variable if it is set +/// **and** it is not an empty string. Otherwise, it tries to determine the +/// home directory by invoking the [`SHGetFolderPathW`][shgfp] function with +/// [`CSIDL_PROFILE`][csidl]. /// -/// [msdn]: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw +/// [shgfp]: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpathw +/// [csidl]: https://learn.microsoft.com/en-us/windows/win32/shell/csidl /// /// # Examples /// /// ``` /// match home::home_dir() { -/// Some(path) => println!("{}", path.display()), -/// None => println!("Impossible to get your home dir!"), +/// Some(path) if !path.as_os_str().is_empty() => println!("{}", path.display()), +/// _ => println!("Unable to get your home dir!"), /// } /// ``` pub fn home_dir() -> Option<PathBuf> { From 33a586af935da6028249cfe826c5910c6378a0a7 Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta <utkarshgupta137@gmail.com> Date: Thu, 27 Apr 2023 22:00:19 +0530 Subject: [PATCH 069/104] home: bump version & update changelog --- Cargo.lock | 10 +++++----- crates/home/CHANGELOG.md | 4 ++++ crates/home/Cargo.toml | 2 +- crates/home/src/lib.rs | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46188d1606c..ae98e6aaac1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,7 +262,7 @@ dependencies = [ "glob", "hex", "hmac", - "home 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "home 0.5.5", "http-auth", "humantime 2.1.0", "ignore", @@ -1546,7 +1546,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "home 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "home 0.5.5", "thiserror", "url", ] @@ -1693,15 +1693,15 @@ dependencies = [ [[package]] name = "home" version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ "windows-sys 0.48.0", ] [[package]] name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +version = "0.5.6" dependencies = [ "windows-sys 0.48.0", ] diff --git a/crates/home/CHANGELOG.md b/crates/home/CHANGELOG.md index 425632ad5d5..58f960cc311 100644 --- a/crates/home/CHANGELOG.md +++ b/crates/home/CHANGELOG.md @@ -4,6 +4,10 @@ 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). +## 0.5.6 +- Fixed & enhanced documentation. + [#12047](https://github.com/rust-lang/cargo/pull/12047) + ## 0.5.5 - 2023-04-25 - The `home` crate has migrated to the <https://github.com/rust-lang/cargo/> repository. [#11359](https://github.com/rust-lang/cargo/pull/11359) diff --git a/crates/home/Cargo.toml b/crates/home/Cargo.toml index 90211c28d78..3691d9c04a8 100644 --- a/crates/home/Cargo.toml +++ b/crates/home/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "home" -version = "0.5.5" # also update `html_root_url` in `src/lib.rs` +version = "0.5.6" # also update `html_root_url` in `src/lib.rs` authors = ["Brian Anderson <andersrb@gmail.com>"] documentation = "https://docs.rs/home" edition = "2018" diff --git a/crates/home/src/lib.rs b/crates/home/src/lib.rs index b57f0bc2366..0e1e975e476 100644 --- a/crates/home/src/lib.rs +++ b/crates/home/src/lib.rs @@ -18,7 +18,7 @@ //! //! [discussion]: https://github.com/rust-lang/rust/pull/46799#issuecomment-361156935 -#![doc(html_root_url = "https://docs.rs/home/0.5.5")] +#![doc(html_root_url = "https://docs.rs/home/0.5.6")] #![deny(rust_2018_idioms)] pub mod env; From 20cdd156d58d05be459a5b1bb52bfe0800f6ff06 Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Thu, 27 Apr 2023 18:05:44 +0200 Subject: [PATCH 070/104] fix broken markdown in docs --- src/cargo/core/compiler/build_context/target_info.rs | 2 +- src/cargo/lib.rs | 2 +- src/cargo/sources/registry/mod.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index d134524e6c4..e6e41c5226f 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -39,7 +39,7 @@ pub struct TargetInfo { /// /// The key is the crate type name (like `cdylib`) and the value is /// `Some((prefix, suffix))`, for example `libcargo.so` would be - /// `Some(("lib", ".so")). The value is `None` if the crate type is not + /// `Some(("lib", ".so"))`. The value is `None` if the crate type is not /// supported. crate_types: RefCell<HashMap<CrateType, Option<(String, String)>>>, /// `cfg` information extracted from `rustc --print=cfg`. diff --git a/src/cargo/lib.rs b/src/cargo/lib.rs index 5924c5d1856..31d03ad259c 100644 --- a/src/cargo/lib.rs +++ b/src/cargo/lib.rs @@ -37,7 +37,7 @@ //! - [`core::compiler`]: //! This is the code responsible for running `rustc` and `rustdoc`. //! - [`core::compiler::build_context`]: -//! The [`BuildContext`]['core::compiler::BuildContext] is the result of the "front end" of the +//! The [`BuildContext`][core::compiler::BuildContext] is the result of the "front end" of the //! build process. This contains the graph of work to perform and any settings necessary for //! `rustc`. After this is built, the next stage of building is handled in //! [`Context`][core::compiler::Context]. diff --git a/src/cargo/sources/registry/mod.rs b/src/cargo/sources/registry/mod.rs index aa3f5dc5ff4..19aa2823438 100644 --- a/src/cargo/sources/registry/mod.rs +++ b/src/cargo/sources/registry/mod.rs @@ -241,7 +241,7 @@ pub struct RegistryConfig { /// crate's sha256 checksum. /// /// For backwards compatibility, if the string does not contain any - /// markers (`{crate}`, `{version}`, `{prefix}`, or ``{lowerprefix}`), it + /// markers (`{crate}`, `{version}`, `{prefix}`, or `{lowerprefix}`), it /// will be extended with `/{crate}/{version}/download` to /// support registries like crates.io which were created before the /// templating setup was created. @@ -945,7 +945,7 @@ impl<'cfg> Source for RegistrySource<'cfg> { } /// Get the maximum upack size that Cargo permits -/// based on a given `size of your compressed file. +/// based on a given `size` of your compressed file. /// /// Returns the larger one between `size * max compression ratio` /// and a fixed max unpacked size. From 9b77a2d2bb0e354f7a47092619104f141468241f Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 27 Apr 2023 18:34:57 +0100 Subject: [PATCH 071/104] chore: update trigger files for autolabel --- triagebot.toml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/triagebot.toml b/triagebot.toml index 1700ba74eda..b44ab480994 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -104,7 +104,10 @@ trigger_files = ["src/cargo/sources/directory.rs"] trigger_files = ["src/doc/"] [autolabel."A-environment-variables"] -trigger_files = ["crates/home/"] +trigger_files = [ + "crates/home/", + "src/cargo/util/config/environment.rs", +] [autolabel."A-errors"] trigger_files = ["src/cargo/util/diagnostic_server.rs"] @@ -121,6 +124,19 @@ trigger_files = ["src/cargo/core/compiler/future_incompat.rs"] [autolabel."A-git"] trigger_files = ["src/cargo/sources/git/"] +[autolabel."A-infrastructure"] +trigger_files = [ + ".cargo/", + ".github/", + "build.rs", + "ci/", + "clippy.toml", + "crates/xtask-", + "deny.toml", + "publish.py", + "triagebot.toml", +] + [autolabel."A-interacts-with-crates.io"] trigger_files = ["crates/crates-io/", "src/cargo/ops/registry.rs"] @@ -150,7 +166,7 @@ trigger_files = [ ] [autolabel."A-networking"] -trigger_files = ["src/cargo/util/network.rs"] +trigger_files = ["src/cargo/util/network/"] [autolabel."A-overrides"] trigger_files = ["src/cargo/sources/replaced.rs"] @@ -169,9 +185,9 @@ trigger_files = ["src/cargo/util/auth.rs", "credential/"] [autolabel."A-semver"] trigger_files = [ + "crates/semver-check", "src/cargo/util/semver_ext.rs", "src/cargo/util/to_semver.rs", - "src/doc/semver-check/", ] [autolabel."A-source-replacement"] From 57114ebf0f810b58e1d207cc2b0f9944e874f787 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 27 Apr 2023 18:35:47 +0100 Subject: [PATCH 072/104] chore: delete removed label `needs-mcve` --- triagebot.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/triagebot.toml b/triagebot.toml index b44ab480994..00a98e00806 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -9,7 +9,6 @@ allow-unauthenticated = [ "S-*", "Z-*", "beta-nominated", - "needs-mcve", "regression-*", "relnotes", ] From 82e7ead4ec30e60c6bb39818fa38c6e2bccf1bf9 Mon Sep 17 00:00:00 2001 From: Jordan Rose <jrose@signal.org> Date: Thu, 27 Apr 2023 10:49:22 -0700 Subject: [PATCH 073/104] test: Add a test for `cargo tree --duplicates` with a proc-macro --- tests/testsuite/tree.rs | 60 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/tests/testsuite/tree.rs b/tests/testsuite/tree.rs index c3c1ca6d309..cdd9f1e2982 100644 --- a/tests/testsuite/tree.rs +++ b/tests/testsuite/tree.rs @@ -1085,6 +1085,66 @@ fn duplicates_with_target() { p.cargo("tree -d --target=all").with_stdout("").run(); } +#[cargo_test] +fn duplicates_with_proc_macro() { + Package::new("dupe-dep", "1.0.0").publish(); + Package::new("dupe-dep", "2.0.0").publish(); + Package::new("proc", "1.0.0") + .proc_macro(true) + .dep("dupe-dep", "1.0") + .publish(); + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.1.0" + + [dependencies] + proc = "1.0" + dupe-dep = "2.0" + "#, + ) + .file("src/lib.rs", "") + .build(); + + p.cargo("tree") + .with_stdout( + "\ +foo v0.1.0 ([..]/foo) +├── dupe-dep v2.0.0 +└── proc v1.0.0 (proc-macro) + └── dupe-dep v1.0.0 +", + ) + .run(); + + p.cargo("tree --duplicates") + .with_stdout( + "\ +dupe-dep v1.0.0 +└── proc v1.0.0 (proc-macro) + └── foo v0.1.0 ([..]/foo) + +dupe-dep v2.0.0 +└── foo v0.1.0 ([..]/foo) +", + ) + .run(); + + p.cargo("tree --duplicates --edges no-proc-macro") + .with_stdout( + "\ +dupe-dep v1.0.0 + +dupe-dep v2.0.0 +└── foo v0.1.0 ([..]/foo) +", + ) + .run(); +} + #[cargo_test] fn charset() { let p = make_simple_proj(); From 89369cd849c1304265a7eeb60176c1567a847281 Mon Sep 17 00:00:00 2001 From: Jordan Rose <jrose@signal.org> Date: Thu, 27 Apr 2023 10:54:51 -0700 Subject: [PATCH 074/104] cargo-tree: Handle -e no-proc-macro when building the graph This is closer to how the edge-based filters work ([no-]build etc.), and results in a more useful behavior when combined with -i or -d. --- src/cargo/ops/tree/graph.rs | 4 ++++ src/cargo/ops/tree/mod.rs | 18 ------------------ tests/testsuite/tree.rs | 11 +---------- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/src/cargo/ops/tree/graph.rs b/src/cargo/ops/tree/graph.rs index 20a9ca0b657..d01d07f1a1a 100644 --- a/src/cargo/ops/tree/graph.rs +++ b/src/cargo/ops/tree/graph.rs @@ -362,6 +362,10 @@ fn add_pkg( if !opts.edge_kinds.contains(&EdgeKind::Dep(dep.kind())) { return false; } + // Filter out proc-macrcos if requested. + if opts.no_proc_macro && graph.package_for_id(dep_id).proc_macro() { + return false; + } if dep.is_optional() { // If the new feature resolver does not enable this // optional dep, then don't use it. diff --git a/src/cargo/ops/tree/mod.rs b/src/cargo/ops/tree/mod.rs index 02459f78f43..f397b95af6f 100644 --- a/src/cargo/ops/tree/mod.rs +++ b/src/cargo/ops/tree/mod.rs @@ -267,7 +267,6 @@ fn print( opts.prefix, opts.no_dedupe, opts.max_display_depth, - opts.no_proc_macro, &mut visited_deps, &mut levels_continue, &mut print_stack, @@ -288,7 +287,6 @@ fn print_node<'a>( prefix: Prefix, no_dedupe: bool, max_display_depth: u32, - no_proc_macro: bool, visited_deps: &mut HashSet<usize>, levels_continue: &mut Vec<bool>, print_stack: &mut Vec<usize>, @@ -348,7 +346,6 @@ fn print_node<'a>( prefix, no_dedupe, max_display_depth, - no_proc_macro, visited_deps, levels_continue, print_stack, @@ -369,7 +366,6 @@ fn print_dependencies<'a>( prefix: Prefix, no_dedupe: bool, max_display_depth: u32, - no_proc_macro: bool, visited_deps: &mut HashSet<usize>, levels_continue: &mut Vec<bool>, print_stack: &mut Vec<usize>, @@ -405,19 +401,6 @@ fn print_dependencies<'a>( let mut it = deps .iter() - .filter(|dep| { - // Filter out proc-macro dependencies. - if no_proc_macro { - match graph.node(**dep) { - &Node::Package { package_id, .. } => { - !graph.package_for_id(package_id).proc_macro() - } - _ => true, - } - } else { - true - } - }) .filter(|dep| { // Filter out packages to prune. match graph.node(**dep) { @@ -441,7 +424,6 @@ fn print_dependencies<'a>( prefix, no_dedupe, max_display_depth, - no_proc_macro, visited_deps, levels_continue, print_stack, diff --git a/tests/testsuite/tree.rs b/tests/testsuite/tree.rs index cdd9f1e2982..e2e74c4f954 100644 --- a/tests/testsuite/tree.rs +++ b/tests/testsuite/tree.rs @@ -1134,14 +1134,7 @@ dupe-dep v2.0.0 .run(); p.cargo("tree --duplicates --edges no-proc-macro") - .with_stdout( - "\ -dupe-dep v1.0.0 - -dupe-dep v2.0.0 -└── foo v0.1.0 ([..]/foo) -", - ) + .with_stdout("") .run(); } @@ -1600,8 +1593,6 @@ somedep v1.0.0 "\ somedep v1.0.0 └── foo v0.1.0 ([..]/foo) - -somedep v1.0.0 ", ) .run(); From cfe02aef1ec016b7ce7f7ac46b84fa1b3d5ae366 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 27 Apr 2023 18:13:26 +0100 Subject: [PATCH 075/104] xtask-stale-label: check stale paths in autolabel defintions --- .cargo/config.toml | 1 + Cargo.lock | 7 +++ crates/xtask-stale-label/Cargo.toml | 8 +++ crates/xtask-stale-label/src/main.rs | 89 ++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 crates/xtask-stale-label/Cargo.toml create mode 100644 crates/xtask-stale-label/src/main.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index 3cea81f34c5..7115dd8164e 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,3 @@ [alias] unpublished = "run --package xtask-unpublished --" +stale-label = "run --package xtask-stale-label --" diff --git a/Cargo.lock b/Cargo.lock index ae98e6aaac1..a3080c26aae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3712,6 +3712,13 @@ dependencies = [ "memchr", ] +[[package]] +name = "xtask-stale-label" +version = "0.0.0" +dependencies = [ + "toml_edit", +] + [[package]] name = "xtask-unpublished" version = "0.0.0" diff --git a/crates/xtask-stale-label/Cargo.toml b/crates/xtask-stale-label/Cargo.toml new file mode 100644 index 00000000000..64eb3560098 --- /dev/null +++ b/crates/xtask-stale-label/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "xtask-stale-label" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies] +toml_edit = "0.19" diff --git a/crates/xtask-stale-label/src/main.rs b/crates/xtask-stale-label/src/main.rs new file mode 100644 index 00000000000..05c22eed9b2 --- /dev/null +++ b/crates/xtask-stale-label/src/main.rs @@ -0,0 +1,89 @@ +//! ```text +//! NAME +//! stale-label +//! +//! SYNOPSIS +//! stale-label [<FILE>] +//! +//! DESCRIPTION +//! Detect stale paths in autolabel definitions in triagebot.toml. +//! Probably autofix them in the future. +//! ``` + +use std::fmt::Write as _; +use std::path::Path; +use std::path::PathBuf; +use std::process; +use toml_edit::Document; + +fn main() { + let pkg_root = std::env!("CARGO_MANIFEST_DIR"); + let ws_root = PathBuf::from(format!("{pkg_root}/../..")); + let triagebot_toml = format!("{pkg_root}/../../triagebot.toml"); + let path = std::env::args_os().nth(1).unwrap_or(triagebot_toml.into()); + let path = Path::new(&path).canonicalize().unwrap_or(path.into()); + + eprintln!("Checking file {path:?}\n"); + + let mut failed = 0; + let mut passed = 0; + + let toml = std::fs::read_to_string(path).expect("read from file"); + let doc = toml.parse::<Document>().expect("a toml"); + let autolabel = doc["autolabel"].as_table().expect("a toml table"); + + for (label, value) in autolabel.iter() { + let Some(trigger_files) = value.get("trigger_files") else { + continue + }; + let trigger_files = trigger_files.as_array().expect("an array"); + let missing_files: Vec<_> = trigger_files + .iter() + // Hey TOML content is strict UTF-8. + .map(|v| v.as_str().unwrap()) + .filter(|f| { + // triagebot checks with `starts_with` only. + // See https://github.com/rust-lang/triagebot/blob/0e4b48ca86ffede9cc70fb1611e658e4d013bce2/src/handlers/autolabel.rs#L45 + let path = ws_root.join(f); + if path.exists() { + return false; + } + let Some(mut read_dir) = path.parent().and_then(|p| p.read_dir().ok()) else { + return true; + }; + !read_dir.any(|e| { + e.unwrap() + .path() + .strip_prefix(&ws_root) + .unwrap() + .to_str() + .unwrap() + .starts_with(f) + }) + }) + .collect(); + + failed += missing_files.len(); + passed += trigger_files.len() - missing_files.len(); + + if missing_files.is_empty() { + continue; + } + + let mut msg = String::new(); + writeln!( + &mut msg, + "missing files defined in `autolabel.{label}.trigger_files`:" + ) + .unwrap(); + for f in missing_files.iter() { + writeln!(&mut msg, "\t {f}").unwrap(); + } + eprintln!("{msg}"); + } + + let result = if failed == 0 { "ok" } else { "FAILED" }; + eprintln!("test result: {result}. {passed} passed; {failed} failed;"); + + process::exit(failed as i32); +} From 5137e6ab3ca7b5284809f54659526f0537f78dca Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 27 Apr 2023 18:15:33 +0100 Subject: [PATCH 076/104] ci: add job `stale-label` --- .github/workflows/main.yml | 7 +++++++ crates/xtask-stale-label/src/main.rs | 14 ++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 306e28b602d..342fdcc743f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,13 @@ jobs: # TODO: check every members - run: cargo clippy -p cargo --lib --no-deps -- -D warnings + stale-label: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: rustup update stable && rustup default stable + - run: cargo stale-label + # Ensure Cargo.lock is up-to-date lockfile: runs-on: ubuntu-latest diff --git a/crates/xtask-stale-label/src/main.rs b/crates/xtask-stale-label/src/main.rs index 05c22eed9b2..37675979cfa 100644 --- a/crates/xtask-stale-label/src/main.rs +++ b/crates/xtask-stale-label/src/main.rs @@ -3,7 +3,7 @@ //! stale-label //! //! SYNOPSIS -//! stale-label [<FILE>] +//! stale-label //! //! DESCRIPTION //! Detect stale paths in autolabel definitions in triagebot.toml. @@ -11,7 +11,6 @@ //! ``` use std::fmt::Write as _; -use std::path::Path; use std::path::PathBuf; use std::process; use toml_edit::Document; @@ -19,9 +18,10 @@ use toml_edit::Document; fn main() { let pkg_root = std::env!("CARGO_MANIFEST_DIR"); let ws_root = PathBuf::from(format!("{pkg_root}/../..")); - let triagebot_toml = format!("{pkg_root}/../../triagebot.toml"); - let path = std::env::args_os().nth(1).unwrap_or(triagebot_toml.into()); - let path = Path::new(&path).canonicalize().unwrap_or(path.into()); + let path = { + let path = ws_root.join("triagebot.toml"); + path.canonicalize().unwrap_or(path) + }; eprintln!("Checking file {path:?}\n"); @@ -85,5 +85,7 @@ fn main() { let result = if failed == 0 { "ok" } else { "FAILED" }; eprintln!("test result: {result}. {passed} passed; {failed} failed;"); - process::exit(failed as i32); + if failed > 0 { + process::exit(1); + } } From 36d87606e1c5867a8e1be1088579280c1215ab10 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Wed, 26 Apr 2023 07:55:59 -0500 Subject: [PATCH 077/104] feat(test): Manual publishes set 'rust_version' in Index --- crates/cargo-test-support/src/publish.rs | 4 ++++ crates/cargo-test-support/src/registry.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/crates/cargo-test-support/src/publish.rs b/crates/cargo-test-support/src/publish.rs index 64774bc43c8..dccc8356dbb 100644 --- a/crates/cargo-test-support/src/publish.rs +++ b/crates/cargo-test-support/src/publish.rs @@ -165,6 +165,7 @@ pub(crate) fn create_index_line( features: crate::registry::FeatureMap, yanked: bool, links: Option<String>, + rust_version: Option<&str>, v: Option<u32>, ) -> String { // This emulates what crates.io does to retain backwards compatibility. @@ -185,6 +186,9 @@ pub(crate) fn create_index_line( if let Some(v) = v { json["v"] = serde_json::json!(v); } + if let Some(rust_version) = rust_version { + json["rust_version"] = serde_json::json!(rust_version); + } json.to_string() } diff --git a/crates/cargo-test-support/src/registry.rs b/crates/cargo-test-support/src/registry.rs index 5faf2354045..5d23a2ebbbe 100644 --- a/crates/cargo-test-support/src/registry.rs +++ b/crates/cargo-test-support/src/registry.rs @@ -1144,6 +1144,7 @@ fn save_new_crate( false, new_crate.links, None, + None, ); write_to_index(registry_path, &new_crate.name, line, false); @@ -1400,6 +1401,7 @@ impl Package { self.features.clone(), self.yanked, self.links.clone(), + self.rust_version.as_deref(), self.v, ); From e5eb04ad6f9d28c430ff496cf35b88975f62a99d Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Wed, 26 Apr 2023 07:56:20 -0500 Subject: [PATCH 078/104] feat(index): Read 'rust_version' --- src/cargo/sources/registry/index.rs | 1 + src/cargo/sources/registry/mod.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/cargo/sources/registry/index.rs b/src/cargo/sources/registry/index.rs index a215114347c..f7be732ab0e 100644 --- a/src/cargo/sources/registry/index.rs +++ b/src/cargo/sources/registry/index.rs @@ -814,6 +814,7 @@ impl IndexSummary { features2, yanked, links, + rust_version: _, v, } = serde_json::from_slice(line)?; let v = v.unwrap_or(1); diff --git a/src/cargo/sources/registry/mod.rs b/src/cargo/sources/registry/mod.rs index 19aa2823438..e46254c8c00 100644 --- a/src/cargo/sources/registry/mod.rs +++ b/src/cargo/sources/registry/mod.rs @@ -287,6 +287,14 @@ pub struct RegistryPackage<'a> { /// Added early 2018 (see <https://github.com/rust-lang/cargo/pull/4978>), /// can be `None` if published before then. links: Option<InternedString>, + /// Required version of rust + /// + /// Corresponds to `package.rust-version`. + /// + /// Added in 2023 (see <https://github.com/rust-lang/crates.io/pull/6267>), + /// can be `None` if published before then or if not set in the manifest. + #[allow(dead_code)] + rust_version: Option<InternedString>, /// The schema version for this entry. /// /// If this is None, it defaults to version 1. Entries with unknown From d97d5c37f710a496c13a087e10e27d449397b978 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Wed, 26 Apr 2023 08:06:14 -0500 Subject: [PATCH 079/104] feat: Expose 'rust_version' in the Summary --- crates/resolver-tests/src/lib.rs | 4 ++++ src/cargo/core/resolver/version_prefs.rs | 10 +++++++++- src/cargo/core/summary.rs | 7 +++++++ src/cargo/sources/registry/index.rs | 4 ++-- src/cargo/sources/registry/mod.rs | 1 - src/cargo/util/toml/mod.rs | 1 + 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/crates/resolver-tests/src/lib.rs b/crates/resolver-tests/src/lib.rs index 3ffb6c5d2c6..01d9b5e6d69 100644 --- a/crates/resolver-tests/src/lib.rs +++ b/crates/resolver-tests/src/lib.rs @@ -184,6 +184,7 @@ pub fn resolve_with_config_raw( deps, &BTreeMap::new(), None::<&String>, + None::<&String>, ) .unwrap(); let opts = ResolveOpts::everything(); @@ -585,6 +586,7 @@ pub fn pkg_dep<T: ToPkgId>(name: T, dep: Vec<Dependency>) -> Summary { dep, &BTreeMap::new(), link, + None::<&String>, ) .unwrap() } @@ -613,6 +615,7 @@ pub fn pkg_loc(name: &str, loc: &str) -> Summary { Vec::new(), &BTreeMap::new(), link, + None::<&String>, ) .unwrap() } @@ -627,6 +630,7 @@ pub fn remove_dep(sum: &Summary, ind: usize) -> Summary { deps, &BTreeMap::new(), sum.links().map(|a| a.as_str()), + None::<&String>, ) .unwrap() } diff --git a/src/cargo/core/resolver/version_prefs.rs b/src/cargo/core/resolver/version_prefs.rs index 73cce5db87a..002f11ff809 100644 --- a/src/cargo/core/resolver/version_prefs.rs +++ b/src/cargo/core/resolver/version_prefs.rs @@ -100,7 +100,15 @@ mod test { let pkg_id = pkgid(name, version); let config = Config::default().unwrap(); let features = BTreeMap::new(); - Summary::new(&config, pkg_id, Vec::new(), &features, None::<&String>).unwrap() + Summary::new( + &config, + pkg_id, + Vec::new(), + &features, + None::<&String>, + None::<&String>, + ) + .unwrap() } fn describe(summaries: &Vec<Summary>) -> String { diff --git a/src/cargo/core/summary.rs b/src/cargo/core/summary.rs index 8a7238e4a56..2535c44829d 100644 --- a/src/cargo/core/summary.rs +++ b/src/cargo/core/summary.rs @@ -25,6 +25,7 @@ struct Inner { features: Rc<FeatureMap>, checksum: Option<String>, links: Option<InternedString>, + rust_version: Option<InternedString>, } impl Summary { @@ -34,6 +35,7 @@ impl Summary { dependencies: Vec<Dependency>, features: &BTreeMap<InternedString, Vec<InternedString>>, links: Option<impl Into<InternedString>>, + rust_version: Option<impl Into<InternedString>>, ) -> CargoResult<Summary> { // ****CAUTION**** If you change anything here that may raise a new // error, be sure to coordinate that change with either the index @@ -55,6 +57,7 @@ impl Summary { features: Rc::new(feature_map), checksum: None, links: links.map(|l| l.into()), + rust_version: rust_version.map(|l| l.into()), }), }) } @@ -85,6 +88,10 @@ impl Summary { self.inner.links } + pub fn rust_version(&self) -> Option<InternedString> { + self.inner.rust_version + } + pub fn override_id(mut self, id: PackageId) -> Summary { Rc::make_mut(&mut self.inner).package_id = id; self diff --git a/src/cargo/sources/registry/index.rs b/src/cargo/sources/registry/index.rs index f7be732ab0e..09b55c470cd 100644 --- a/src/cargo/sources/registry/index.rs +++ b/src/cargo/sources/registry/index.rs @@ -814,7 +814,7 @@ impl IndexSummary { features2, yanked, links, - rust_version: _, + rust_version, v, } = serde_json::from_slice(line)?; let v = v.unwrap_or(1); @@ -829,7 +829,7 @@ impl IndexSummary { features.entry(name).or_default().extend(values); } } - let mut summary = Summary::new(config, pkgid, deps, &features, links)?; + let mut summary = Summary::new(config, pkgid, deps, &features, links, rust_version)?; summary.set_checksum(cksum); Ok(IndexSummary { summary, diff --git a/src/cargo/sources/registry/mod.rs b/src/cargo/sources/registry/mod.rs index e46254c8c00..b505fa9d72c 100644 --- a/src/cargo/sources/registry/mod.rs +++ b/src/cargo/sources/registry/mod.rs @@ -293,7 +293,6 @@ pub struct RegistryPackage<'a> { /// /// Added in 2023 (see <https://github.com/rust-lang/crates.io/pull/6267>), /// can be `None` if published before then or if not set in the manifest. - #[allow(dead_code)] rust_version: Option<InternedString>, /// The schema version for this entry. /// diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index 12698b70310..3b2bba09cfc 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -2367,6 +2367,7 @@ impl TomlManifest { deps, me.features.as_ref().unwrap_or(&empty_features), package.links.as_deref(), + rust_version.as_deref().map(InternedString::new), )?; let metadata = ManifestMetadata { From a66f2bc40971eeb34baed21682d26b6fb5762f27 Mon Sep 17 00:00:00 2001 From: Ed Page <eopage@gmail.com> Date: Wed, 26 Apr 2023 09:52:08 -0500 Subject: [PATCH 080/104] feat: `-Zmsrv-policy` groundwork --- src/cargo/core/features.rs | 2 ++ src/doc/src/reference/unstable.md | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs index 7f16e79cfa6..1f6773da931 100644 --- a/src/cargo/core/features.rs +++ b/src/cargo/core/features.rs @@ -733,6 +733,7 @@ unstable_cli_options!( unstable_options: bool = ("Allow the usage of unstable options"), skip_rustdoc_fingerprint: bool = (HIDDEN), rustdoc_scrape_examples: bool = ("Allows Rustdoc to scrape code examples from reverse-dependencies"), + msrv_policy: bool = ("Enable rust-version aware policy within cargo"), ); const STABILIZED_COMPILE_PROGRESS: &str = "The progress bar is now always \ @@ -1095,6 +1096,7 @@ impl CliUnstable { "timings" => stabilized_warn(k, "1.60", STABILIZED_TIMINGS), "codegen-backend" => self.codegen_backend = parse_empty(k, v)?, "profile-rustflags" => self.profile_rustflags = parse_empty(k, v)?, + "msrv-policy" => self.msrv_policy = parse_empty(k, v)?, _ => bail!("unknown `-Z` flag specified: {}", k), } diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index accd45d8ee8..cc1a36ea574 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -69,6 +69,7 @@ Each new feature described below should explain how to use it. * [minimal-versions](#minimal-versions) --- Forces the resolver to use the lowest compatible version instead of the highest. * [direct-minimal-versions](#direct-minimal-versions) — Forces the resolver to use the lowest compatible version instead of the highest. * [public-dependency](#public-dependency) --- Allows dependencies to be classified as either public or private. + * [msrv-policy](#msrv-policy) --- MSRV-aware resolver and version selection * Output behavior * [out-dir](#out-dir) --- Adds a directory where artifacts are copied to. * [Different binary name](#different-binary-name) --- Assign a name to the built binary that is separate from the crate name. @@ -300,6 +301,14 @@ my_dep = { version = "1.2.3", public = true } private_dep = "2.0.0" # Will be 'private' by default ``` +### msrv-policy +- [#9930](https://github.com/rust-lang/cargo/issues/9930) (MSRV-aware resolver) +- [#10653](https://github.com/rust-lang/cargo/issues/10653) (MSRV-aware cargo-add) +- [#10903](https://github.com/rust-lang/cargo/issues/10903) (MSRV-aware cargo-install) + +The `msrv-policy` feature enables experiments in MSRV-aware policy for cargo in +preparation for an upcoming RFC. + ### build-std * Tracking Repository: <https://github.com/rust-lang/wg-cargo-std-aware> From a0429138aeb81b1e14ea462ba0123d1443af7a72 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Fri, 28 Apr 2023 15:41:25 +0100 Subject: [PATCH 081/104] mdman: remove dangling Cargo.lock --- crates/mdman/Cargo.lock | 459 ---------------------------------------- 1 file changed, 459 deletions(-) delete mode 100644 crates/mdman/Cargo.lock diff --git a/crates/mdman/Cargo.lock b/crates/mdman/Cargo.lock deleted file mode 100644 index 51fe47a9c41..00000000000 --- a/crates/mdman/Cargo.lock +++ /dev/null @@ -1,459 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anyhow" -version = "1.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "ctor" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39858aa5bac06462d4dd4b9164848eb81ffc4aa5c479746393598fd193afa227" -dependencies = [ - "quote", - "syn", -] - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[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 = "generic-array" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -dependencies = [ - "typenum", -] - -[[package]] -name = "handlebars" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86dbc8a0746b08f363d2e00da48e6c9ceb75c198ac692d2715fcbb5bee74c87d" -dependencies = [ - "log", - "pest", - "pest_derive", - "quick-error", - "serde", - "serde_json", - "walkdir", -] - -[[package]] -name = "idna" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "itoa" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" - -[[package]] -name = "log" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "matches" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" - -[[package]] -name = "mdman" -version = "0.1.0" -dependencies = [ - "anyhow", - "handlebars", - "pretty_assertions", - "pulldown-cmark", - "same-file", - "serde_json", - "url", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "output_vt100" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" -dependencies = [ - "winapi", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" -dependencies = [ - "maplit", - "pest", - "sha-1", -] - -[[package]] -name = "pretty_assertions" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a25e9bcb20aa780fd0bb16b72403a9064d6b3f22f026946029acb941a50af755" -dependencies = [ - "ctor", - "diff", - "output_vt100", - "yansi", -] - -[[package]] -name = "proc-macro2" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "pulldown-cmark" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" -dependencies = [ - "bitflags", - "memchr", - "unicase", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "serde" -version = "1.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" - -[[package]] -name = "serde_json" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer", - "digest", - "fake-simd", - "opaque-debug", -] - -[[package]] -name = "syn" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "tinyvec" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" - -[[package]] -name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" - -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[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", -] - -[[package]] -name = "version_check" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" - -[[package]] -name = "walkdir" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" From 733b313696f911e9690f13bd9e895b7033ddfbda Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 27 Apr 2023 14:39:47 +0100 Subject: [PATCH 082/104] mdman: make build-man part of xtask Turn `src/doc/build-man.sh` into a Cargo binary target. So is `crates/mdman/build-man.sh`. --- .cargo/config.toml | 3 +- Cargo.lock | 4 ++ crates/xtask-build-man/Cargo.toml | 7 ++ crates/xtask-build-man/src/main.rs | 108 +++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 crates/xtask-build-man/Cargo.toml create mode 100644 crates/xtask-build-man/src/main.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index 7115dd8164e..c4a595b6185 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,4 @@ [alias] -unpublished = "run --package xtask-unpublished --" +build-man = "run --package xtask-build-man --" stale-label = "run --package xtask-stale-label --" +unpublished = "run --package xtask-unpublished --" diff --git a/Cargo.lock b/Cargo.lock index a3080c26aae..73d5add9f4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3712,6 +3712,10 @@ dependencies = [ "memchr", ] +[[package]] +name = "xtask-build-man" +version = "0.0.0" + [[package]] name = "xtask-stale-label" version = "0.0.0" diff --git a/crates/xtask-build-man/Cargo.toml b/crates/xtask-build-man/Cargo.toml new file mode 100644 index 00000000000..6d02aa2c33a --- /dev/null +++ b/crates/xtask-build-man/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "xtask-build-man" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies] diff --git a/crates/xtask-build-man/src/main.rs b/crates/xtask-build-man/src/main.rs new file mode 100644 index 00000000000..6680c3783cc --- /dev/null +++ b/crates/xtask-build-man/src/main.rs @@ -0,0 +1,108 @@ +//! ```text +//! NAME +//! build-man +//! +//! SYNOPSIS +//! build-man +//! +//! DESCRIPTION +//! Build the man pages for packages `mdman` and `cargo`. +//! For more, read their doc comments. +//! ``` + +use std::fs; +use std::io; +use std::path::PathBuf; +use std::process; +use std::process::Command; + +fn main() -> io::Result<()> { + build_mdman()?; + build_cargo()?; + Ok(()) +} + +/// Builds the man pages for `mdman`. +fn build_mdman() -> io::Result<()> { + cwd_to_workspace_root()?; + + let src_paths = &["crates/mdman/doc/mdman.md".into()]; + let dst_path = "crates/mdman/doc/out"; + let outs = [("md", dst_path), ("txt", dst_path), ("man", dst_path)]; + + build_man("mdman", src_paths, &outs, &[]) +} + +/// Builds the man pages for Cargo. +/// +/// The source for the man pages are located in src/doc/man/ in markdown format. +/// These also are handlebars templates, see crates/mdman/README.md for details. +/// +/// The generated man pages are placed in the src/etc/man/ directory. The pages +/// are also expanded into markdown (after being expanded by handlebars) and +/// saved in the src/doc/src/commands/ directory. These are included in the +/// Cargo book, which is converted to HTML by mdbook. +fn build_cargo() -> io::Result<()> { + // Find all `src/doc/man/cargo-*.md` + let src_paths = { + let mut src_paths = Vec::new(); + for entry in fs::read_dir("src/doc/man")? { + let entry = entry?; + let file_name = entry.file_name(); + let file_name = file_name.to_str().unwrap(); + if file_name.starts_with("cargo-") && file_name.ends_with(".md") { + src_paths.push(entry.path()); + } + } + src_paths + }; + let outs = [ + ("md", "src/doc/src/commands"), + ("txt", "src/doc/man/generated_txt"), + ("man", "src/etc/man"), + ]; + let args = [ + "--url", + "https://doc.rust-lang.org/cargo/commands/", + "--man", + "rustc:1=https://doc.rust-lang.org/rustc/index.html", + "--man", + "rustdoc:1=https://doc.rust-lang.org/rustdoc/index.html", + ]; + build_man("cargo", &src_paths[..], &outs, &args) +} + +/// Change to workspace root. +/// +/// Assumed this xtask is located in `[WORKSPACE]/crates/xtask-build-man`. +fn cwd_to_workspace_root() -> io::Result<()> { + let pkg_root = std::env!("CARGO_MANIFEST_DIR"); + let ws_root = format!("{pkg_root}/../.."); + std::env::set_current_dir(ws_root) +} + +/// Builds the man pages. +fn build_man( + pkg_name: &str, + src_paths: &[PathBuf], + outs: &[(&str, &str)], + extra_args: &[&str], +) -> io::Result<()> { + for (format, dst_path) in outs { + eprintln!("Start converting `{format}` for package `{pkg_name}`..."); + let mut cmd = Command::new(std::env!("CARGO")); + cmd.args(["run", "--package", "mdman", "--"]) + .args(["-t", format, "-o", dst_path]) + .args(src_paths) + .args(extra_args); + + let status = cmd.status()?; + if !status.success() { + eprintln!("failed to build the man pages for package `{pkg_name}`"); + eprintln!("failed command: `{cmd:?}`"); + process::exit(status.code().unwrap_or(1)); + } + } + + Ok(()) +} From 4b51b73788a11ad908a986ef2410b4eb35541d76 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 27 Apr 2023 14:49:53 +0100 Subject: [PATCH 083/104] mdman: use `cargo build-man` everywhere --- ci/validate-man.sh | 15 ++++++++------- crates/mdman/build-man.sh | 7 ------- src/doc/README.md | 6 +----- src/doc/build-man.sh | 31 ------------------------------- 4 files changed, 9 insertions(+), 50 deletions(-) delete mode 100755 crates/mdman/build-man.sh delete mode 100755 src/doc/build-man.sh diff --git a/ci/validate-man.sh b/ci/validate-man.sh index f636b46059c..a3f114214dd 100755 --- a/ci/validate-man.sh +++ b/ci/validate-man.sh @@ -3,24 +3,25 @@ set -e -cd src/doc +cargo_man="src/doc" +mdman_man="crates/mdman/doc" -changes=$(git status --porcelain -- .) +changes=$(git status --porcelain -- $cargo_man $mdman_man) if [ -n "$changes" ] then echo "git directory must be clean before running this script." exit 1 fi -./build-man.sh +cargo build-man -changes=$(git status --porcelain -- .) +changes=$(git status --porcelain -- $cargo_man $mdman_man) if [ -n "$changes" ] then - echo "Detected changes of man pages in src/doc:" + echo "Detected changes of man pages:" echo "$changes" echo - echo "Please run './build-man.sh' in the src/doc directory to rebuild the" - echo "man pages, and commit the changes." + echo 'Please run `cargo build-man` to rebuild the man pages' + echo "and commit the changes." exit 1 fi diff --git a/crates/mdman/build-man.sh b/crates/mdman/build-man.sh deleted file mode 100755 index 9286b17c2f1..00000000000 --- a/crates/mdman/build-man.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -cargo run -- -t md -o doc/out doc/*.md -cargo run -- -t txt -o doc/out doc/*.md -cargo run -- -t man -o doc/out doc/*.md diff --git a/src/doc/README.md b/src/doc/README.md index 79181b7f699..88c3302873b 100644 --- a/src/doc/README.md +++ b/src/doc/README.md @@ -50,11 +50,7 @@ directory) to three different formats: 3. Plain text (needed for embedded man pages on platforms without man such as Windows), saved in [`src/doc/man/generated_txt/`](man/generated_txt). -To rebuild the man pages, run the script `build-man.sh` in the `src/doc` directory. - -```console -$ ./build-man.sh -``` +To rebuild the man pages, run `cargo build-man` inside the workspace. ### SemVer chapter tests diff --git a/src/doc/build-man.sh b/src/doc/build-man.sh deleted file mode 100755 index 77af5b510d1..00000000000 --- a/src/doc/build-man.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# This script builds the Cargo man pages. -# -# The source for the man pages are located in src/doc/man/ in markdown format. -# These also are handlebars templates, see crates/mdman/README.md for details. -# -# The generated man pages are placed in the src/etc/man/ directory. The pages -# are also expanded into markdown (after being expanded by handlebars) and -# saved in the src/doc/src/commands/ directory. These are included in the -# Cargo book, which is converted to HTML by mdbook. - -set -e - -cd "$(dirname "${BASH_SOURCE[0]}")" - -OPTIONS="--url https://doc.rust-lang.org/cargo/commands/ \ - --man rustc:1=https://doc.rust-lang.org/rustc/index.html \ - --man rustdoc:1=https://doc.rust-lang.org/rustdoc/index.html" - -cargo run -p mdman -- \ - -t md -o src/commands man/cargo*.md \ - $OPTIONS - -cargo run -p mdman -- \ - -t txt -o man/generated_txt man/cargo*.md \ - $OPTIONS - -cargo run -p mdman -- \ - -t man -o ../etc/man man/cargo*.md \ - $OPTIONS From 3b9851fcc0b62d4df1adbeef9f99e203bfed275a Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Thu, 27 Apr 2023 14:51:39 +0100 Subject: [PATCH 084/104] mdman: update mdman's example outputs --- crates/mdman/doc/out/mdman.1 | 6 +++--- crates/mdman/doc/out/mdman.md | 4 ++-- crates/mdman/doc/out/mdman.txt | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/mdman/doc/out/mdman.1 b/crates/mdman/doc/out/mdman.1 index 0718d6ddb3c..f9218c94d7a 100644 --- a/crates/mdman/doc/out/mdman.1 +++ b/crates/mdman/doc/out/mdman.1 @@ -6,7 +6,7 @@ .SH "NAME" mdman \- Converts markdown to a man page .SH "SYNOPSIS" -\fBmdman\fR [\fIoptions\fR] \fB\-t\fR \fItype\fR \fB\-o\fR \fIoutdir\fR \fIsources...\fR +\fBmdman\fR [\fIoptions\fR] \fB\-t\fR \fItype\fR \fB\-o\fR \fIoutdir\fR \fIsources\[u2026]\fR .SH "DESCRIPTION" Converts a markdown file to a man page. .sp @@ -83,7 +83,7 @@ Outputs with the \fB\&.md\fR extension. .RE .sp .RS 4 -\h'-04'\(bu\h'+02'\fBtxt\fR \[em] A text file, rendered for situations where a man page viewer isn't +\h'-04'\(bu\h'+02'\fBtxt\fR \[em] A text file, rendered for situations where a man page viewer isn\[cq]t available. Outputs with the \fB\&.txt\fR extension. .RE .RE @@ -107,7 +107,7 @@ matching \fB\-\-man\fR entry, then a relative link to a file named \fIname\fR\fB be used. .RE .sp -\fIsources...\fR +\fIsources\[u2026]\fR .RS 4 The source input filename, may be specified multiple times. .RE diff --git a/crates/mdman/doc/out/mdman.md b/crates/mdman/doc/out/mdman.md index d0dd3451136..db7c113af16 100644 --- a/crates/mdman/doc/out/mdman.md +++ b/crates/mdman/doc/out/mdman.md @@ -61,7 +61,7 @@ man page: <code>.1</code>) matching the man page section.</li> <li><code>md</code> — A markdown file, after all handlebars processing has been finished. Outputs with the <code>.md</code> extension.</li> -<li><code>txt</code> — A text file, rendered for situations where a man page viewer isn't +<li><code>txt</code> — A text file, rendered for situations where a man page viewer isn’t available. Outputs with the <code>.txt</code> extension.</li> </ul></dd> @@ -82,7 +82,7 @@ matching <code>--man</code> entry, then a relative link to a file named <em>name be used.</dd> -<dt class="option-term" id="option-mdman-sources..."><a class="option-anchor" href="#option-mdman-sources..."></a><em>sources...</em></dt> +<dt class="option-term" id="option-mdman-sources…"><a class="option-anchor" href="#option-mdman-sources…"></a><em>sources…</em></dt> <dd class="option-desc">The source input filename, may be specified multiple times.</dd> diff --git a/crates/mdman/doc/out/mdman.txt b/crates/mdman/doc/out/mdman.txt index 83fa7de9034..0701a803efd 100644 --- a/crates/mdman/doc/out/mdman.txt +++ b/crates/mdman/doc/out/mdman.txt @@ -4,7 +4,7 @@ NAME mdman - Converts markdown to a man page SYNOPSIS - mdman [options] -t type -o outdir sources... + mdman [options] -t type -o outdir sources… DESCRIPTION Converts a markdown file to a man page. @@ -65,7 +65,7 @@ OPTIONS finished. Outputs with the .md extension. o txt — A text file, rendered for situations where a man page - viewer isn't available. Outputs with the .txt extension. + viewer isn’t available. Outputs with the .txt extension. -o outdir Specifies the directory where to save the output. @@ -81,7 +81,7 @@ OPTIONS does not have a matching --man entry, then a relative link to a file named name.md will be used. - sources... + sources… The source input filename, may be specified multiple times. EXAMPLES From 2ae8c572a4e018d28bdcdc9e6c9b11e83ab0b7fe Mon Sep 17 00:00:00 2001 From: WANG Rui <wangrui@loongson.cn> Date: Mon, 1 May 2023 10:41:06 +0800 Subject: [PATCH 085/104] Fix warning with unused mut This is caused by https://github.com/rust-lang/rust/pull/110960 --- src/cargo/core/compiler/unit_dependencies.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/core/compiler/unit_dependencies.rs b/src/cargo/core/compiler/unit_dependencies.rs index 68fc1e5196d..3bf8b0c77a1 100644 --- a/src/cargo/core/compiler/unit_dependencies.rs +++ b/src/cargo/core/compiler/unit_dependencies.rs @@ -149,7 +149,7 @@ pub fn build_unit_dependencies<'a, 'cfg>( /// Compute all the dependencies for the standard library. fn calc_deps_of_std( - mut state: &mut State<'_, '_>, + state: &mut State<'_, '_>, std_roots: &HashMap<CompileKind, Vec<Unit>>, ) -> CargoResult<Option<UnitGraph>> { if std_roots.is_empty() { From 7cc3c00738a5ea68839bfae809cc5b36982ec93f Mon Sep 17 00:00:00 2001 From: Roj <rojserbest@icloud.com> Date: Mon, 1 May 2023 18:05:33 +0300 Subject: [PATCH 086/104] docs(commands): add missed preposition --- src/doc/src/commands/cargo-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/src/commands/cargo-install.md b/src/doc/src/commands/cargo-install.md index 99697c156c3..5d413010c45 100644 --- a/src/doc/src/commands/cargo-install.md +++ b/src/doc/src/commands/cargo-install.md @@ -238,7 +238,7 @@ is specified.</dd> <dt class="option-term" id="option-cargo-install---debug"><a class="option-anchor" href="#option-cargo-install---debug"></a><code>--debug</code></dt> -<dd class="option-desc">Build with the <code>dev</code> profile instead the <code>release</code> profile. +<dd class="option-desc">Build with the <code>dev</code> profile instead of the <code>release</code> profile. See also the <code>--profile</code> option for choosing a specific profile by name.</dd> From d07f9c516db68e7723dccdb1274cdd89d5d3614f Mon Sep 17 00:00:00 2001 From: Roj <ez@roj.im> Date: Mon, 1 May 2023 19:48:33 +0300 Subject: [PATCH 087/104] Change the right file --- src/doc/man/cargo-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/man/cargo-install.md b/src/doc/man/cargo-install.md index 31c3d604830..385ed27c268 100644 --- a/src/doc/man/cargo-install.md +++ b/src/doc/man/cargo-install.md @@ -173,7 +173,7 @@ Directory to install packages into. {{> options-target-dir }} {{#option "`--debug`" }} -Build with the `dev` profile instead the `release` profile. +Build with the `dev` profile instead of the `release` profile. See also the `--profile` option for choosing a specific profile by name. {{/option}} From 330503d012cc403cf0a4d7fdcce8a720412586eb Mon Sep 17 00:00:00 2001 From: Roj <ez@roj.im> Date: Mon, 1 May 2023 19:49:04 +0300 Subject: [PATCH 088/104] cargo build-man --- src/doc/man/generated_txt/cargo-install.txt | 4 ++-- src/etc/man/cargo-install.1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/man/generated_txt/cargo-install.txt b/src/doc/man/generated_txt/cargo-install.txt index a29cdcd46ec..7aefd34921e 100644 --- a/src/doc/man/generated_txt/cargo-install.txt +++ b/src/doc/man/generated_txt/cargo-install.txt @@ -207,8 +207,8 @@ OPTIONS workspace of the local crate unless --target-dir is specified. --debug - Build with the dev profile instead the release profile. See also the - --profile option for choosing a specific profile by name. + Build with the dev profile instead of the release profile. See also + the --profile option for choosing a specific profile by name. --profile name Install with the given profile. See the the reference diff --git a/src/etc/man/cargo-install.1 b/src/etc/man/cargo-install.1 index d0e5c518167..a9eb6266b89 100644 --- a/src/etc/man/cargo-install.1 +++ b/src/etc/man/cargo-install.1 @@ -263,7 +263,7 @@ is specified. .sp \fB\-\-debug\fR .RS 4 -Build with the \fBdev\fR profile instead the \fBrelease\fR profile. +Build with the \fBdev\fR profile instead of the \fBrelease\fR profile. See also the \fB\-\-profile\fR option for choosing a specific profile by name. .RE .sp From f9e34847730a3c9e129b36826716d0f107f85b77 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <obi1kenobi82@gmail.com> Date: Mon, 18 Jul 2022 10:33:55 -0400 Subject: [PATCH 089/104] Document that adding #[non_exhaustive] is a major breaking change. --- src/doc/src/reference/semver.md | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 22c42610f17..98b888e5749 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -90,6 +90,7 @@ considered incompatible. * [Major: generalizing a function to use generics with type mismatch](#fn-generalize-mismatch) * Attributes * [Major: switching from `no_std` support to requiring `std`](#attr-no-std-to-std) + * [Major: adding `non_exhaustive` to an existing enum, variant, or struct with no private fields](#attr-adding-non-exhaustive) * Tooling and environment compatibility * [Possibly-breaking: changing the minimum version of Rust required](#env-new-rust) * [Possibly-breaking: changing the platform and environment requirements](#env-change-requirements) @@ -1115,6 +1116,81 @@ Mitigation strategies: optionally enables `std` support, and when the feature is off, the library can be used in a `no_std` environment. +<a id="attr-adding-non-exhaustive"></a> +### Major: adding `non_exhaustive` to an existing enum, variant, or struct with no private fields + +Making items [`#[non_exhaustive]`][non_exhaustive] changes how they may +be used outside the crate where they are defined: +- Non-exhaustive structs and enum variants cannot be constructed + using [struct literal] syntax, including [functional update syntax]. +- Pattern matching on non-exhaustive enums always requires + a wildcard (`_`) arm. + +Structs with private fields cannot be constructed using [struct literal] syntax +regardless of whether [`#[non_exhaustive]`][non_exhaustive] is used. +Adding [`#[non_exhaustive]`][non_exhaustive] to such a struct is not +a breaking change. + +```rust,ignore +// MAJOR CHANGE + +/////////////////////////////////////////////////////////// +// Before +pub struct Foo { + pub bar: usize, +} + +pub enum Bar { + Baz, +} + +pub enum Quux { + X, + Y(a: usize), + Z { b: usize }, +} + +/////////////////////////////////////////////////////////// +// After +#[non_exhaustive] +pub struct Foo { + pub bar: usize, +} + +pub enum Bar { + #[non_exhaustive] X, + #[non_exhaustive] Y(usize), + #[non_exhaustive] Z { a: usize }, +} + +#[non_exhaustive] +pub enum Quux { + Var, +} + +/////////////////////////////////////////////////////////// +// Example usage that will break. +use updated_crate::{Foo, Bar, Quux}; + +fn main() { + let foo = Foo { bar: 0 }; // Error: cannot create non-exhaustive struct using struct expression + + let bar_x = Bar::X; // Error: unit variant `X` is private + let bar_y = Bar::Y(0); // Error: tuple variant `Y` is private + let bar_z = Bar::Z { a: 0 }; // Error: cannot create non-exhaustive variant using struct expression + + let q = Quux::Var; + match q { // Error: non-exhaustive patterns: `_` not covered + Quux::Var => 0, + } +} +``` + +Mitigation strategies: +* Mark structs, enums, and enum variants as + [`#[non_exhaustive]`][non_exhaustive] when first introducing them, + rather than adding [`#[non_exhaustive]`][non_exhaustive] later on. + ## Tooling and environment compatibility <a id="env-new-rust"></a> @@ -1393,6 +1469,7 @@ document what your commitments are. [Default]: ../../std/default/trait.Default.html [deprecated]: ../../reference/attributes/diagnostics.html#the-deprecated-attribute [disambiguation syntax]: ../../reference/expressions/call-expr.html#disambiguating-function-calls +[functional update syntax]: ../../reference/expressions/struct-expr.html#functional-update-syntax [inherent implementations]: ../../reference/items/implementations.html#inherent-implementations [items]: ../../reference/items.html [non_exhaustive]: ../../reference/attributes/type_system.html#the-non_exhaustive-attribute From 57b72d39868a2db1d0b9c6643d34f8bc3962cfb6 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <obi1kenobi82@gmail.com> Date: Mon, 18 Jul 2022 11:06:50 -0400 Subject: [PATCH 090/104] Fix example code. --- src/doc/src/reference/semver.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 98b888e5749..4809935277e 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -1146,8 +1146,8 @@ pub enum Bar { pub enum Quux { X, - Y(a: usize), - Z { b: usize }, + Y(usize), + Z { a: usize }, } /////////////////////////////////////////////////////////// From cb7957f7ffed177aa0e0a3197f13aee46537c1a4 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <obi1kenobi82@gmail.com> Date: Mon, 18 Jul 2022 11:40:27 -0400 Subject: [PATCH 091/104] Tweak example formatting. --- src/doc/src/reference/semver.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 4809935277e..6bc244fbc07 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -1180,8 +1180,9 @@ fn main() { let bar_z = Bar::Z { a: 0 }; // Error: cannot create non-exhaustive variant using struct expression let q = Quux::Var; - match q { // Error: non-exhaustive patterns: `_` not covered + match q { Quux::Var => 0, + // Error: non-exhaustive patterns: `_` not covered } } ``` From da331c2446ae966e1fb386b33476a7a511bcc8da Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <obi1kenobi82@gmail.com> Date: Mon, 18 Jul 2022 11:43:20 -0400 Subject: [PATCH 092/104] More formatting tweaks. --- src/doc/src/reference/semver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 6bc244fbc07..92752486b26 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -1170,7 +1170,7 @@ pub enum Quux { /////////////////////////////////////////////////////////// // Example usage that will break. -use updated_crate::{Foo, Bar, Quux}; +use updated_crate::{Bar, Foo, Quux}; fn main() { let foo = Foo { bar: 0 }; // Error: cannot create non-exhaustive struct using struct expression From e1d3a7d5e2caaaafcfd2d0ba691c32044f9337d7 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <obi1kenobi82@gmail.com> Date: Mon, 18 Jul 2022 11:54:35 -0400 Subject: [PATCH 093/104] Match up enums in the example. --- src/doc/src/reference/semver.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 92752486b26..6c8308403d9 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -1141,15 +1141,15 @@ pub struct Foo { } pub enum Bar { - Baz, -} - -pub enum Quux { X, Y(usize), Z { a: usize }, } +pub enum Quux { + Var, +} + /////////////////////////////////////////////////////////// // After #[non_exhaustive] @@ -1183,7 +1183,7 @@ fn main() { match q { Quux::Var => 0, // Error: non-exhaustive patterns: `_` not covered - } + }; } ``` From 65503f1643ed07aa4c80c871f326078c487f0223 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <obi1kenobi82@gmail.com> Date: Mon, 18 Jul 2022 11:58:21 -0400 Subject: [PATCH 094/104] Fix non_exhaustive formatting to rustfmt's liking. --- src/doc/src/reference/semver.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 6c8308403d9..5336806502f 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -1158,9 +1158,14 @@ pub struct Foo { } pub enum Bar { - #[non_exhaustive] X, - #[non_exhaustive] Y(usize), - #[non_exhaustive] Z { a: usize }, + #[non_exhaustive] + X, + + #[non_exhaustive] + Y(usize), + + #[non_exhaustive] + Z { a: usize }, } #[non_exhaustive] From 19f0f66b0f5b23c611a89db2600e6aa081e6ba85 Mon Sep 17 00:00:00 2001 From: Eric Huss <eric@huss.org> Date: Mon, 1 May 2023 11:15:37 -0700 Subject: [PATCH 095/104] Add some clarifications on what happens when `non_exhaustive` is added. --- src/doc/src/reference/semver.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 5336806502f..799438967a1 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -1121,10 +1121,12 @@ Mitigation strategies: Making items [`#[non_exhaustive]`][non_exhaustive] changes how they may be used outside the crate where they are defined: + - Non-exhaustive structs and enum variants cannot be constructed using [struct literal] syntax, including [functional update syntax]. -- Pattern matching on non-exhaustive enums always requires - a wildcard (`_`) arm. +- Pattern matching on non-exhaustive structs requires `..` and + matching on enums does not count towards exhaustiveness. +- Casting enum variants to their discriminant with `as` is not allowed. Structs with private fields cannot be constructed using [struct literal] syntax regardless of whether [`#[non_exhaustive]`][non_exhaustive] is used. From c758ae935ab71ae0b2e4552fa04149aec052a8a9 Mon Sep 17 00:00:00 2001 From: cui fliter <imcusg@gmail.com> Date: Mon, 1 May 2023 14:28:48 +0800 Subject: [PATCH 096/104] Remove repeated definite articles Signed-off-by: cui fliter <imcusg@gmail.com> --- crates/home/src/env.rs | 2 +- crates/mdman/doc/mdman.md | 2 +- crates/mdman/doc/out/mdman.1 | 2 +- crates/mdman/doc/out/mdman.md | 2 +- crates/mdman/doc/out/mdman.txt | 2 +- src/doc/src/reference/semver.md | 2 +- src/doc/src/reference/unstable.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/home/src/env.rs b/crates/home/src/env.rs index e47273bc859..49fea54220c 100644 --- a/crates/home/src/env.rs +++ b/crates/home/src/env.rs @@ -9,7 +9,7 @@ use std::{ /// Permits parameterizing the home functions via the _from variants - used for /// in-process unit testing by rustup. pub trait Env { - /// Return the path to the the users home dir, or None if any error occurs: + /// Return the path to the users home dir, or None if any error occurs: /// see home_inner. fn home_dir(&self) -> Option<PathBuf>; /// Return the current working directory. diff --git a/crates/mdman/doc/mdman.md b/crates/mdman/doc/mdman.md index 2025c13dc3d..bfa394648ca 100644 --- a/crates/mdman/doc/mdman.md +++ b/crates/mdman/doc/mdman.md @@ -28,7 +28,7 @@ man page: and `{{/options}}` tags. This tells the processor where the options start and end. - Each option must be expressed with a `{{#option}}` block. The parameters to - the the block are a sequence of strings indicating the option. For example, + the block are a sequence of strings indicating the option. For example, ```{{#option "`-p` _spec_..." "`--package` _spec_..."}}``` is an option that has two different forms. The text within the string is processed as markdown. It is recommended to use formatting similar to this example. diff --git a/crates/mdman/doc/out/mdman.1 b/crates/mdman/doc/out/mdman.1 index f9218c94d7a..b114715aef2 100644 --- a/crates/mdman/doc/out/mdman.1 +++ b/crates/mdman/doc/out/mdman.1 @@ -29,7 +29,7 @@ and end. .sp .RS 4 \h'-04'\(bu\h'+02'Each option must be expressed with a \fB{{#option}}\fR block. The parameters to -the the block are a sequence of strings indicating the option. For example, +the block are a sequence of strings indicating the option. For example, \fB{{#option "`\-p` _spec_..." "`\-\-package` _spec_..."}}\fR is an option that has two different forms. The text within the string is processed as markdown. It is recommended to use formatting similar to this example. diff --git a/crates/mdman/doc/out/mdman.md b/crates/mdman/doc/out/mdman.md index db7c113af16..9d2fe932684 100644 --- a/crates/mdman/doc/out/mdman.md +++ b/crates/mdman/doc/out/mdman.md @@ -27,7 +27,7 @@ man page: and `{{/options}}` tags. This tells the processor where the options start and end. - Each option must be expressed with a `{{#option}}` block. The parameters to - the the block are a sequence of strings indicating the option. For example, + the block are a sequence of strings indicating the option. For example, ```{{#option "`-p` _spec_..." "`--package` _spec_..."}}``` is an option that has two different forms. The text within the string is processed as markdown. It is recommended to use formatting similar to this example. diff --git a/crates/mdman/doc/out/mdman.txt b/crates/mdman/doc/out/mdman.txt index 0701a803efd..6c8dcd65d19 100644 --- a/crates/mdman/doc/out/mdman.txt +++ b/crates/mdman/doc/out/mdman.txt @@ -25,7 +25,7 @@ DESCRIPTION the options start and end. o Each option must be expressed with a {{#option}} block. The - parameters to the the block are a sequence of strings indicating the + parameters to the block are a sequence of strings indicating the option. For example, {{#option "`-p` _spec_..." "`--package` _spec_..."}} is an option that has two different forms. The text within the string is processed as markdown. It is recommended to use diff --git a/src/doc/src/reference/semver.md b/src/doc/src/reference/semver.md index 799438967a1..fccbd02f97e 100644 --- a/src/doc/src/reference/semver.md +++ b/src/doc/src/reference/semver.md @@ -871,7 +871,7 @@ fn main() { It is safe to change a generic type to a more generic one. For example, the following adds a generic parameter that defaults to the original type, which is safe because all existing users will be using the same type for both -fields, the the defaulted parameter does not need to be specified. +fields, the defaulted parameter does not need to be specified. ```rust,ignore // MINOR CHANGE diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index cc1a36ea574..1ec0e18fa2f 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -1260,7 +1260,7 @@ codegen-backend = "cranelift" * Tracking Issue: [#11813](https://github.com/rust-lang/cargo/issues/11813) -With the 'gitoxide' unstable feature, all or the the specified git operations will be performed by +With the 'gitoxide' unstable feature, all or the specified git operations will be performed by the `gitoxide` crate instead of `git2`. While `-Zgitoxide` enables all currently implemented features, one can individually select git operations From 3d550da29a3d7230f89b9ab788f119769a13e04a Mon Sep 17 00:00:00 2001 From: Bhardwaj-Himanshu <himanshujay261201@gmail.com> Date: Tue, 2 May 2023 19:02:23 +0530 Subject: [PATCH 097/104] docs(registry): further specify owner-remove response --- src/doc/src/reference/registry-web-api.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/doc/src/reference/registry-web-api.md b/src/doc/src/reference/registry-web-api.md index 347eb7280b9..8260028c020 100644 --- a/src/doc/src/reference/registry-web-api.md +++ b/src/doc/src/reference/registry-web-api.md @@ -308,6 +308,8 @@ A successful response includes the JSON object: { // Indicates the remove succeeded, always true. "ok": true + // A string to be displayed to the user. Currently ignored by cargo. + "msg": "owners successfully removed", } ``` From 6d463b1919c900b589719f3497d588b606841934 Mon Sep 17 00:00:00 2001 From: Ted Kaminski <tedinski@cs.umn.edu> Date: Fri, 21 Apr 2023 12:28:01 -0500 Subject: [PATCH 098/104] Build by PackageIdSpec, not name, to avoid ambiguity --- src/cargo/ops/cargo_install.rs | 7 +++++-- tests/testsuite/install.rs | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/cargo/ops/cargo_install.rs b/src/cargo/ops/cargo_install.rs index 53c3e72f79a..fc908051c88 100644 --- a/src/cargo/ops/cargo_install.rs +++ b/src/cargo/ops/cargo_install.rs @@ -4,7 +4,9 @@ use std::sync::Arc; use std::{env, fs}; use crate::core::compiler::{CompileKind, DefaultExecutor, Executor, UnitOutput}; -use crate::core::{Dependency, Edition, Package, PackageId, Source, SourceId, Target, Workspace}; +use crate::core::{ + Dependency, Edition, Package, PackageId, PackageIdSpec, Source, SourceId, Target, Workspace, +}; use crate::ops::{common_for_install_and_uninstall::*, FilterRule}; use crate::ops::{CompileFilter, Packages}; use crate::sources::{GitSource, PathSource, SourceConfigMap}; @@ -173,7 +175,8 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> { // specialized compile options specific to the identified package. // See test `path_install_workspace_root_despite_default_members`. let mut opts = original_opts.clone(); - opts.spec = Packages::Packages(vec![pkg.name().to_string()]); + let pkgidspec = PackageIdSpec::from_package_id(pkg.package_id()); + opts.spec = Packages::Packages(vec![pkgidspec.to_string()]); let (ws, rustc, target) = make_ws_rustc_target(config, &opts, &source_id, pkg.clone())?; // If we're installing in --locked mode and there's no `Cargo.lock` published diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index dd9844f170b..2447f0a79d4 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -2287,3 +2287,39 @@ fn sparse_install() { "#, ); } + +#[cargo_test] +fn self_referential() { + // Some packages build-dep on prior versions of themselves. + Package::new("foo", "0.0.1") + .file("src/lib.rs", "fn hello() {}") + .file("src/main.rs", "fn main() {}") + .file("build.rs", "fn main() {}") + .publish(); + Package::new("foo", "0.0.2") + .file("src/lib.rs", "fn hello() {}") + .file("src/main.rs", "fn main() {}") + .file("build.rs", "fn main() {}") + .build_dep("foo", "0.0.1") + .publish(); + + cargo_process("install foo") + .with_stderr( + "\ +[UPDATING] `[..]` index +[DOWNLOADING] crates ... +[DOWNLOADED] foo v0.0.2 (registry [..]) +[INSTALLING] foo v0.0.2 +[DOWNLOADING] crates ... +[DOWNLOADED] foo v0.0.1 (registry [..]) +[COMPILING] foo v0.0.1 +[COMPILING] foo v0.0.2 +[FINISHED] release [optimized] target(s) in [..] +[INSTALLING] [CWD]/home/.cargo/bin/foo[EXE] +[INSTALLED] package `foo v0.0.2` (executable `foo[EXE]`) +[WARNING] be sure to add `[..]` to your PATH to be able to run the installed binaries +", + ) + .run(); + assert_has_installed_exe(cargo_home(), "foo"); +} From 17365e724d17ab5dadd90e87c05d1c05b54d5b8e Mon Sep 17 00:00:00 2001 From: Ted Kaminski <tedinski@cs.umn.edu> Date: Fri, 21 Apr 2023 13:49:32 -0500 Subject: [PATCH 099/104] Determine pkg-spec from workspace, not original package which may be a git url --- src/cargo/ops/cargo_install.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/cargo/ops/cargo_install.rs b/src/cargo/ops/cargo_install.rs index fc908051c88..a183975fb0e 100644 --- a/src/cargo/ops/cargo_install.rs +++ b/src/cargo/ops/cargo_install.rs @@ -170,15 +170,8 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> { } }; - // When we build this package, we want to build the *specified* package only, - // and avoid building e.g. workspace default-members instead. Do so by constructing - // specialized compile options specific to the identified package. - // See test `path_install_workspace_root_despite_default_members`. - let mut opts = original_opts.clone(); - let pkgidspec = PackageIdSpec::from_package_id(pkg.package_id()); - opts.spec = Packages::Packages(vec![pkgidspec.to_string()]); - - let (ws, rustc, target) = make_ws_rustc_target(config, &opts, &source_id, pkg.clone())?; + let (ws, rustc, target) = + make_ws_rustc_target(config, &original_opts, &source_id, pkg.clone())?; // If we're installing in --locked mode and there's no `Cargo.lock` published // ie. the bin was published before https://github.com/rust-lang/cargo/pull/7026 if config.locked() && !ws.root().join("Cargo.lock").exists() { @@ -195,6 +188,16 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> { ws.current()?.clone() }; + // When we build this package, we want to build the *specified* package only, + // and avoid building e.g. workspace default-members instead. Do so by constructing + // specialized compile options specific to the identified package. + // See test `path_install_workspace_root_despite_default_members`. + let mut opts = original_opts.clone(); + // Unlike install source tracking (for --git, see above), use the spec url from the + // build workspace (hence unconditional `ws.current()` instead of `pkg` to get `package_id()`). + let pkgidspec = PackageIdSpec::from_package_id(ws.current()?.package_id()); + opts.spec = Packages::Packages(vec![pkgidspec.to_string()]); + if from_cwd { if pkg.manifest().edition() == Edition::Edition2015 { config.shell().warn( From e5e26530ca37041eae3f2db415337a3b0c92c83d Mon Sep 17 00:00:00 2001 From: Ted Kaminski <tedinski@cs.umn.edu> Date: Mon, 1 May 2023 17:21:37 -0500 Subject: [PATCH 100/104] Update pkg-spec comment, and add 2 more test cases --- src/cargo/ops/cargo_install.rs | 5 +- tests/testsuite/install.rs | 85 ++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/src/cargo/ops/cargo_install.rs b/src/cargo/ops/cargo_install.rs index a183975fb0e..5f843e8c731 100644 --- a/src/cargo/ops/cargo_install.rs +++ b/src/cargo/ops/cargo_install.rs @@ -193,8 +193,9 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> { // specialized compile options specific to the identified package. // See test `path_install_workspace_root_despite_default_members`. let mut opts = original_opts.clone(); - // Unlike install source tracking (for --git, see above), use the spec url from the - // build workspace (hence unconditional `ws.current()` instead of `pkg` to get `package_id()`). + // For cargo install tracking, we retain the source git url in `pkg`, but for the build spec + // we need to unconditionally use `ws.current()` to correctly address the path where we + // locally cloned that repo. let pkgidspec = PackageIdSpec::from_package_id(ws.current()?.package_id()); opts.spec = Packages::Packages(vec![pkgidspec.to_string()]); diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index 2447f0a79d4..a0a77c2d6ca 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -1415,6 +1415,46 @@ fn path_install_workspace_root_despite_default_members() { .run(); } +#[cargo_test] +fn git_install_workspace_root_despite_default_members() { + let p = git::repo(&paths::root().join("foo")) + .file( + "Cargo.toml", + r#" + [package] + name = "ws-root" + version = "0.1.0" + authors = [] + + [workspace] + members = ["ws-member"] + default-members = ["ws-member"] + "#, + ) + .file("src/main.rs", "fn main() {}") + .file( + "ws-member/Cargo.toml", + r#" + [package] + name = "ws-member" + version = "0.1.0" + authors = [] + "#, + ) + .file("ws-member/src/main.rs", "fn main() {}") + .build(); + + cargo_process("install --git") + .arg(p.url().to_string()) + .arg("ws-root") + .with_stderr_contains( + "[INSTALLED] package `ws-root v0.1.0 ([..])` (executable `ws-root[EXE]`)", + ) + // Particularly avoid "Installed package `ws-root v0.1.0 ([..]])` (executable `ws-member`)": + .with_stderr_does_not_contain("ws-member") + .run(); +} + #[cargo_test] fn dev_dependencies_no_check() { Package::new("foo", "1.0.0").publish(); @@ -2323,3 +2363,48 @@ fn self_referential() { .run(); assert_has_installed_exe(cargo_home(), "foo"); } + +#[cargo_test] +fn ambiguous_registry_vs_local_workspace_package() { + // Correctly install 'foo' from a workspace, even if that workspace + // (somewhere) also depends on a registry package named 'foo'. + Package::new("foo", "0.0.1") + .file("src/lib.rs", "fn hello() {}") + .publish(); + + let p = project() + .file("src/main.rs", "fn main() {}") + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.1.0" + authors = [] + edition = "2021" + + [dependencies] + foo = "0.0.1" + "#, + ) + .build(); + + cargo_process("install --path") + .arg(p.root()) + .with_stderr( + "\ +[INSTALLING] foo v0.1.0 ([..]) +[UPDATING] `[..]` index +[DOWNLOADING] crates ... +[DOWNLOADED] foo v0.0.1 (registry [..]) +[COMPILING] foo v0.0.1 +[COMPILING] foo v0.1.0 ([..]) +[FINISHED] release [optimized] target(s) in [..] +[INSTALLING] [CWD]/home/.cargo/bin/foo[EXE] +[INSTALLED] package `foo v0.1.0 ([..])` (executable `foo[EXE]`) +[WARNING] be sure to add `[..]` to your PATH to be able to run the installed binaries +", + ) + .run(); + assert_has_installed_exe(cargo_home(), "foo"); +} From c00e27e0728077569465e338f98c139259e1f446 Mon Sep 17 00:00:00 2001 From: Weihang Lo <me@weihanglo.tw> Date: Wed, 3 May 2023 01:04:18 +0100 Subject: [PATCH 101/104] test(install): correct the term workspace -> local packagd --- tests/testsuite/install.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testsuite/install.rs b/tests/testsuite/install.rs index a0a77c2d6ca..9b881dfdc68 100644 --- a/tests/testsuite/install.rs +++ b/tests/testsuite/install.rs @@ -2365,9 +2365,9 @@ fn self_referential() { } #[cargo_test] -fn ambiguous_registry_vs_local_workspace_package() { - // Correctly install 'foo' from a workspace, even if that workspace - // (somewhere) also depends on a registry package named 'foo'. +fn ambiguous_registry_vs_local_package() { + // Correctly install 'foo' from a local package, even if that package also + // depends on a registry dependency named 'foo'. Package::new("foo", "0.0.1") .file("src/lib.rs", "fn hello() {}") .publish(); From 48dcdfa5f11cfcd2b5e3f8de709fb3fc5afb93ac Mon Sep 17 00:00:00 2001 From: charles-r-earp <charles.r.earp@gmail.com> Date: Tue, 2 May 2023 23:19:22 -0700 Subject: [PATCH 102/104] Updated docs. --- src/doc/man/cargo-metadata.md | 6 ++++++ src/doc/man/generated_txt/cargo-metadata.txt | 6 ++++++ src/doc/src/commands/cargo-metadata.md | 6 ++++++ src/etc/man/cargo-metadata.1 | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/src/doc/man/cargo-metadata.md b/src/doc/man/cargo-metadata.md index 4f9032d56cc..0027a20b1f4 100644 --- a/src/doc/man/cargo-metadata.md +++ b/src/doc/man/cargo-metadata.md @@ -212,6 +212,12 @@ The output has the following format: "workspace_members": [ "my-package 0.1.0 (path+file:///path/to/my-package)", ], + /* Array of default members of the workspace. + Each entry is the Package ID for the package. + */ + "workspace_default_members": [ + "my-package 0.1.0 (path+file:///path/to/my-package)", + ], // The resolved dependency graph for the entire workspace. The enabled // features are based on the enabled features for the "current" package. // Inactivated optional dependencies are not listed. diff --git a/src/doc/man/generated_txt/cargo-metadata.txt b/src/doc/man/generated_txt/cargo-metadata.txt index be8bed7c66f..d9d48fd9a74 100644 --- a/src/doc/man/generated_txt/cargo-metadata.txt +++ b/src/doc/man/generated_txt/cargo-metadata.txt @@ -207,6 +207,12 @@ OUTPUT FORMAT "workspace_members": [ "my-package 0.1.0 (path+file:///path/to/my-package)", ], + /* Array of default members of the workspace. + Each entry is the Package ID for the package. + */ + "workspace_default_members": [ + "my-package 0.1.0 (path+file:///path/to/my-package)", + ], // The resolved dependency graph for the entire workspace. The enabled // features are based on the enabled features for the "current" package. // Inactivated optional dependencies are not listed. diff --git a/src/doc/src/commands/cargo-metadata.md b/src/doc/src/commands/cargo-metadata.md index ebde0ea101c..e9aeac7dfa7 100644 --- a/src/doc/src/commands/cargo-metadata.md +++ b/src/doc/src/commands/cargo-metadata.md @@ -212,6 +212,12 @@ The output has the following format: "workspace_members": [ "my-package 0.1.0 (path+file:///path/to/my-package)", ], + /* Array of default members of the workspace. + Each entry is the Package ID for the package. + */ + "workspace_default_members": [ + "my-package 0.1.0 (path+file:///path/to/my-package)", + ], // The resolved dependency graph for the entire workspace. The enabled // features are based on the enabled features for the "current" package. // Inactivated optional dependencies are not listed. diff --git a/src/etc/man/cargo-metadata.1 b/src/etc/man/cargo-metadata.1 index 8549290cde5..f2ebb63c7eb 100644 --- a/src/etc/man/cargo-metadata.1 +++ b/src/etc/man/cargo-metadata.1 @@ -209,6 +209,12 @@ The output has the following format: "workspace_members": [ "my\-package 0.1.0 (path+file:///path/to/my\-package)", ], + /* Array of default members of the workspace. + Each entry is the Package ID for the package. + */ + "workspace_default_members": [ + "my\-package 0.1.0 (path+file:///path/to/my\-package)", + ], // The resolved dependency graph for the entire workspace. The enabled // features are based on the enabled features for the "current" package. // Inactivated optional dependencies are not listed. From 5ff0fbd8588d2bd633010e24d9b4eb48fd9e16b4 Mon Sep 17 00:00:00 2001 From: charles-r-earp <charles.r.earp@gmail.com> Date: Wed, 3 May 2023 00:23:51 -0700 Subject: [PATCH 103/104] Added workspace_default_members to tests. --- tests/testsuite/metadata.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testsuite/metadata.rs b/tests/testsuite/metadata.rs index 299f5245dd4..95c13819626 100644 --- a/tests/testsuite/metadata.rs +++ b/tests/testsuite/metadata.rs @@ -1954,6 +1954,7 @@ const MANIFEST_OUTPUT: &str = r#" "documentation": null }], "workspace_members": [ "foo 0.5.0 (path+file:[..]foo)" ], + "workspace_default_members": [ "foo 0.5.0 (path+file:[..]foo)" ], "resolve": null, "target_directory": "[..]foo/target", "version": 1, @@ -2318,6 +2319,7 @@ fn cargo_metadata_path_to_cargo_toml_project() { "workspace_members": [ "bar 0.5.0 (path+file:[..])" ], + "workspace_default_members": [], "workspace_root": "[..]", "metadata": null } From 4461032952bda70cab10cdfb8926e34a60bd955d Mon Sep 17 00:00:00 2001 From: charles-r-earp <charles.r.earp@gmail.com> Date: Wed, 3 May 2023 01:37:37 -0700 Subject: [PATCH 104/104] Added workspace_default_members to more tests. --- tests/testsuite/alt_registry.rs | 9 ++++ tests/testsuite/features_namespaced.rs | 1 + tests/testsuite/git.rs | 3 ++ tests/testsuite/metadata.rs | 57 +++++++++++++++++++++++++- 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs index e9dd0071e06..ac60ca92fa8 100644 --- a/tests/testsuite/alt_registry.rs +++ b/tests/testsuite/alt_registry.rs @@ -902,6 +902,9 @@ fn alt_reg_metadata() { "workspace_members": [ "foo 0.0.1 (path+file:[..]/foo)" ], + "workspace_default_members": [ + "foo 0.0.1 (path+file:[..]/foo)" + ], "resolve": null, "target_directory": "[..]/foo/target", "version": 1, @@ -1102,6 +1105,9 @@ fn alt_reg_metadata() { "workspace_members": [ "foo 0.0.1 (path+file:[..]/foo)" ], + "workspace_default_members": [ + "foo 0.0.1 (path+file:[..]/foo)" + ], "resolve": "{...}", "target_directory": "[..]/foo/target", "version": 1, @@ -1265,6 +1271,9 @@ fn unknown_registry() { "workspace_members": [ "foo 0.0.1 (path+file://[..]/foo)" ], + "workspace_default_members": [ + "foo 0.0.1 (path+file://[..]/foo)" + ], "resolve": "{...}", "target_directory": "[..]/foo/target", "version": 1, diff --git a/tests/testsuite/features_namespaced.rs b/tests/testsuite/features_namespaced.rs index d090235d5ab..a6047231beb 100644 --- a/tests/testsuite/features_namespaced.rs +++ b/tests/testsuite/features_namespaced.rs @@ -609,6 +609,7 @@ fn json_exposed() { } ], "workspace_members": "{...}", + "workspace_default_members": "{...}", "resolve": null, "target_directory": "[..]foo/target", "version": 1, diff --git a/tests/testsuite/git.rs b/tests/testsuite/git.rs index b170c204f75..5ac4d46b457 100644 --- a/tests/testsuite/git.rs +++ b/tests/testsuite/git.rs @@ -3421,6 +3421,9 @@ fn metadata_master_consistency() { "workspace_members": [ "foo 0.1.0 [..]" ], + "workspace_default_members": [ + "foo 0.1.0 [..]" + ], "resolve": { "nodes": [ { diff --git a/tests/testsuite/metadata.rs b/tests/testsuite/metadata.rs index 95c13819626..ac2cec39661 100644 --- a/tests/testsuite/metadata.rs +++ b/tests/testsuite/metadata.rs @@ -165,6 +165,7 @@ crate-type = ["lib", "staticlib"] } ], "workspace_members": ["foo 0.5.0 (path+file:[..]foo)"], + "workspace_default_members": ["foo 0.5.0 (path+file:[..]foo)"], "resolve": { "nodes": [ { @@ -258,6 +259,7 @@ optional_feat = [] } ], "workspace_members": ["foo 0.5.0 (path+file:[..]foo)"], + "workspace_default_members": ["foo 0.5.0 (path+file:[..]foo)"], "resolve": { "nodes": [ { @@ -588,6 +590,9 @@ fn cargo_metadata_with_deps_and_version() { "workspace_members": [ "foo 0.5.0 (path+file:[..]foo)" ], + "workspace_default_members": [ + "foo 0.5.0 (path+file:[..]foo)" + ], "workspace_root": "[..]/foo", "metadata": null }"#, @@ -669,6 +674,9 @@ name = "ex" "workspace_members": [ "foo 0.1.0 (path+file:[..]foo)" ], + "workspace_default_members": [ + "foo 0.1.0 (path+file:[..]foo)" + ], "resolve": { "root": "foo 0.1.0 (path+file://[..]foo)", "nodes": [ @@ -763,6 +771,9 @@ crate-type = ["rlib", "dylib"] ], "workspace_members": [ "foo 0.1.0 (path+file:[..]foo)" + ], + "workspace_default_members": [ + "foo 0.1.0 (path+file:[..]foo)" ], "resolve": { "root": "foo 0.1.0 (path+file://[..]foo)", @@ -893,6 +904,7 @@ fn workspace_metadata() { } ], "workspace_members": ["bar 0.5.0 (path+file:[..]bar)", "baz 0.5.0 (path+file:[..]baz)"], + "workspace_default_members": ["bar 0.5.0 (path+file:[..]bar)", "baz 0.5.0 (path+file:[..]baz)"], "resolve": { "nodes": [ { @@ -1124,6 +1136,11 @@ fn workspace_metadata_with_dependencies_no_deps() { "artifact 0.5.0 (path+file:[..]/foo/artifact)", "baz 0.5.0 (path+file:[..]baz)" ], + "workspace_default_members": [ + "bar 0.5.0 (path+file:[..]bar)", + "artifact 0.5.0 (path+file:[..]/foo/artifact)", + "baz 0.5.0 (path+file:[..]baz)" + ], "resolve": null, "target_directory": "[..]foo/target", "version": 1, @@ -1756,6 +1773,12 @@ fn workspace_metadata_with_dependencies_and_resolve() { "bin-only-artifact 0.5.0 (path+file://[..]/foo/bin-only-artifact)", "non-artifact 0.5.0 (path+file://[..]/foo/non-artifact)" ], + "workspace_default_members": [ + "bar 0.5.0 (path+file://[..]/foo/bar)", + "artifact 0.5.0 (path+file://[..]/foo/artifact)", + "bin-only-artifact 0.5.0 (path+file://[..]/foo/bin-only-artifact)", + "non-artifact 0.5.0 (path+file://[..]/foo/non-artifact)" + ], "workspace_root": "[..]/foo" } "#, @@ -2149,6 +2172,7 @@ fn package_metadata() { } ], "workspace_members": ["foo[..]"], + "workspace_default_members": ["foo[..]"], "resolve": null, "target_directory": "[..]foo/target", "version": 1, @@ -2224,6 +2248,7 @@ fn package_publish() { } ], "workspace_members": ["foo[..]"], + "workspace_default_members": ["foo[..]"], "resolve": null, "target_directory": "[..]foo/target", "version": 1, @@ -2319,7 +2344,9 @@ fn cargo_metadata_path_to_cargo_toml_project() { "workspace_members": [ "bar 0.5.0 (path+file:[..])" ], - "workspace_default_members": [], + "workspace_default_members": [ + "bar 0.5.0 (path+file:[..])" + ], "workspace_root": "[..]", "metadata": null } @@ -2408,6 +2435,9 @@ fn package_edition_2018() { "workspace_members": [ "foo 0.1.0 (path+file:[..])" ], + "workspace_default_members": [ + "foo 0.1.0 (path+file:[..])" + ], "workspace_root": "[..]", "metadata": null } @@ -2556,6 +2586,9 @@ fn target_edition_2018() { "workspace_members": [ "foo 0.1.0 (path+file:[..])" ], + "workspace_default_members": [ + "foo 0.1.0 (path+file:[..])" + ], "workspace_root": "[..]", "metadata": null } @@ -2792,6 +2825,9 @@ fn rename_dependency() { "workspace_members": [ "foo 0.0.1[..]" ], + "workspace_default_members": [ + "foo 0.0.1[..]" + ], "workspace_root": "[..]", "metadata": null }"#, @@ -2892,6 +2928,9 @@ fn metadata_links() { "workspace_members": [ "foo 0.5.0 [..]" ], + "workspace_default_members": [ + "foo 0.5.0 [..]" + ], "workspace_root": "[..]/foo", "metadata": null } @@ -2982,6 +3021,9 @@ fn deps_with_bin_only() { "workspace_members": [ "foo 0.1.0 ([..])" ], + "workspace_default_members": [ + "foo 0.1.0 ([..])" + ], "resolve": { "nodes": [ { @@ -3361,6 +3403,9 @@ fn filter_platform() { "workspace_members": [ "foo 0.1.0 (path+file:[..]foo)" ], + "workspace_default_members": [ + "foo 0.1.0 (path+file:[..]foo)" + ], "resolve": { "nodes": [ { @@ -3480,6 +3525,7 @@ fn filter_platform() { $NORMAL_DEP ], "workspace_members": "{...}", + "workspace_default_members": "{...}", "resolve": { "nodes": [ { @@ -3561,6 +3607,7 @@ fn filter_platform() { $NORMAL_DEP ], "workspace_members": "{...}", + "workspace_default_members": "{...}", "resolve": { "nodes": [ { @@ -3645,6 +3692,7 @@ fn filter_platform() { $NORMAL_DEP ], "workspace_members": "{...}", + "workspace_default_members": "{...}", "resolve": { "nodes": [ { @@ -3759,6 +3807,7 @@ fn dep_kinds() { { "packages": "{...}", "workspace_members": "{...}", + "workspace_default_members": "{...}", "target_directory": "{...}", "version": 1, "workspace_root": "{...}", @@ -3874,6 +3923,7 @@ fn dep_kinds_workspace() { { "packages": "{...}", "workspace_members": "{...}", + "workspace_default_members": "{...}", "target_directory": "[..]/foo/target", "version": 1, "workspace_root": "[..]/foo", @@ -4187,6 +4237,11 @@ fn workspace_metadata_with_dependencies_no_deps_artifact() { "artifact 0.5.0 (path+file://[..]/foo/artifact)", "baz 0.5.0 (path+file://[..]/foo/baz)" ], + "workspace_default_members": [ + "bar 0.5.0 (path+file://[..]/foo/bar)", + "artifact 0.5.0 (path+file://[..]/foo/artifact)", + "baz 0.5.0 (path+file://[..]/foo/baz)" + ], "workspace_root": "[..]/foo" } "#,