diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 230c9035f..ad1a18bd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,15 @@ on: env: RUST_BACKTRACE: 1 + DOCSRS_PREFIX: ignored/cratesfyi-prefix + DOCSRS_DATABASE_URL: postgresql://cratesfyi:password@localhost:15432 + DOCSRS_LOG: docs_rs=debug,rustwide=info + AWS_ACCESS_KEY_ID: cratesfyi + AWS_SECRET_ACCESS_KEY: secret_key + S3_ENDPOINT: http://localhost:9000 + DOCSRS_INCLUDE_DEFAULT_TARGETS: false + DOCSRS_DOCKER_IMAGE: ghcr.io/rust-lang/crates-build-env/linux-micro + SENTRY_ENVIRONMENT: dev jobs: build: @@ -57,7 +66,6 @@ jobs: - name: Launch postgres and min.io run: | cp .env.sample .env - . .env mkdir -p ${DOCSRS_PREFIX}/public-html docker-compose up -d db s3 # Give the database enough time to start up @@ -93,7 +101,6 @@ jobs: - name: Launch postgres and min.io run: | cp .env.sample .env - . .env mkdir -p ${DOCSRS_PREFIX}/public-html docker-compose up -d db s3 # Give the database enough time to start up @@ -104,13 +111,12 @@ jobs: - name: slow tests env: DOCSRS_INCLUDE_DEFAULT_TARGETS: true - DOCSRS_DOCKER_IMAGE: ghcr.io/rust-lang/crates-build-env/linux-micro run: | for f in ./test-binaries/*; do echo "running $f" chmod +x $f # GH action artifacts don't handle permissions # run build-tests. Limited to one thread since we don't support parallel builds. - $f --ignored --test-threads=1 || exit 1 + $f --ignored --test-threads=1 || exit 1 done - name: Clean up the database diff --git a/Cargo.lock b/Cargo.lock index 091f18ab7..d3d827605 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,6 +37,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "android_system_properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -48,9 +57,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.58" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" +checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" dependencies = [ "backtrace", ] @@ -67,9 +76,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", @@ -119,9 +128,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aws-config" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a8c971b0cb0484fc9436a291a44503b95141edc36ce7a6af6b6d7a06a02ab0" +checksum = "c2a3ad9e793335d75b2d2faad583487efcc0df9154aff06f299a5c1fc8795698" dependencies = [ "aws-http", "aws-sdk-sso", @@ -138,6 +147,7 @@ dependencies = [ "http", "hyper 0.14.20", "ring", + "time 0.3.14", "tokio", "tower", "tracing", @@ -146,9 +156,9 @@ dependencies = [ [[package]] name = "aws-endpoint" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc956f415dda77215372e5bc751a2463d1f9a1ec34edf3edc6c0ff67e5c8e43" +checksum = "8bd4e9dad553017821ee529f186e033700e8d61dd5c4b60066b4d8fe805b8cfc" dependencies = [ "aws-smithy-http", "aws-types", @@ -159,9 +169,9 @@ dependencies = [ [[package]] name = "aws-http" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a0d98a1d606aa24554e604f220878db4aa3b525b72f88798524497cc3867fc6" +checksum = "2ef5a579a51d352b628b76f4855ba716be686305e5e59970c476d1ae2214e90d" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -177,15 +187,16 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f6e22f5641db610235c0c5fb768b5925a6317b16b12e4ab5a625cfed176f8a2" +checksum = "0d2c19b69297f16b3f18936e363f954e7504c23a4a0dc3f2833712313c09c2aa" dependencies = [ "aws-endpoint", "aws-http", "aws-sig-auth", "aws-sigv4", "aws-smithy-async", + "aws-smithy-checksums", "aws-smithy-client", "aws-smithy-eventstream", "aws-smithy-http", @@ -194,17 +205,19 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", + "bytes-utils", "http", - "md-5", + "http-body", "tokio-stream", "tower", + "tracing", ] [[package]] name = "aws-sdk-sso" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa0c66fab12976065403cf4cafacffe76afa91d0da335d195af379d4223d235" +checksum = "f014b8ad3178b414bf732b36741325ef659fc40752f8c292400fb7c4ecb7fdd0" dependencies = [ "aws-endpoint", "aws-http", @@ -224,9 +237,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048037cdfd7f42fb29b5f969c7f639b4b7eac00e8f911e4eac4f89fb7b3a0500" +checksum = "d37e45fdce84327c69fb924b9188fd889056c6afafbd494e8dd0daa400f9c082" dependencies = [ "aws-endpoint", "aws-http", @@ -246,9 +259,9 @@ dependencies = [ [[package]] name = "aws-sig-auth" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8386fc0d218dbf2011f65bd8300d21ba98603fd150b962f61239be8b02d1fc6" +checksum = "6530e72945c11439e9b3c423c95a656a233d73c3a7d4acaf9789048e1bdf7da7" dependencies = [ "aws-sigv4", "aws-smithy-eventstream", @@ -260,9 +273,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd866926c2c4978210bcb01d7d1b431c794f0c23ca9ee1e420204b018836b5fb" +checksum = "6351c3ba468b04bd819f64ea53538f5f53e3d6b366b27deabee41e73c9edb3af" dependencies = [ "aws-smithy-eventstream", "aws-smithy-http", @@ -274,15 +287,15 @@ dependencies = [ "percent-encoding 2.1.0", "regex", "ring", - "time 0.3.11", + "time 0.3.14", "tracing", ] [[package]] name = "aws-smithy-async" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb59cfdd21143006c01b9ca4dc4a9190b8c50c2ef831f9eb36f54f69efa42f1" +checksum = "86fc23ad8d050c241bdbfa74ae360be94a844ace8e218f64a2b2de77bfa9a707" dependencies = [ "futures-util", "pin-project-lite", @@ -290,11 +303,32 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "aws-smithy-checksums" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd674df030b337a84eb67539db048676c691d9c88f0c54cf7748da11836cfd8" +dependencies = [ + "aws-smithy-http", + "aws-smithy-types", + "bytes", + "crc32c", + "crc32fast", + "hex", + "http", + "http-body", + "md-5", + "pin-project-lite", + "sha1", + "sha2", + "tracing", +] + [[package]] name = "aws-smithy-client" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44243329ba8618474c3b7f396de281f175ae172dd515b3d35648671a3cf51871" +checksum = "2e147b157f49ce77f2a86ec693a14c84b2441fa28be58ffb2febb77d5726c934" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -315,9 +349,9 @@ dependencies = [ [[package]] name = "aws-smithy-eventstream" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69ee49b9ed0ef080a6e18c08644521d3026029eb65dfc8c694315e1ae3118bc" +checksum = "da29e67a0b90a2bc5f2bd0a06fd43e728de62e02048879c15f646a3edf8db012" dependencies = [ "aws-smithy-types", "bytes", @@ -326,9 +360,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba78f69a5bbe7ac1826389304c67b789032d813574e78f9a2d450634277f833" +checksum = "5cc1af50eac644ab6f58e5bae29328ba3092851fc2ce648ad139134699b2b66f" dependencies = [ "aws-smithy-eventstream", "aws-smithy-types", @@ -348,9 +382,9 @@ dependencies = [ [[package]] name = "aws-smithy-http-tower" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8a512d68350561e901626baa08af9491cfbd54596201b84b4da846a59e4da3" +checksum = "a1bf4c4664dff2febf91f8796505c5bc8f38a0bff0d1397d1d3fdda17bd5c5d1" dependencies = [ "aws-smithy-http", "bytes", @@ -363,18 +397,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b7633698853aae80bd8b26866531420138eca91ea4620735d20b0537c93c2e" +checksum = "0e6ebc76c3c108dd2a96506bf47dc31f75420811a19f1a09907524d1451789d2" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a94b5a8cc94a85ccbff89eb7bc80dc135ede02847a73d68c04ac2a3e4cf6b7" +checksum = "2956f1385c4daa883907a2c81d32256af8f95834c9de1bc0613fa68db63b88c4" dependencies = [ "aws-smithy-types", "urlencoding", @@ -382,21 +416,21 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d230d281653de22fb0e9c7c74d18d724a39d7148e2165b1e760060064c4967c0" +checksum = "352fb335ec1d57160a17a13e87aaa0a172ab780ddf58bfc85caedd3b7e47caed" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.3", "num-integer", "ryu", - "time 0.3.11", + "time 0.3.14", ] [[package]] name = "aws-smithy-types-convert" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "066d98992a0410d21a113117f95d57a028b7b53c8a42d81706b00728d49b7073" +checksum = "b38df810a909a2e3802dfe9eb0e07404f5c726de29055e5dc47579ff9d1e9fd7" dependencies = [ "aws-smithy-types", "chrono", @@ -404,18 +438,18 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aacaf6c0fa549ebe5d9daa96233b8635965721367ee7c69effc8d8078842df3" +checksum = "6cf2807fa715a5a3296feffb06ce45252bd0dfd48f52838128c48fb339ddbf5c" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb54f097516352475a0159c9355f8b4737c54044538a4d9aca4d376ef2361ccc" +checksum = "8140b89d76f67be2c136d7393e7e6d8edd65424eb58214839efbf4a2e4f7e8a3" dependencies = [ "aws-smithy-async", "aws-smithy-client", @@ -464,34 +498,13 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -[[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 0.12.4", -] - [[package]] name = "block-buffer" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ - "generic-array 0.14.5", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -508,15 +521,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "byteorder" @@ -526,9 +533,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bytes-utils" @@ -590,38 +597,40 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", "time 0.1.44", + "wasm-bindgen", "winapi", ] [[package]] name = "chrono-tz" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58549f1842da3080ce63002102d5bc954c7bc843d4f47818e642abdc36253552" +checksum = "29c39203181991a7dd4343b8005bd804e7a9a37afb8ac070e43771e8c820bbde" dependencies = [ "chrono", "chrono-tz-build", - "phf 0.10.1", + "phf 0.11.1", ] [[package]] name = "chrono-tz-build" -version = "0.0.2" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db058d493fb2f65f41861bfed7e3fe6335264a9f0f92710cab5bdf01fef09069" +checksum = "6f509c3a87b33437b05e2458750a0700e5bdd6956176773e6c7d6dd15a283a0c" dependencies = [ "parse-zoneinfo", - "phf 0.10.1", - "phf_codegen 0.10.0", + "phf 0.11.1", + "phf_codegen 0.11.1", ] [[package]] @@ -701,18 +710,18 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813" dependencies = [ "libc", ] [[package]] name = "crates-index" -version = "0.18.8" +version = "0.18.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2519c91ad7a6e3250a64fb71162d2db1afe7bcf826a465f84d2052fd69639b7a" +checksum = "f9c19d07d1419484a5ee6fe7204266029ed230384935a6c713574f5acd56e64a" dependencies = [ "git2", "hex", @@ -739,6 +748,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "crc32c" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfea2db42e9927a3845fb268a10a72faed6d416065f77873f05e411457c363e" +dependencies = [ + "rustc_version", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -835,7 +853,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array", "typenum", ] @@ -938,22 +956,13 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - [[package]] name = "digest" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" dependencies = [ - "block-buffer 0.10.2", + "block-buffer", "crypto-common", "subtle", ] @@ -996,9 +1005,9 @@ dependencies = [ "criterion", "dashmap", "docsrs-metadata", - "dotenv", "env_logger", "failure", + "fn-error-context", "font-awesome-as-a-crate", "futures-util", "getrandom 0.2.7", @@ -1049,7 +1058,7 @@ dependencies = [ "thiserror", "thread_local", "time 0.1.44", - "time 0.3.11", + "time 0.3.14", "tokio", "toml", "url 2.2.2", @@ -1067,12 +1076,6 @@ dependencies = [ "toml", ] -[[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - [[package]] name = "dtoa" version = "0.4.8" @@ -1090,9 +1093,9 @@ dependencies = [ [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "encoding_rs" @@ -1165,12 +1168,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -1179,9 +1176,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] @@ -1208,6 +1205,17 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "fn-error-context" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "236b4e4ae2b8be5f7a5652f6108c4a0f2627c569db4e7923333d31c7dbfed0fb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1269,26 +1277,11 @@ dependencies = [ "new_debug_unreachable", ] -[[package]] -name = "futures" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" dependencies = [ "futures-core", "futures-sink", @@ -1296,32 +1289,21 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" - -[[package]] -name = "futures-executor" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] +checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" dependencies = [ "proc-macro2", "quote", @@ -1330,23 +1312,22 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" dependencies = [ - "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1369,18 +1350,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.12.4" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check 0.9.4", @@ -1455,9 +1427,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -1526,7 +1498,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] @@ -1571,7 +1543,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.2", + "itoa 1.0.3", ] [[package]] @@ -1643,7 +1615,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.2", + "itoa 1.0.3", "pin-project-lite", "socket2", "tokio", @@ -1682,6 +1654,19 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad2bfd338099682614d3ee3fe0cd72e0b6a41ca6a87f6a74a3bd593c91650501" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi", +] + [[package]] name = "idna" version = "0.1.5" @@ -1743,9 +1728,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb" +checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" [[package]] name = "ipnet" @@ -1786,9 +1771,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "jobserver" @@ -1801,9 +1786,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" dependencies = [ "wasm-bindgen", ] @@ -1840,9 +1825,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libgit2-sys" @@ -1943,12 +1928,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "markup5ever" version = "0.10.1" @@ -1981,7 +1960,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582" dependencies = [ - "digest 0.10.3", + "digest", ] [[package]] @@ -1992,9 +1971,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a79b39c93a7a5a27eeaf9a23b5ff43f1b9e0ad6b1cdd441140ae53c35613fc7" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" dependencies = [ "libc", ] @@ -2198,9 +2177,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" dependencies = [ "parking_lot_core", ] @@ -2211,12 +2190,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "openssl" version = "0.10.41" @@ -2296,9 +2269,9 @@ dependencies = [ [[package]] name = "path-slash" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54014ba3c1880122928735226f78b6f5bf5bd1fed15e41e92cf7aa20278ce28" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" [[package]] name = "percent-encoding" @@ -2314,18 +2287,19 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pest" -version = "2.1.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4" dependencies = [ + "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +checksum = "905708f7f674518498c1f8d644481440f476d39ca6ecae83319bba7c6c12da91" dependencies = [ "pest", "pest_generator", @@ -2333,9 +2307,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.1.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +checksum = "5803d8284a629cc999094ecd630f55e91b561a1d1ba75e233b00ae13b91a69ad" dependencies = [ "pest", "pest_meta", @@ -2346,11 +2320,11 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.1.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +checksum = "1538eb784f07615c6d9a8ab061089c6c54a344c5b4301db51990ca1c241e8c04" dependencies = [ - "maplit", + "once_cell", "pest", "sha-1", ] @@ -2377,11 +2351,11 @@ dependencies = [ [[package]] name = "phf" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" dependencies = [ - "phf_shared 0.10.0", + "phf_shared 0.11.1", ] [[package]] @@ -2406,12 +2380,12 @@ dependencies = [ [[package]] name = "phf_codegen" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770" dependencies = [ - "phf_generator 0.10.0", - "phf_shared 0.10.0", + "phf_generator 0.11.1", + "phf_shared 0.11.1", ] [[package]] @@ -2444,6 +2418,16 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "phf_generator" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +dependencies = [ + "phf_shared 0.11.1", + "rand 0.8.5", +] + [[package]] name = "phf_macros" version = "0.8.0" @@ -2482,6 +2466,15 @@ name = "phf_shared" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher 0.3.10", +] + +[[package]] +name = "phf_shared" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" dependencies = [ "siphasher 0.3.10", "uncased", @@ -2489,18 +2482,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -2527,9 +2520,9 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "plotters" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9428003b84df1496fb9d6eeee9c5f8145cb41ca375eb0dad204328888832811f" +checksum = "716b4eeb6c4a1d3ecc956f75b43ec2e8e8ba80026413e70a3f41fd3313d3492b" dependencies = [ "num-traits", "plotters-backend", @@ -2546,9 +2539,9 @@ checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" [[package]] name = "plotters-svg" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0918736323d1baff32ee0eade54984f6f201ad7e97d5cfb5d6ab4a358529615" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" dependencies = [ "plotters-backend", ] @@ -2564,13 +2557,13 @@ dependencies = [ [[package]] name = "postgres" -version = "0.19.3" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8bbcd5f6deb39585a0d9f4ef34c4a41c25b7ad26d23c75d837d78c8e7adc85f" +checksum = "960c214283ef8f0027974c03e9014517ced5db12f021a9abb66185a5751fab0a" dependencies = [ "bytes", "fallible-iterator", - "futures", + "futures-util", "log 0.4.17", "tokio", "tokio-postgres", @@ -2607,9 +2600,9 @@ dependencies = [ [[package]] name = "postgres-types" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd6e8b7189a73169290e89bd24c771071f1012d8fe6f738f5226531f0b03d89" +checksum = "73d946ec7d256b04dfadc4e6a3292324e6f417124750fc5c0950f981b703a0f1" dependencies = [ "bytes", "chrono", @@ -2664,18 +2657,18 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] [[package]] name = "procfs" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "979e5cb47caafb8e14653bb083358e19917ca8c9c4c2648932eccd935f5c4d80" +checksum = "2b4030746dfb40582518bebdc6303faef2bedfe787bac3786458bcdcc923b4e8" dependencies = [ "bitflags", "byteorder", @@ -2702,9 +2695,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -2952,9 +2945,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] @@ -3107,9 +3100,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.7" +version = "0.35.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51cc38aa10f6bbb377ed28197aa052aa4e2b762c22be9d3153d01822587e787" +checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" dependencies = [ "bitflags", "errno", @@ -3146,9 +3139,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "rustwide" @@ -3185,9 +3178,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "safemem" @@ -3325,9 +3318,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" dependencies = [ "serde", ] @@ -3428,16 +3421,16 @@ dependencies = [ "serde", "serde_json", "thiserror", - "time 0.3.11", + "time 0.3.14", "url 2.2.2", "uuid", ] [[package]] name = "serde" -version = "1.0.140" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] @@ -3454,9 +3447,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -3465,11 +3458,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.3", "ryu", "serde", ] @@ -3481,7 +3474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.2", + "itoa 1.0.3", "ryu", "serde", ] @@ -3498,14 +3491,24 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.8.2" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug", + "cfg-if", + "cpufeatures", + "digest", ] [[package]] @@ -3516,7 +3519,7 @@ checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.3", + "digest", ] [[package]] @@ -3536,9 +3539,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3" +checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" [[package]] name = "siphasher" @@ -3693,9 +3696,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.0", "proc-macro2", @@ -3712,9 +3715,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", @@ -3735,15 +3738,15 @@ dependencies = [ [[package]] name = "systemstat" -version = "0.1.11" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5dc96f7634f46ac7e485b8c051f5b89ec8ee5cc023236dd12fe4ae2fb52f80" +checksum = "79ef8054a60d76603befaecaf7efe08d32d1a05a1e5df70c547b07507e9e262d" dependencies = [ "bytesize", - "chrono", "lazy_static", "libc", "nom", + "time 0.3.14", "winapi", ] @@ -3785,9 +3788,9 @@ dependencies = [ [[package]] name = "tera" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c9783d6ff395ae80cf17ed9a25360e7ba37742a79fa8fddabb073c5c7c8856d" +checksum = "1d4685e72cb35f0eb74319c8fe2d3b61e93da5609841cde2cb87fcc3bea56d20" dependencies = [ "chrono", "chrono-tz", @@ -3853,18 +3856,18 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", @@ -3893,11 +3896,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.11" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" dependencies = [ - "itoa 1.0.2", + "itoa 1.0.3", "libc", "num_threads", ] @@ -3929,9 +3932,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e" +checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" dependencies = [ "autocfg 1.1.0", "bytes", @@ -3958,19 +3961,20 @@ dependencies = [ [[package]] name = "tokio-postgres" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c88a47a23c5d2dc9ecd28fb38fba5fc7e5ddc1fe64488ec145076b0c71c8ae" +checksum = "29a12c1b3e0704ae7dfc25562629798b29c72e6b1d0a681b6f29ab4ae5e7f7bf" dependencies = [ "async-trait", "byteorder", "bytes", "fallible-iterator", - "futures", + "futures-channel", + "futures-util", "log 0.4.17", "parking_lot", "percent-encoding 2.1.0", - "phf 0.10.1", + "phf 0.11.1", "pin-project-lite", "postgres-protocol", "postgres-types", @@ -4054,9 +4058,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if", "log 0.4.17", @@ -4078,9 +4082,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" dependencies = [ "once_cell", ] @@ -4224,9 +4228,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "unicode-normalization" @@ -4387,9 +4391,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4397,13 +4401,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" dependencies = [ "bumpalo", - "lazy_static", "log 0.4.17", + "once_cell", "proc-macro2", "quote", "syn", @@ -4412,9 +4416,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ "cfg-if", "js-sys", @@ -4424,9 +4428,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4434,9 +4438,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2", "quote", @@ -4447,15 +4451,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index c4ab33cd5..2664dd543 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,14 +47,13 @@ comrak = { version = "0.14.0", default-features = false } toml = "0.5" schemamama = "0.3" schemamama_postgres = "0.3" -systemstat = "0.1.4" +systemstat = "0.2.0" prometheus = { version = "0.13.0", default-features = false } rustwide = "0.15.0" mime_guess = "2" -dotenv = "0.15" zstd = "0.11.0" hostname = "0.3.1" -git2 = { version = "0.14.4", default-features = false } +git2 = { version = "0.14.0", default-features = false } path-slash = "0.2.0" once_cell = { version = "1.4.0", features = ["parking_lot"] } base64 = "0.13" @@ -72,9 +71,9 @@ getrandom = "0.2.1" # Async tokio = { version = "1.0", features = ["rt-multi-thread"] } futures-util = "0.3.5" -aws-config = "0.46.0" -aws-sdk-s3 = "0.16.0" -aws-smithy-types-convert = { version = "0.46.0", features = ["convert-chrono"] } +aws-config = "0.47.0" +aws-sdk-s3 = "0.17.0" +aws-smithy-types-convert = { version = "0.47.0", features = ["convert-chrono"] } http = "0.2.6" # Data serialization and deserialization @@ -114,6 +113,7 @@ kuchiki = "0.8" rand = "0.8" mockito = "0.31.0" test-case = "2.0.0" +fn-error-context = "0.2.0" [build-dependencies] time = "0.3" diff --git a/README.md b/README.md index 23d3e8444..1998fdc47 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,9 @@ mkdir -p ignored/cratesfyi-prefix/crates.io-index cargo build # Start the external services docker-compose up -d db s3 +# anything that doesn't run via docker-compose needs the settings defined in +# .env. Either via `. ./.env` as below, or via any dotenv shell integration. +. ./.env # Setup the database you just created cargo run -- database migrate # Build a sample crate to make sure it works @@ -76,7 +79,7 @@ cargo run -- build add-essential-files # It does not automatically run the migrations, so you need to do that manually (see above). cargo run -- start-web-server # If you want the server to automatically restart when code or templates change -# you can use `cargo-watch`: +# you can use `cargo-watch`: cargo watch -x "run -- start-web-server" ``` @@ -212,7 +215,7 @@ If you want to explore or edit database manually, you can connect to the databas with the `psql` command. ```sh -. .env +. ./.env psql $DOCSRS_DATABASE_URL ``` diff --git a/crates/metadata/lib.rs b/crates/metadata/lib.rs index 82fc6da68..e9b7a4a15 100644 --- a/crates/metadata/lib.rs +++ b/crates/metadata/lib.rs @@ -281,6 +281,10 @@ impl Metadata { let rustflags = toml::to_string(&self.rustc_args).expect("serializing a string should never fail"); cargo_args.push(format!("build.rustflags={}", rustflags)); + cargo_args.push("-Zhost-config".into()); + cargo_args.push("-Ztarget-applies-to-host".into()); + cargo_args.push("--config".into()); + cargo_args.push(format!("host.rustflags={}", rustflags)); } if !all_rustdoc_args.is_empty() { diff --git a/src/bin/cratesfyi.rs b/src/bin/cratesfyi.rs index f27dbb79e..0a402cfb4 100644 --- a/src/bin/cratesfyi.rs +++ b/src/bin/cratesfyi.rs @@ -18,8 +18,6 @@ use structopt::StructOpt; use strum::VariantNames; fn main() { - let _ = dotenv::dotenv(); - let _sentry_guard = if let Ok(sentry_dsn) = env::var("SENTRY_DSN") { rustwide::logging::init_with(SentryLogger::with_dest(logger_init())); Some(sentry::init(( diff --git a/src/db/migrate.rs b/src/db/migrate.rs index 1a55cbfa9..fb203605e 100644 --- a/src/db/migrate.rs +++ b/src/db/migrate.rs @@ -313,7 +313,7 @@ pub fn migrate(version: Option, conn: &mut Client) -> crate::error::Res // version 9, // description - "Allow max number of targets to be overriden", + "Allow max number of targets to be overridden", // upgrade query "ALTER TABLE sandbox_overrides ADD COLUMN max_targets INT;", // downgrade query diff --git a/src/docbuilder/rustwide_builder.rs b/src/docbuilder/rustwide_builder.rs index e08debca2..97d653909 100644 --- a/src/docbuilder/rustwide_builder.rs +++ b/src/docbuilder/rustwide_builder.rs @@ -1083,4 +1083,16 @@ mod tests { Ok(()) }); } + + #[test] + #[ignore] + fn test_rustflags_are_passed_to_build_script() { + wrapper(|env| { + let crate_ = "proc-macro2"; + let version = "1.0.33"; + let mut builder = RustwideBuilder::init(env).unwrap(); + assert!(builder.build_package(crate_, version, PackageKind::CratesIo)?); + Ok(()) + }); + } } diff --git a/src/test/mod.rs b/src/test/mod.rs index 1f932a5f0..aeb3baf9d 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -7,20 +7,18 @@ use crate::repositories::RepositoryStatsUpdater; use crate::storage::{Storage, StorageKind}; use crate::web::Server; use crate::{BuildQueue, Config, Context, Index, Metrics}; +use anyhow::Context as _; +use fn_error_context::context; use log::error; use once_cell::unsync::OnceCell; use postgres::Client as Connection; use reqwest::{ - blocking::{Client, RequestBuilder}, + blocking::{Client, ClientBuilder, RequestBuilder}, Method, }; -use std::fs; -use std::net::SocketAddr; -use std::{panic, sync::Arc}; +use std::{fs, net::SocketAddr, panic, sync::Arc, time::Duration}; pub(crate) fn wrapper(f: impl FnOnce(&TestEnvironment) -> Result<()>) { - let _ = dotenv::dotenv(); - let env = TestEnvironment::new(); // if we didn't catch the panic, the server would hang forever let maybe_panic = panic::catch_unwind(panic::AssertUnwindSafe(|| f(&env))); @@ -56,45 +54,57 @@ pub(crate) fn assert_not_found(path: &str, web: &TestFrontend) -> Result<()> { Ok(()) } -/// Make sure that a URL redirects to a specific page -pub(crate) fn assert_redirect(path: &str, expected_target: &str, web: &TestFrontend) -> Result<()> { - // Reqwest follows redirects automatically - let response = web.get(path).send()?; +fn assert_redirect_common(path: &str, expected_target: &str, web: &TestFrontend) -> Result<()> { + let response = web.get_no_redirect(path).send()?; let status = response.status(); + if !status.is_redirection() { + anyhow::bail!("non-redirect from GET {path}: {status}"); + } + + let mut redirect_target = response + .headers() + .get("Location") + .context("missing 'Location' header")? + .to_str() + .context("non-ASCII redirect")?; + + if !expected_target.starts_with("http") { + // TODO: Should be able to use Url::make_relative, + // but https://github.com/servo/rust-url/issues/766 + let base = format!("http://{}", web.server_addr()); + redirect_target = redirect_target + .strip_prefix(&base) + .unwrap_or(redirect_target); + } - let mut tmp; - let redirect_target = if expected_target.starts_with("https://") { - response.url().as_str() - } else { - tmp = String::from(response.url().path()); - if let Some(query) = response.url().query() { - tmp.push('?'); - tmp.push_str(query); - } - &tmp - }; - // Either we followed a redirect to the wrong place, or there was no redirect if redirect_target != expected_target { - // wrong place - if redirect_target != path { - panic!( - "{}: expected redirect to {}, got redirect to {}", - path, expected_target, redirect_target - ); - } else { - // no redirect - panic!( - "{}: expected redirect to {}, got {}", - path, expected_target, status - ); - } + anyhow::bail!("got redirect to {redirect_target}"); } - assert!( - status.is_success(), - "failed to GET {}: {}", - expected_target, - status - ); + + Ok(()) +} + +/// Makes sure that a URL redirects to a specific page, but doesn't check that the target exists +#[context("expected redirect from {path} to {expected_target}")] +pub(crate) fn assert_redirect_unchecked( + path: &str, + expected_target: &str, + web: &TestFrontend, +) -> Result<()> { + assert_redirect_common(path, expected_target, web) +} + +/// Make sure that a URL redirects to a specific page, and that the target exists and is not another redirect +#[context("expected redirect from {path} to {expected_target}")] +pub(crate) fn assert_redirect(path: &str, expected_target: &str, web: &TestFrontend) -> Result<()> { + assert_redirect_common(path, expected_target, web)?; + + let response = web.get_no_redirect(expected_target).send()?; + let status = response.status(); + if !status.is_success() { + anyhow::bail!("failed to GET {expected_target}: {status}"); + } + Ok(()) } @@ -113,6 +123,7 @@ pub(crate) fn init_logger() { // initializing rustwide logging also sets the global logger rustwide::logging::init_with( env_logger::Builder::from_env(env_logger::Env::default().filter("DOCSRS_LOG")) + .format_timestamp_millis() .is_test(true) .build(), ); @@ -247,7 +258,7 @@ impl TestEnvironment { } pub(crate) fn override_frontend(&self, init: impl FnOnce(&mut TestFrontend)) -> &TestFrontend { - let mut frontend = TestFrontend::new(&*self); + let mut frontend = TestFrontend::new(self); init(&mut frontend); if self.frontend.set(frontend).is_err() { panic!("cannot call override_frontend after frontend is initialized"); @@ -256,7 +267,7 @@ impl TestEnvironment { } pub(crate) fn frontend(&self) -> &TestFrontend { - self.frontend.get_or_init(|| TestFrontend::new(&*self)) + self.frontend.get_or_init(|| TestFrontend::new(self)) } pub(crate) fn fake_release(&self) -> fakes::FakeRelease { @@ -372,22 +383,35 @@ impl Drop for TestDatabase { pub(crate) struct TestFrontend { server: Server, pub(crate) client: Client, + pub(crate) client_no_redirect: Client, } impl TestFrontend { fn new(context: &dyn Context) -> Self { + fn build(f: impl FnOnce(ClientBuilder) -> ClientBuilder) -> Client { + let base = Client::builder() + .connect_timeout(Duration::from_millis(2000)) + .timeout(Duration::from_millis(2000)) + // The test server only supports a single connection, so having two clients with + // idle connections deadlocks the tests + .pool_max_idle_per_host(0); + f(base).build().unwrap() + } + Self { server: Server::start(Some("127.0.0.1:0"), context) .expect("failed to start the web server"), - client: Client::new(), + client: build(|b| b), + client_no_redirect: build(|b| b.redirect(reqwest::redirect::Policy::none())), } } - fn build_request(&self, method: Method, mut url: String) -> RequestBuilder { + fn build_url(&self, url: &str) -> String { if url.is_empty() || url.starts_with('/') { - url = format!("http://{}{}", self.server.addr(), url); + format!("http://{}{}", self.server.addr(), url) + } else { + url.to_owned() } - self.client.request(method, url) } pub(crate) fn server_addr(&self) -> SocketAddr { @@ -395,6 +419,14 @@ impl TestFrontend { } pub(crate) fn get(&self, url: &str) -> RequestBuilder { - self.build_request(Method::GET, url.to_string()) + let url = self.build_url(url); + log::debug!("getting {url}"); + self.client.request(Method::GET, url) + } + + pub(crate) fn get_no_redirect(&self, url: &str) -> RequestBuilder { + let url = self.build_url(url); + log::debug!("getting {url} (no redirects)"); + self.client_no_redirect.request(Method::GET, url) } } diff --git a/src/utils/html.rs b/src/utils/html.rs index a6b364282..be3d52c3f 100644 --- a/src/utils/html.rs +++ b/src/utils/html.rs @@ -48,7 +48,7 @@ pub(crate) fn rewrite_lol( rustdoc_body_class.set_tag_name("div")?; // Prepend the tera content rustdoc_body_class.prepend(&tera_body, ContentType::Html); - // Wrap the tranformed body and topbar into a element + // Wrap the transformed body and topbar into a element rustdoc_body_class.before(r#""#, ContentType::Html); // Insert the topbar outside of the rustdoc div rustdoc_body_class.before(&tera_rustdoc_topbar, ContentType::Html); @@ -69,7 +69,7 @@ pub(crate) fn rewrite_lol( // Append `vendored.css` before `rustdoc.css`, so that the duplicate copy of // `normalize.css` will be overridden by the later version. element!( - "link[type='text/css'][href*='rustdoc']", + "link[rel='stylesheet'][href*='rustdoc']", |rustdoc_css: &mut Element| { rustdoc_css.before(&tera_vendored_css, ContentType::Html); Ok(()) diff --git a/src/web/crate_details.rs b/src/web/crate_details.rs index 890b7d080..3024a7e7c 100644 --- a/src/web/crate_details.rs +++ b/src/web/crate_details.rs @@ -39,10 +39,10 @@ pub struct CrateDetails { is_library: bool, license: Option, pub(crate) documentation_url: Option, - total_items: Option, - documented_items: Option, - total_items_needing_examples: Option, - items_with_examples: Option, + total_items: Option, + documented_items: Option, + total_items_needing_examples: Option, + items_with_examples: Option, /// Database id for this crate pub(crate) crate_id: i32, /// Database id for this release @@ -76,6 +76,7 @@ pub struct Release { pub yanked: bool, pub is_library: bool, pub rustdoc_status: bool, + pub target_name: String, } impl CrateDetails { @@ -166,11 +167,6 @@ impl CrateDetails { rustdoc_css_file: get_correct_docsrs_style_file(krate.get("doc_rustc_version"))?, }; - let documented_items: Option = krate.get("documented_items"); - let total_items: Option = krate.get("total_items"); - let total_items_needing_examples: Option = krate.get("total_items_needing_examples"); - let items_with_examples: Option = krate.get("items_with_examples"); - let mut crate_details = CrateDetails { name: krate.get("name"), version: krate.get("version"), @@ -195,10 +191,10 @@ impl CrateDetails { is_library: krate.get("is_library"), license: krate.get("license"), documentation_url: krate.get("documentation_url"), - documented_items: documented_items.map(|v| v as f32), - total_items: total_items.map(|v| v as f32), - total_items_needing_examples: total_items_needing_examples.map(|v| v as f32), - items_with_examples: items_with_examples.map(|v| v as f32), + documented_items: krate.get("documented_items"), + total_items: krate.get("total_items"), + total_items_needing_examples: krate.get("total_items_needing_examples"), + items_with_examples: krate.get("items_with_examples"), crate_id, release_id, }; @@ -246,15 +242,16 @@ pub(crate) fn releases_for_crate( ) -> Result, anyhow::Error> { let mut releases: Vec = conn .query( - "SELECT - id, + "SELECT + id, version, build_status, yanked, is_library, - rustdoc_status + rustdoc_status, + target_name FROM releases - WHERE + WHERE releases.crate_id = $1", &[&crate_id], )? @@ -269,6 +266,7 @@ pub(crate) fn releases_for_crate( yanked: row.get("yanked"), is_library: row.get("is_library"), rustdoc_status: row.get("rustdoc_status"), + target_name: row.get("target_name"), }), Err(err) => { report_error(&anyhow!(err).context(format!( @@ -505,6 +503,7 @@ mod tests { is_library: true, rustdoc_status: true, id: details.releases[0].id, + target_name: "foo".to_owned(), }, Release { version: semver::Version::parse("0.12.0")?, @@ -513,6 +512,7 @@ mod tests { is_library: true, rustdoc_status: true, id: details.releases[1].id, + target_name: "foo".to_owned(), }, Release { version: semver::Version::parse("0.3.0")?, @@ -521,6 +521,7 @@ mod tests { is_library: true, rustdoc_status: false, id: details.releases[2].id, + target_name: "foo".to_owned(), }, Release { version: semver::Version::parse("0.2.0")?, @@ -529,6 +530,7 @@ mod tests { is_library: true, rustdoc_status: true, id: details.releases[3].id, + target_name: "foo".to_owned(), }, Release { version: semver::Version::parse("0.2.0-alpha")?, @@ -537,6 +539,7 @@ mod tests { is_library: true, rustdoc_status: true, id: details.releases[4].id, + target_name: "foo".to_owned(), }, Release { version: semver::Version::parse("0.1.1")?, @@ -545,6 +548,7 @@ mod tests { is_library: true, rustdoc_status: true, id: details.releases[5].id, + target_name: "foo".to_owned(), }, Release { version: semver::Version::parse("0.1.0")?, @@ -553,6 +557,7 @@ mod tests { is_library: true, rustdoc_status: true, id: details.releases[6].id, + target_name: "foo".to_owned(), }, Release { version: semver::Version::parse("0.0.1")?, @@ -561,6 +566,7 @@ mod tests { is_library: false, rustdoc_status: false, id: details.releases[7].id, + target_name: "foo".to_owned(), }, ] ); diff --git a/src/web/metrics.rs b/src/web/metrics.rs index fc3d677da..7ba1794d6 100644 --- a/src/web/metrics.rs +++ b/src/web/metrics.rs @@ -92,6 +92,12 @@ impl<'a> RenderingTimesRecorder<'a> { fn record_current(&mut self) { if let Some(current) = self.current.take() { + #[cfg(test)] + log::debug!( + "rendering time - {}: {:?}", + current.step, + current.start.elapsed() + ); self.metric .with_label_values(&[current.step]) .observe(duration_to_seconds(current.start.elapsed())); diff --git a/src/web/mod.rs b/src/web/mod.rs index ff9cf0cd1..3eb5d6eb1 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -223,6 +223,7 @@ struct MatchVersion { pub corrected_name: Option, pub version: MatchSemver, pub rustdoc_status: bool, + pub target_name: String, } impl MatchVersion { @@ -324,6 +325,7 @@ fn match_version( corrected_name, version: MatchSemver::Exact((release.version.to_string(), release.id)), rustdoc_status: release.rustdoc_status, + target_name: release.target_name.clone(), }); } } @@ -358,6 +360,7 @@ fn match_version( MatchSemver::Semver((release.version.to_string(), release.id)) }, rustdoc_status: release.rustdoc_status, + target_name: release.target_name.clone(), }); } @@ -371,6 +374,7 @@ fn match_version( corrected_name: corrected_name.clone(), version: MatchSemver::Semver((release.version.to_string(), release.id)), rustdoc_status: release.rustdoc_status, + target_name: release.target_name.clone(), }) .ok_or(Nope::VersionNotFound); } @@ -659,7 +663,7 @@ mod test { let web = env.frontend(); let foo_crate = kuchiki::parse_html().one(web.get("/crate/foo/0.0.1").send()?.text()?); - for value in &["60%", "6", "10", "2", "1"] { + for value in &["60.0%", "6", "10", "2", "1"] { assert!(foo_crate .select(".pure-menu-item b") .unwrap() @@ -670,7 +674,7 @@ mod test { assert!(foo_doc .select(".pure-menu-link b") .unwrap() - .any(|e| e.text_contents().contains("60%"))); + .any(|e| e.text_contents().contains("60.0%"))); Ok(()) }); @@ -759,7 +763,7 @@ mod test { .create() .unwrap(); let web = env.frontend(); - assert_redirect("/bat//", "/bat/latest/bat/", web)?; + assert_redirect_unchecked("/bat//", "/bat/", web)?; Ok(()) }) } diff --git a/src/web/releases.rs b/src/web/releases.rs index efafe2d9b..c74652169 100644 --- a/src/web/releases.rs +++ b/src/web/releases.rs @@ -79,7 +79,7 @@ pub(crate) fn get_releases(conn: &mut Client, page: i64, limit: i64, order: Orde INNER JOIN builds ON releases.id = builds.rid LEFT JOIN repositories ON releases.repository_id = repositories.id WHERE - ((NOT $3) OR (releases.build_status = FALSE AND releases.is_library = TRUE)) + ((NOT $3) OR (releases.build_status = FALSE AND releases.is_library = TRUE)) AND {0} IS NOT NULL ORDER BY {0} DESC @@ -246,7 +246,7 @@ fn get_search_results( releases.rustdoc_status, repositories.stars - FROM crates + FROM crates INNER JOIN releases ON crates.latest_version_id = releases.id INNER JOIN builds ON releases.id = builds.rid LEFT JOIN repositories ON releases.repository_id = repositories.id @@ -498,7 +498,7 @@ fn redirect_to_random_crate(req: &Request, conn: &mut PoolClient) -> IronResult< releases.version, releases.target_name FROM ( - -- generate random numbers in the ID-range. + -- generate random numbers in the ID-range. SELECT DISTINCT 1 + trunc(random() * params.max_id)::INTEGER AS id FROM params, generate_series(1, $1) ) AS r @@ -554,34 +554,34 @@ pub fn search_handler(req: &mut Request) -> IronResult { let mut conn = extension!(req, Pool).get()?; // check if I am feeling lucky button pressed and redirect user to crate page - // if there is a match - if params.contains_key("i-am-feeling-lucky") { + // if there is a match. Also check for paths to items within crates. + if params.contains_key("i-am-feeling-lucky") || query.contains("::") { // redirect to a random crate if query is empty if query.is_empty() { return redirect_to_random_crate(req, &mut conn); } + + let (krate, query) = match query.split_once("::") { + Some((krate, query)) => (krate.to_string(), format!("?search={query}")), + None => (query.clone(), "".to_string()), + }; + // since we never pass a version into `match_version` here, we'll never get // `MatchVersion::Exact`, so the distinction between `Exact` and `Semver` doesn't // matter - if let Ok(matchver) = match_version(&mut conn, &query, None) { + if let Ok(matchver) = match_version(&mut conn, &krate, None) { let (version, _) = matchver.version.into_parts(); - let query = matchver.corrected_name.unwrap_or_else(|| query.to_string()); + let krate = matchver.corrected_name.unwrap_or(krate); + let base = redirect_base(req); let url = if matchver.rustdoc_status { + let target_name = matchver.target_name; ctry!( req, - Url::parse(&format!("{}/{}/{}/", redirect_base(req), query, version)), + Url::parse(&format!("{base}/{krate}/{version}/{target_name}/{query}")) ) } else { - ctry!( - req, - Url::parse(&format!( - "{}/crate/{}/{}", - redirect_base(req), - query, - version, - )), - ) + ctry!(req, Url::parse(&format!("{base}/crate/{krate}/{version}"))) }; let mut resp = Response::with((status::Found, Redirect(url))); @@ -609,7 +609,7 @@ pub fn search_handler(req: &mut Request) -> IronResult { // the crates.io API. // The whole point of the `paginate` design is that we don't // know anything about the pagination args and crates.io can - // change them as they whish, so we cannot do any more checks here. + // change them as they wish, so we cannot do any more checks here. warn!( "didn't get query args in `paginate` arguments for search: \"{}\"", query_params @@ -676,12 +676,12 @@ pub fn activity_handler(req: &mut Request) -> IronResult { " WITH dates AS ( -- we need this series so that days in the statistic that don't have any releases are included - SELECT generate_series( + SELECT generate_series( CURRENT_DATE - INTERVAL '30 days', CURRENT_DATE - INTERVAL '1 day', '1 day'::interval )::date AS date_ - ), + ), release_stats AS ( SELECT release_time::date AS date_, @@ -694,16 +694,16 @@ pub fn activity_handler(req: &mut Request) -> IronResult { release_time < CURRENT_DATE GROUP BY release_time::date - ) - SELECT + ) + SELECT dates.date_ AS date, COALESCE(rs.counts, 0) AS counts, - COALESCE(rs.failures, 0) AS failures + COALESCE(rs.failures, 0) AS failures FROM - dates + dates LEFT OUTER JOIN Release_stats AS rs ON dates.date_ = rs.date_ - ORDER BY + ORDER BY dates.date_ ", &[], @@ -863,6 +863,27 @@ mod tests { }) } + #[test] + fn search_coloncolon_path_redirects_to_crate_docs() { + wrapper(|env| { + let web = env.frontend(); + env.fake_release().name("some_random_crate").create()?; + env.fake_release().name("some_other_crate").create()?; + + assert_redirect( + "/releases/search?query=some_random_crate::somepath", + "/some_random_crate/1.0.0/some_random_crate/?search=somepath", + web, + )?; + assert_redirect( + "/releases/search?query=some_random_crate::some::path", + "/some_random_crate/1.0.0/some_random_crate/?search=some::path", + web, + )?; + Ok(()) + }) + } + #[test] fn search_result_passes_cratesio_pagination_links() { wrapper(|env| { diff --git a/src/web/routes.rs b/src/web/routes.rs index 5c666f8e8..5d1f74126 100644 --- a/src/web/routes.rs +++ b/src/web/routes.rs @@ -173,22 +173,38 @@ pub(super) fn build_routes() -> Routes { &format!("/{}", redirect), super::rustdoc::RustLangRedirector::new("stable", redirect), ); + routes.internal_page( + &format!("/{}/", redirect), + super::rustdoc::RustLangRedirector::new("stable", redirect), + ); } // redirect proc-macro to proc_macro routes.internal_page( "/proc-macro", super::rustdoc::RustLangRedirector::new("stable", "proc_macro"), ); + routes.internal_page( + "/proc-macro/", + super::rustdoc::RustLangRedirector::new("stable", "proc_macro"), + ); // redirect rustc to nightly rustc docs routes.internal_page( "/rustc", super::rustdoc::RustLangRedirector::new("nightly", "nightly-rustc"), ); + routes.internal_page( + "/rustc/", + super::rustdoc::RustLangRedirector::new("nightly", "nightly-rustc"), + ); // redirect rustdoc to nightly rustdoc docs routes.internal_page( "/rustdoc", super::rustdoc::RustLangRedirector::new("nightly", "nightly-rustc/rustdoc"), ); + routes.internal_page( + "/rustdoc/", + super::rustdoc::RustLangRedirector::new("nightly", "nightly-rustc/rustdoc"), + ); routes } diff --git a/src/web/rustdoc.rs b/src/web/rustdoc.rs index d6d36adeb..53b873393 100644 --- a/src/web/rustdoc.rs +++ b/src/web/rustdoc.rs @@ -20,7 +20,7 @@ use iron::{ use lol_html::errors::RewritingError; use router::Router; use serde::Serialize; -use std::path::Path; +use std::{fmt::Write, path::Path}; #[derive(Clone)] pub struct RustLangRedirector { @@ -29,9 +29,8 @@ pub struct RustLangRedirector { impl RustLangRedirector { pub fn new(version: &str, target: &str) -> Self { - let url = - iron::url::Url::parse(&format!("https://doc.rust-lang.org/{}/{}", version, target)) - .expect("failed to parse rust-lang.org doc URL"); + let url = iron::url::Url::parse(&format!("https://doc.rust-lang.org/{version}/{target}/")) + .expect("failed to parse rust-lang.org doc URL"); let url = Url::from_generic_url(url).expect("failed to convert url::Url to iron::Url"); Self { url } @@ -53,6 +52,7 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult { vers: &str, target: Option<&str>, target_name: &str, + path_in_crate: Option<&str>, ) -> IronResult { let mut url_str = if let Some(target) = target { format!( @@ -69,6 +69,9 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult { if let Some(query) = req.url.query() { url_str.push('?'); url_str.push_str(query); + } else if let Some(path) = path_in_crate { + url_str.push_str("?search="); + url_str.push_str(path); } let url = ctry!(req, Url::parse(&url_str)); let (status_code, max_age) = if vers == "latest" { @@ -145,10 +148,13 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult { // this handler should never called without crate pattern let crate_name = cexpect!(req, router.find("crate")); - let mut crate_name = percent_decode(crate_name.as_bytes()) + let crate_name = percent_decode(crate_name.as_bytes()) .decode_utf8() - .unwrap_or_else(|_| crate_name.into()) - .into_owned(); + .unwrap_or_else(|_| crate_name.into()); + let (mut crate_name, path_in_crate) = match crate_name.split_once("::") { + Some((krate, path)) => (krate.to_string(), Some(path.to_string())), + None => (crate_name.to_string(), None), + }; let req_version = router.find("version"); let mut target = router.find("target"); @@ -190,7 +196,14 @@ pub fn rustdoc_redirector_handler(req: &mut Request) -> IronResult { if has_docs { rendering_time.step("redirect to doc"); - redirect_to_doc(req, &crate_name, &version, target, &target_name) + redirect_to_doc( + req, + &crate_name, + &version, + target, + &target_name, + path_in_crate.as_deref(), + ) } else { rendering_time.step("redirect to crate"); redirect_to_crate(req, &crate_name, &version) @@ -490,25 +503,16 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult { let latest_path = format!("/crate/{}/latest{}{}", name, target_redirect, query_string); // Set the canonical URL for search engines to the `/latest/` page on docs.rs. - // For crates with a documentation URL, where that URL doesn't point at docs.rs, - // omit the canonical link to avoid penalizing external documentation. // Note: The URL this points to may not exist. For instance, if we're rendering // `struct Foo` in version 0.1.0 of a crate, and version 0.2.0 of that crate removes // `struct Foo`, this will point at a 404. That's fine: search engines will crawl // the target and will not canonicalize to a URL that doesn't exist. - let canonical_url = if krate.documentation_url.is_none() - || krate - .documentation_url - .as_ref() - .unwrap() - .starts_with("https://docs.rs/") - { - // Don't include index.html in the canonical URL. - let canonical_path = inner_path.replace("index.html", ""); - format!("https://docs.rs/{}/latest/{}", name, canonical_path) - } else { - "".to_string() - }; + // Don't include index.html in the canonical URL. + let canonical_url = format!( + "https://docs.rs/{}/latest/{}", + name, + inner_path.replace("index.html", "") + ); metrics .recently_accessed_releases @@ -542,8 +546,8 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult { /// Note that path is overloaded in this context to mean both the path of a URL /// and the file path of a static file in the DB. /// -/// `req_path` is assumed to have the following format: -/// `rustdoc/crate/version[/platform]/module/[kind.name.html|index.html]` +/// `file_path` is assumed to have the following format: +/// `[/platform]/module/[kind.name.html|index.html]` /// /// Returns a path that can be appended to `/crate/version/` to create a complete URL. fn path_for_version(file_path: &[&str], crate_details: &CrateDetails) -> String { @@ -584,11 +588,16 @@ fn path_for_version(file_path: &[&str], crate_details: &CrateDetails) -> String // else, don't try searching at all, we don't know how to find it last_component.strip_suffix(".rs.html") }; - if let Some(search) = search_item { - format!("{}?search={}", platform, search) + let target_name = &crate_details.target_name; + let mut result = if platform.is_empty() { + format!("{target_name}/") } else { - platform.to_owned() + format!("{platform}/{target_name}/") + }; + if let Some(search) = search_item { + write!(result, "?search={search}").unwrap(); } + result } pub fn target_redirect_handler(req: &mut Request) -> IronResult { @@ -658,13 +667,7 @@ pub fn target_redirect_handler(req: &mut Request) -> IronResult { path_for_version(&file_path, &crate_details) }; - let url = format!( - "{base}/{name}/{version_or_latest}/{path}", - base = base, - name = name, - version_or_latest = version_or_latest, - path = path - ); + let url = format!("{base}/{name}/{version_or_latest}/{path}"); let url = ctry!(req, Url::parse(&url)); let mut resp = Response::with((status::Found, Redirect(url))); @@ -1710,6 +1713,27 @@ mod test { }) } + #[test] + fn test_redirect_crate_coloncolon_path() { + wrapper(|env| { + let web = env.frontend(); + env.fake_release().name("some_random_crate").create()?; + env.fake_release().name("some_other_crate").create()?; + + assert_redirect( + "/some_random_crate::somepath", + "/some_random_crate/latest/some_random_crate/?search=somepath", + web, + )?; + assert_redirect( + "/some_random_crate::some::path", + "/some_random_crate/latest/some_random_crate/?search=some::path", + web, + )?; + Ok(()) + }) + } + #[test] // regression test for https://github.com/rust-lang/docs.rs/pull/885#issuecomment-655147643 fn test_no_panic_on_missing_kind() { @@ -2063,7 +2087,7 @@ mod test { let web = env.frontend(); - assert!(!web + assert!(web .get("/dummy-dash/0.1.0/dummy_dash/") .send()? .text()? diff --git a/static/menu.js b/static/menu.js index f7b4fbabe..5ff450c4b 100644 --- a/static/menu.js +++ b/static/menu.js @@ -1,9 +1,19 @@ +const updateMenuPositionForSubMenu = (currentMenuSupplier) => { + const currentMenu = currentMenuSupplier(); + const subMenu = currentMenu?.getElementsByClassName('pure-menu-children')?.[0]; + + subMenu?.style.setProperty('--menu-x', `${currentMenu.getBoundingClientRect().x}px`); +} + // Allow menus to be open and used by keyboard. (function() { var currentMenu; var backdrop = document.createElement("div"); backdrop.style = "display:none;position:fixed;width:100%;height:100%;z-index:1"; document.documentElement.insertBefore(backdrop, document.querySelector("body")); + + addEventListener('resize', () => updateMenuPositionForSubMenu(() => currentMenu)); + function previous(allItems, item) { var i = 1; var l = allItems.length; @@ -52,6 +62,9 @@ this.blur(); } else { if (currentMenu) closeMenu(); + + updateMenuPositionForSubMenu(() => this.parentNode); + openMenu(this.parentNode); } e.preventDefault(); diff --git a/templates/rustdoc/head.html b/templates/rustdoc/head.html index 16523abc4..1aebe42f3 100644 --- a/templates/rustdoc/head.html +++ b/templates/rustdoc/head.html @@ -3,8 +3,6 @@ - {%- if canonical_url -%} - {%- endif -%} diff --git a/templates/style/_navbar.scss b/templates/style/_navbar.scss index 9458d3aad..b8a44a0ed 100644 --- a/templates/style/_navbar.scss +++ b/templates/style/_navbar.scss @@ -50,6 +50,12 @@ div.nav-container { } } + .pure-menu-has-children.pure-menu-active > .pure-menu-link { + &:after { + content:"\25B2"; + } + } + .pure-menu-link { font-size: 12.8px; font-weight: 400; @@ -133,11 +139,21 @@ div.nav-container { } .pure-menu-children { + --menu-x: 0; + + // #{} interpolates a SassScript expression. Using this prevents + // SASS from using its built-in min/max over the CSS min/max functions + --clamped-offset: m#{i}n(var(--menu-x), calc(100vw - 100%)); + border: 1px solid var(--color-border); border-radius: 0 0 2px 2px; - margin-left: -1px; background-color: var(--color-background); + top: calc(#{$top-navbar-height} - 1px); + left: 0; + position: fixed; + transform: translateX(m#{a}x(0%, var(--clamped-offset))); + li { border-left: none; }