From 8df71dac667c5b4f5a2719f4c6374fe20f706c9a Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Sat, 2 Mar 2024 18:24:21 -0500 Subject: [PATCH] Move rendering to a web server --- Cargo.lock | 1457 ++-------------------- Cargo.toml | 9 +- ansi-to-html/fuzz/fuzz_targets/render.rs | 8 +- ansi-to-html/src/lib.rs | 131 +- ansi-to-html/src/main.rs | 13 +- ansi-to-html/src/renderer.rs | 80 +- ci-crates | 3 - ci.sh | 2 +- server/.cargo/config.toml | 2 + server/404.html | 20 + server/Cargo.lock | 786 ++++++++++++ server/Cargo.toml | 21 + server/index.html | 34 + server/src/main.rs | 233 ++++ server/src/tokiort.rs | 152 +++ src/client.rs | 323 ++--- src/db_dump.rs | 5 +- src/diagnose.rs | 17 +- src/main.rs | 44 +- src/render.rs | 141 +-- src/run.rs | 65 +- src/sync.rs | 242 +--- 22 files changed, 1695 insertions(+), 2093 deletions(-) delete mode 100644 ci-crates create mode 100644 server/.cargo/config.toml create mode 100644 server/404.html create mode 100644 server/Cargo.lock create mode 100644 server/Cargo.toml create mode 100644 server/index.html create mode 100644 server/src/main.rs create mode 100644 server/src/tokiort.rs diff --git a/Cargo.lock b/Cargo.lock index 7364a65..64e568d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,21 +84,19 @@ dependencies = [ ] [[package]] -name = "arrayvec" -version = "0.7.4" +name = "anyhow" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +dependencies = [ + "backtrace", +] [[package]] -name = "assert-json-diff" -version = "1.1.0" +name = "arrayvec" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4259cbe96513d2f1073027a259fc2ca917feb3026a5a8d984e3628e490255cc0" -dependencies = [ - "extend", - "serde", - "serde_json", -] +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" @@ -106,404 +104,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "aws-config" -version = "0.54.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3d1e2a1f1ab3ac6c4b884e37413eaa03eb9d901e4fc68ee8f5c1d49721680e" -dependencies = [ - "aws-credential-types", - "aws-http", - "aws-sdk-sso", - "aws-sdk-sts", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-json", - "aws-smithy-types", - "aws-types", - "bytes", - "hex", - "http", - "hyper", - "ring 0.16.20", - "time", - "tokio", - "tower", - "tracing", - "zeroize", -] - -[[package]] -name = "aws-credential-types" -version = "0.54.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0696a0523a39a19087747e4dafda0362dc867531e3d72a3f195564c84e5e08" -dependencies = [ - "aws-smithy-async", - "aws-smithy-types", - "tokio", - "tracing", - "zeroize", -] - -[[package]] -name = "aws-endpoint" -version = "0.54.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80a4f935ab6a1919fbfd6102a80c4fccd9ff5f47f94ba154074afe1051903261" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "aws-types", - "http", - "regex", - "tracing", -] - -[[package]] -name = "aws-http" -version = "0.54.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82976ca4e426ee9ca3ffcf919d9b2c8d14d0cd80d43cc02173737a8f07f28d4d" -dependencies = [ - "aws-credential-types", - "aws-smithy-http", - "aws-smithy-types", - "aws-types", - "bytes", - "http", - "http-body", - "lazy_static", - "percent-encoding", - "pin-project-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-s3" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1533be023eeac69668eb718b1c48af7bd5e26305ed770553d2877ab1f7507b68" -dependencies = [ - "aws-credential-types", - "aws-endpoint", - "aws-http", - "aws-sig-auth", - "aws-sigv4", - "aws-smithy-async", - "aws-smithy-checksums", - "aws-smithy-client", - "aws-smithy-eventstream", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-json", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "bytes", - "bytes-utils", - "fastrand", - "http", - "http-body", - "once_cell", - "percent-encoding", - "regex", - "tokio-stream", - "tower", - "tracing", - "url", -] - -[[package]] -name = "aws-sdk-sso" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0119bacf0c42f587506769390983223ba834e605f049babe514b2bd646dbb2" -dependencies = [ - "aws-credential-types", - "aws-endpoint", - "aws-http", - "aws-sig-auth", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-json", - "aws-smithy-types", - "aws-types", - "bytes", - "http", - "regex", - "tokio-stream", - "tower", -] - -[[package]] -name = "aws-sdk-sts" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270b6a33969ebfcb193512fbd5e8ee5306888ad6c6d5d775cdbfb2d50d94de26" -dependencies = [ - "aws-credential-types", - "aws-endpoint", - "aws-http", - "aws-sig-auth", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-json", - "aws-smithy-query", - "aws-smithy-types", - "aws-smithy-xml", - "aws-types", - "bytes", - "http", - "regex", - "tower", - "tracing", -] - -[[package]] -name = "aws-sig-auth" -version = "0.54.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "660a02a98ab1af83bd8d714afbab2d502ba9b18c49e7e4cddd6bf8837ff778cb" -dependencies = [ - "aws-credential-types", - "aws-sigv4", - "aws-smithy-eventstream", - "aws-smithy-http", - "aws-types", - "http", - "tracing", -] - -[[package]] -name = "aws-sigv4" -version = "0.54.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86529e7b64d902efea8fff52c1b2529368d04f90305cf632729e3713f6b57dc0" -dependencies = [ - "aws-smithy-eventstream", - "aws-smithy-http", - "bytes", - "form_urlencoded", - "hex", - "hmac", - "http", - "once_cell", - "percent-encoding", - "regex", - "sha2", - "time", - "tracing", -] - -[[package]] -name = "aws-smithy-async" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63c712a28a4f2f2139759235c08bf98aca99d4fdf1b13c78c5f95613df0a5db9" -dependencies = [ - "futures-util", - "pin-project-lite", - "tokio", - "tokio-stream", -] - -[[package]] -name = "aws-smithy-checksums" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3875fb4b28606a5368a048016a28c15707f2b21238d5b2e4a23198f590e92c4" -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.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104ca17f56cde00a10207169697dfe9c6810db339d52fb352707e64875b30a44" -dependencies = [ - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-http-tower", - "aws-smithy-protocol-test", - "aws-smithy-types", - "bytes", - "fastrand", - "http", - "http-body", - "hyper", - "hyper-rustls", - "lazy_static", - "pin-project-lite", - "serde", - "tokio", - "tower", - "tracing", -] - -[[package]] -name = "aws-smithy-eventstream" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac250d8c0e42af0097a6837ffc5a6fb9f8ba4107bb53124c047c91bc2a58878f" -dependencies = [ - "aws-smithy-types", - "bytes", - "crc32fast", -] - -[[package]] -name = "aws-smithy-http" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873f316f1833add0d3aa54ed1b0cd252ddd88c792a0cf839886400099971e844" -dependencies = [ - "aws-smithy-eventstream", - "aws-smithy-types", - "bytes", - "bytes-utils", - "futures-core", - "http", - "http-body", - "hyper", - "once_cell", - "percent-encoding", - "pin-project-lite", - "pin-utils", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "aws-smithy-http-tower" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38231d3f5dac9ac7976f44e12803add1385119ffca9e5f050d8e980733d164" -dependencies = [ - "aws-smithy-http", - "aws-smithy-types", - "bytes", - "http", - "http-body", - "pin-project-lite", - "tower", - "tracing", -] - -[[package]] -name = "aws-smithy-json" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd83ff2b79e9f729746fcc8ad798676b68fe6ea72986571569a5306a277a182" -dependencies = [ - "aws-smithy-types", -] - -[[package]] -name = "aws-smithy-protocol-test" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d1c9bcb35ce11055ec128dab2c66a7ed47e2dfff99883e32c21a1ab6d6bee6" -dependencies = [ - "assert-json-diff", - "http", - "pretty_assertions", - "regex", - "roxmltree", - "serde_json", - "thiserror", -] - -[[package]] -name = "aws-smithy-query" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f0445dafe9d2cd50b44339ae3c3ed46549aad8ac696c52ad660b3e7ae8682b" -dependencies = [ - "aws-smithy-types", - "urlencoding", -] - -[[package]] -name = "aws-smithy-types" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8161232eda10290f5136610a1eb9de56aceaccd70c963a26a260af20ac24794f" -dependencies = [ - "base64-simd", - "itoa", - "num-integer", - "ryu", - "time", -] - -[[package]] -name = "aws-smithy-types-convert" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c209718c72f778b0e866e59be9cbbe0e62e835db73ceca48383b1ffafd5340" -dependencies = [ - "aws-smithy-types", - "time", -] - -[[package]] -name = "aws-smithy-xml" -version = "0.54.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343ffe9a9bb3f542675f4df0e0d5933513d6ad038ca3907ad1767ba690a99684" -dependencies = [ - "xmlparser", -] - -[[package]] -name = "aws-types" -version = "0.54.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f15b34253b68cde08e39b0627cc6101bcca64351229484b4743392c035d057" -dependencies = [ - "aws-credential-types", - "aws-smithy-async", - "aws-smithy-client", - "aws-smithy-http", - "aws-smithy-types", - "http", - "rustc_version", - "tracing", -] - [[package]] name = "backoff" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ - "futures-core", "getrandom", "instant", - "pin-project-lite", "rand", - "tokio", ] [[package]] @@ -527,16 +136,6 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" -[[package]] -name = "base64-simd" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" -dependencies = [ - "outref", - "vsimd", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -549,21 +148,6 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" -[[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 = "bumpalo" -version = "3.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" - [[package]] name = "byteorder" version = "1.5.0" @@ -576,16 +160,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -[[package]] -name = "bytes-utils" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" -dependencies = [ - "bytes", - "either", -] - [[package]] name = "cc" version = "1.0.88" @@ -629,7 +203,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn", ] [[package]] @@ -638,79 +212,23 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" -[[package]] -name = "color-eyre" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" -dependencies = [ - "once_cell", - "owo-colors", - "tracing-core", - "tracing-error", -] - [[package]] name = "colorchoice" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - [[package]] name = "crater-at-home" version = "0.1.0" dependencies = [ "ansi-to-html", - "aws-config", - "aws-sdk-s3", - "aws-smithy-types-convert", + "anyhow", "backoff", "clap", - "color-eyre", "csv", "env_logger", "flate2", - "futures-util", "fxhash", "log", "num_cpus", @@ -719,6 +237,7 @@ dependencies = [ "semver", "serde", "serde_json", + "ssh2", "tar", "time", "tokio", @@ -727,15 +246,6 @@ dependencies = [ "xz2", ] -[[package]] -name = "crc32c" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" -dependencies = [ - "rustc_version", -] - [[package]] name = "crc32fast" version = "1.4.0" @@ -745,16 +255,6 @@ dependencies = [ "cfg-if", ] -[[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.3.0" @@ -785,29 +285,6 @@ dependencies = [ "powerfmt", ] -[[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.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" - [[package]] name = "env_logger" version = "0.10.2" @@ -821,12 +298,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - [[package]] name = "errno" version = "0.3.8" @@ -837,37 +308,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "extend" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f47da3a72ec598d9c8937a7ebca8962a5c7a1f28444e38c2b33c771ba3f55f05" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "filetime" version = "0.2.23" @@ -876,7 +316,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -890,12 +330,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -905,58 +339,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-core", - "futures-macro", - "futures-task", - "pin-project-lite", - "pin-utils", - "slab", -] - [[package]] name = "fxhash" version = "0.2.1" @@ -966,16 +348,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.12" @@ -993,31 +365,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - [[package]] name = "heck" version = "0.4.1" @@ -1030,100 +377,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" -dependencies = [ - "http", - "hyper", - "log", - "rustls 0.20.9", - "rustls-native-certs", - "tokio", - "tokio-rustls", -] - [[package]] name = "idna" version = "0.5.0" @@ -1134,22 +393,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indexmap" -version = "2.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "instant" version = "0.1.12" @@ -1177,25 +420,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] -name = "js-sys" -version = "0.3.68" +name = "libc" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" -dependencies = [ - "wasm-bindgen", -] +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] -name = "lazy_static" -version = "1.4.0" +name = "libssh2-sys" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] [[package]] -name = "libc" -version = "0.2.153" +name = "libz-sys" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] name = "linux-raw-sys" @@ -1230,16 +484,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - [[package]] name = "memchr" version = "2.7.1" @@ -1272,24 +516,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.16.0" @@ -1316,22 +542,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "openssl-probe" -version = "0.1.5" +name = "openssl-sys" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "outref" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] -name = "owo-colors" -version = "3.5.0" +name = "parking_lot" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] [[package]] name = "parking_lot" @@ -1340,7 +571,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.9", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -1351,7 +596,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", "windows-targets 0.48.5", ] @@ -1362,38 +607,12 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pin-project" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] - [[package]] name = "pin-project-lite" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkg-config" version = "0.3.30" @@ -1412,40 +631,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "pretty_assertions" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" -dependencies = [ - "diff", - "yansi", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.78" @@ -1494,6 +679,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -1532,21 +726,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -1557,34 +736,16 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] -[[package]] -name = "roxmltree" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921904a62e410e37e215c40381b7117f830d9d89ba60ab5236170541dd25646b" -dependencies = [ - "xmlparser", -] - [[package]] name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" @@ -1599,18 +760,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring 0.16.20", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.22.2" @@ -1618,34 +767,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64", -] - [[package]] name = "rustls-pki-types" version = "1.3.1" @@ -1658,9 +786,9 @@ version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -1669,54 +797,12 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.22" @@ -1740,7 +826,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn", ] [[package]] @@ -1754,37 +840,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -1794,15 +849,6 @@ dependencies = [ "libc", ] -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - [[package]] name = "smallvec" version = "1.13.1" @@ -1821,15 +867,21 @@ dependencies = [ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spin" -version = "0.9.8" +name = "ssh2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "e7fe461910559f6d5604c3731d00d2aafc4a83d1665922e280f42f9a168d5455" +dependencies = [ + "bitflags 1.3.2", + "libc", + "libssh2-sys", + "parking_lot 0.11.2", +] [[package]] name = "strsim" @@ -1843,17 +895,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[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.52" @@ -1885,36 +926,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "thiserror" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "time" version = "0.3.34" @@ -1926,7 +937,6 @@ dependencies = [ "powerfmt", "serde", "time-core", - "time-macros", ] [[package]] @@ -1935,16 +945,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" -[[package]] -name = "time-macros" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" -dependencies = [ - "num-conv", - "time-core", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -1971,7 +971,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", @@ -1987,139 +987,9 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", + "syn", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -2141,12 +1011,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -2163,7 +1027,7 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls 0.22.2", + "rustls", "rustls-pki-types", "rustls-webpki", "url", @@ -2181,12 +1045,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf8parse" version = "0.2.1" @@ -2203,22 +1061,10 @@ dependencies = [ ] [[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "vsimd" -version = "0.8.0" +name = "vcpkg" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vte" @@ -2241,95 +1087,12 @@ dependencies = [ "quote", ] -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[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.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.52", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" - -[[package]] -name = "web-sys" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "webpki-roots" version = "0.26.1" @@ -2513,12 +1276,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "xmlparser" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" - [[package]] name = "xz2" version = "0.1.7" @@ -2528,12 +1285,6 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "zeroize" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index 2a42ff7..3976a6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ env_logger = "0.10" log = "0.4.17" serde = { version = "1.0.140", features = ["derive"] } ansi-to-html = { path = "ansi-to-html" } -color-eyre = "0.6.2" semver = "1.0.12" tar = "0.4.38" flate2 = "1.0.24" @@ -22,14 +21,12 @@ regex = "1.6.0" uuid = { version = "1.1.2", features = ["v4"] } num_cpus = "1.13.1" tokio = { version = "1.21.2", features = ["full"] } -futures-util = "0.3.24" -aws-sdk-s3 = "0.24" -aws-smithy-types-convert = { version = "0.54", features = ["convert-time"] } -aws-config = "0.54" serde_json = "1.0.96" xz2 = "0.1.7" -backoff = { version = "0.4.0", features = ["futures", "tokio"] } +backoff = "0.4.0" time = { version = "0.3", features = ["std"] } +anyhow = { version = "1.0.80", features = ["backtrace"] } +ssh2 = "0.9.4" [profile.release] debug = 1 diff --git a/ansi-to-html/fuzz/fuzz_targets/render.rs b/ansi-to-html/fuzz/fuzz_targets/render.rs index f59c468..d3aea28 100644 --- a/ansi-to-html/fuzz/fuzz_targets/render.rs +++ b/ansi-to-html/fuzz/fuzz_targets/render.rs @@ -1,7 +1,13 @@ #![no_main] use libfuzzer_sys::fuzz_target; +use std::io::Write; +use ansi_to_html::Renderer; fuzz_target!(|data: &[u8]| { - let _ = ansi_to_html::render(String::new(), data); + let mut renderer = Renderer::new(data); + while let Some(line) = renderer.next_line().unwrap() { + std::io::sink().write_all(&line).unwrap(); + } + assert!(matches!(renderer.next_line(), Ok(None))); }); diff --git a/ansi-to-html/src/lib.rs b/ansi-to-html/src/lib.rs index 2e3b043..6f80d41 100644 --- a/ansi-to-html/src/lib.rs +++ b/ansi-to-html/src/lib.rs @@ -1,60 +1,109 @@ -use std::io::Write; +use std::io::Read; mod ansi; mod perform; mod renderer; -pub struct Handle { - renderer: renderer::Renderer, +pub struct Renderer { + inner: renderer::Renderer, parser: vte::Parser, + bytes: R, + state: State, + title: String, } -impl Handle { - pub fn new() -> Self { +#[rustfmt::skip] +macro_rules! log_format { + () => { +r#"{} + + +
{}
+
"#
+    }
+}
+
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+enum State {
+    Fresh,
+    Rendering,
+    Done,
+}
+
+impl Renderer {
+    pub fn new(bytes: R, title: String) -> Self {
         Self {
-            renderer: renderer::Renderer::new(String::new()),
+            inner: renderer::Renderer::new(String::new()),
             parser: vte::Parser::new(),
+            bytes,
+            state: State::Fresh,
+            title,
         }
     }
 
-    pub fn finish(&self, mut output: F) -> std::io::Result<()> {
-        output.write_all(
-            br#"
-            
"#
-        )?;
-        self.renderer.emit_html(&mut output)?;
-        output.write_all(b"
") + pub fn is_empty(&self) -> bool { + self.state == State::Done } -} -impl Write for Handle { - fn write(&mut self, buf: &[u8]) -> std::io::Result { - for b in buf { - self.parser.advance(&mut self.renderer, *b); - } - Ok(buf.len()) + fn first_line(&self) -> Vec { + format!(log_format!(), self.title, self.title).into_bytes() } - fn flush(&mut self) -> std::io::Result<()> { - Ok(()) + pub fn next_line(&mut self) -> Result>, std::io::Error> { + match self.state { + State::Done => return Ok(None), + State::Fresh => { + self.state = State::Rendering; + return Ok(Some(self.first_line())); + } + State::Rendering => {} + } + loop { + let mut byte = [0u8]; + let n = self.bytes.read(&mut byte)?; + if n == 0 { + let line = if let Some(line) = self.inner.remove_oldest_row() { + Some(line) + } else { + self.state = State::Done; + let mut line = Vec::new(); + line.extend(b"
"); + line.into() + }; + return Ok(line); + } + self.parser.advance(&mut self.inner, byte[0]); + if let Some(mut line) = self.inner.pop_completed_row() { + if line.is_empty() { + log::warn!("renderer produced an empty line!"); + line = b"\n".to_vec(); + } + return Ok(Some(line)); + } + } } } - -pub fn render(name: String, bytes: &[u8]) -> (String, String) { - let mut h = Handle { - renderer: renderer::Renderer::new(name), - parser: vte::Parser::new(), - }; - h.write_all(&bytes).unwrap(); - let mut html = Vec::new(); - h.renderer.emit_html(&mut html).unwrap(); - let mut css = Vec::new(); - h.renderer.emit_css(&mut css).unwrap(); - - ( - String::from_utf8(css).unwrap(), - String::from_utf8(html).unwrap(), - ) -} diff --git a/ansi-to-html/src/main.rs b/ansi-to-html/src/main.rs index 3c0f93a..6bc5887 100644 --- a/ansi-to-html/src/main.rs +++ b/ansi-to-html/src/main.rs @@ -1,8 +1,11 @@ -use std::io::{copy, stdin, stdout}; +use std::io::{stdin, stdout, Write}; -fn main() { +fn main() -> Result<(), std::io::Error> { env_logger::init(); - let mut handle = ansi_to_html::Handle::new(); - copy(&mut stdin().lock(), &mut handle).unwrap(); - handle.finish(stdout().lock()).unwrap(); + let mut renderer = ansi_to_html::Renderer::new(stdin().lock(), String::from("stdin")); + let mut out = stdout().lock(); + while let Some(line) = renderer.next_line()? { + out.write_all(&line)?; + } + Ok(()) } diff --git a/ansi-to-html/src/renderer.rs b/ansi-to-html/src/renderer.rs index 0f85e96..9f5dfe7 100644 --- a/ansi-to-html/src/renderer.rs +++ b/ansi-to-html/src/renderer.rs @@ -1,6 +1,7 @@ use crate::ansi::Color; use std::cell::RefCell; use std::collections::HashMap; +use std::collections::VecDeque; pub struct Renderer { pub name: String, @@ -11,7 +12,7 @@ pub struct Renderer { pub foreground: Color, pub background: Color, current_row: usize, - rows: Vec, + rows: VecDeque, styles: Styles, } @@ -112,7 +113,7 @@ impl Renderer { foreground: Color::bright_white(), background: Color::black(), current_row: 0, - rows: vec![Row::new()], + rows: vec![Row::new()].into(), styles: Styles::default(), } } @@ -152,7 +153,7 @@ impl Renderer { pub fn linefeed(&mut self) { self.current_row += 1; if self.current_row == self.rows.len() { - self.rows.push(Row::new()); + self.rows.push_back(Row::new()); } } @@ -185,7 +186,7 @@ impl Renderer { pub fn handle_move(&mut self, row: u16, col: u16) { self.current_row = row as usize; while self.current_row >= self.rows.len() { - self.rows.push(Row::new()); + self.rows.push_back(Row::new()); } self.set_column(col); } @@ -197,7 +198,7 @@ impl Renderer { pub fn move_down_by(&mut self, cells: u16) { self.current_row += cells as usize; while self.current_row >= self.rows.len() { - self.rows.push(Row::new()); + self.rows.push_back(Row::new()); } } @@ -219,7 +220,18 @@ impl Renderer { let _ = &row.cells[..row.position]; } - pub fn emit_html(&self, mut out: W) -> std::io::Result<()> { + pub fn pop_completed_row(&mut self) -> Option> { + if self.rows.len() > 64 { + self.remove_oldest_row() + } else { + None + } + } + + pub fn remove_oldest_row(&mut self) -> Option> { + use std::io::Write; + let mut out = Vec::new(); + let mut prev = Cell { text: ' ', foreground: Color::bright_white(), @@ -230,32 +242,36 @@ impl Renderer { dim: false, }; - out.write_all(b"")?; - - for row in &self.rows[..self.current_row] { - let row = &*row; - for cell in &row.cells { - // Terminal applications will often reset the style right after some formatted text - // then write some whitespace then set it to something again. - // So we only apply style changes if the cell is nonempty. This is a ~50% savings - // in emitted HTML. - if cell.text != ' ' { - if cell.bold != prev.bold || cell.foreground != prev.foreground { - self.styles.with(cell.foreground, cell.bold, |class| { + out.extend(b""); + + let row = self.rows.pop_front()?; + self.current_row = self.current_row.saturating_sub(1); + + for cell in &row.cells { + // Terminal applications will often reset the style right after some formatted text + // then write some whitespace then set it to something again. + // So we only apply style changes if the cell is nonempty. This is a ~50% savings + // in emitted HTML. + if cell.text != ' ' { + if cell.bold != prev.bold || cell.foreground != prev.foreground { + self.styles + .with(cell.foreground, cell.bold, |class| { write!(out, "", class) - })?; - } - prev = cell.clone(); - } - match cell.text { - '<' => out.write_all(b"<")?, - '>' => out.write_all(b">")?, - c => write!(out, "{}", c)?, + }) + .unwrap(); } + prev = cell.clone(); + } + match cell.text { + '<' => out.extend(b"<"), + '>' => out.extend(b">"), + c => write!(out, "{}", c).unwrap(), } - out.write_all(&[b'\n'])?; } - out.write_all(b"") + out.extend(&[b'\n']); + out.extend(b""); + + Some(out) } pub fn emit_css(&self, mut out: W) -> std::io::Result<()> { @@ -271,12 +287,4 @@ impl Renderer { Ok(()) } - - /* - pub fn clear(&mut self) { - self.rows.clear(); - self.rows.push(Row::new()); - self.current_row = 0; - } - */ } diff --git a/ci-crates b/ci-crates deleted file mode 100644 index 2455a03..0000000 --- a/ci-crates +++ /dev/null @@ -1,3 +0,0 @@ -libc -serde -itoa diff --git a/ci.sh b/ci.sh index 82ad40f..260ca14 100755 --- a/ci.sh +++ b/ci.sh @@ -23,5 +23,5 @@ then else group cargo build group cargo run -- sync --tool="$1" --bucket=miri-bot-dev - group cargo run -- run --tool="$1" --bucket=miri-bot-dev --crate-list=ci-crates --rerun + group cargo run -- run --tool="$1" --bucket=miri-bot-dev --crates=10 fi diff --git a/server/.cargo/config.toml b/server/.cargo/config.toml new file mode 100644 index 0000000..7d3d57a --- /dev/null +++ b/server/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.aarch64-unknown-linux-musl] +linker = "aarch64-linux-gnu-gcc" diff --git a/server/404.html b/server/404.html new file mode 100644 index 0000000..aecd266 --- /dev/null +++ b/server/404.html @@ -0,0 +1,20 @@ + +oops +
error: No such file or directory (http error 404)
+
+error: aborting due to previous error
diff --git a/server/Cargo.lock b/server/Cargo.lock new file mode 100644 index 0000000..c58b7ba --- /dev/null +++ b/server/Cargo.lock @@ -0,0 +1,786 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi-to-html" +version = "0.1.0" +dependencies = [ + "env_logger 0.10.2", + "log", + "vte", +] + +[[package]] +name = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +dependencies = [ + "backtrace", +] + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "log", +] + +[[package]] +name = "env_logger" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[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.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" + +[[package]] +name = "server" +version = "0.1.0" +dependencies = [ + "ansi-to-html", + "anyhow", + "bytes", + "env_logger 0.11.2", + "flate2", + "http-body-util", + "hyper", + "log", + "pin-project-lite", + "semver", + "tokio", + "xz2", +] + +[[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 = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "syn" +version = "2.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "vte" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" +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 = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[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.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] diff --git a/server/Cargo.toml b/server/Cargo.toml new file mode 100644 index 0000000..cd3b3ed --- /dev/null +++ b/server/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "server" +version = "0.1.0" +edition = "2021" + +[dependencies] +anyhow = { version = "1.0.80", features = ["backtrace"] } +bytes = "1.5.0" +http-body-util = "0.1.0" +hyper = { version = "1.2.0", features = ["server", "http1"] } +pin-project-lite = "0.2.13" +tokio = { version = "1.36.0", features = ["full"] } +ansi-to-html = { path = "../ansi-to-html" } +log = "0.4.21" +env_logger = "0.11.2" +semver = "1.0.22" +xz2 = "0.1.7" +flate2 = "1.0.28" + +[profile.release] +debug = 1 diff --git a/server/index.html b/server/index.html new file mode 100644 index 0000000..b133e1d --- /dev/null +++ b/server/index.html @@ -0,0 +1,34 @@ + + + +

Hello! This website hosts a library of logs, displayed as if you have just run cargo miri test on every published crate on crates.io. +

Try searching for a crate below, if one is found you will be redirected to the build output for its most recently published version. For crates where Miri detects UB, the page will be automatically scrolled to the first UB report. +

+ +

+

+ diff --git a/server/src/main.rs b/server/src/main.rs new file mode 100644 index 0000000..80225c5 --- /dev/null +++ b/server/src/main.rs @@ -0,0 +1,233 @@ +use ansi_to_html::Renderer; +use anyhow::Result; +use bytes::Bytes; +use hyper::body::Frame; +use hyper::body::Incoming; +use hyper::body::SizeHint; +use hyper::header::HeaderValue; +use hyper::server::conn::http1; +use hyper::service::service_fn; +use hyper::{Request, Response, StatusCode}; +use semver::Version; +use std::fs::File; +use std::io::BufRead; +use std::io::BufReader; +use std::net::SocketAddr; +use std::pin::Pin; +use std::task::Context; +use std::task::Poll; +use tokio::net::TcpListener; +use xz2::bufread::XzDecoder; + +mod tokiort; +use tokiort::TokioIo; + +const NOT_FOUND: &str = include_str!("../404.html"); +const LANDING_PAGE: &str = include_str!("../index.html"); + +async fn handle(req: Request) -> Result> { + let mut response = inner(req).await; + response.headers_mut().insert( + "Content-Type", + HeaderValue::from_static("text/html;charset=utf-8"), + ); + Ok(response) +} + +async fn inner(req: Request) -> Response { + log::info!("{req:?}"); + + let path = req.uri().path(); + let mut components = path + .split('/') + .filter(|s| !s.is_empty()) + .collect::>(); + + if components.get(0) == Some(&"staging") { + components.remove(0); + } + + let root = "/crater-at-home"; + let tool = "miri"; + + let from_file = |path: &str, title: String| { + if let Ok(file) = File::open(path) { + log::info!("Rendering from file {}", path); + let reader = BufReader::new(file); + let reader = XzDecoder::new(reader); + let body = Body { + is_eof: false, + kind: BodyKind::Rendered(Renderer::new(reader, title)), + }; + Response::new(body) + } else { + log::info!("Unable to open file {}", path); + error_response() + } + }; + + match components[..] { + ["logs", krate, version] => { + let path = format!("{root}/{tool}/raw/{krate}/{version}"); + from_file(&path, format!("{} {}", krate, version)) + } + ["ub"] => { + if let Ok(file) = File::open(format!("{root}/{tool}/ub")) { + let mut reader = BufReader::new(file); + reader.fill_buf().unwrap(); + Response::new(Body { + is_eof: false, + kind: BodyKind::Streamed(reader), + }) + } else { + error_response() + } + } + [] => { + if let Some(krate) = req.uri().query() { + let path = format!("{root}/{tool}/raw/{krate}"); + log::info!("{path}"); + + let mut max_version = None; + let Ok(iter) = std::fs::read_dir(&path) else { + return error_response(); + }; + for entry in iter { + let entry = entry.unwrap(); + let path = entry.path(); + let Some(file_name) = path.file_name() else { + continue; + }; + let Some(file_name) = file_name.to_str() else { + continue; + }; + let version = Version::parse(file_name).ok(); + max_version = max_version.max(version); + } + + if let Some(version) = max_version { + let path = format!("{path}/{version}"); + log::info!("{}", path); + from_file(&path, format!("{} {}", path, version)) + } else { + error_response() + } + } else { + Response::new(Body { + is_eof: false, + kind: BodyKind::Static(LANDING_PAGE), + }) + } + } + _ => error_response(), + } +} + +fn error_response() -> Response { + let mut response = Response::new(Body { + is_eof: false, + kind: BodyKind::Static(NOT_FOUND), + }); + *response.status_mut() = StatusCode::NOT_FOUND; + response +} + +#[tokio::main] +async fn main() -> Result<()> { + env_logger::init(); + + let addr = SocketAddr::from(([0, 0, 0, 0], 8080)); + + let listener = TcpListener::bind(addr).await?; + log::info!("Listening on http://{}", addr); + loop { + let (stream, _) = listener.accept().await?; + let io = TokioIo::new(stream); + + tokio::task::spawn(async move { + if let Err(err) = http1::Builder::new() + .serve_connection(io, service_fn(handle)) + .await + { + log::error!("Error serving connection: {:?}", err); + } + }); + } +} + +struct Body { + is_eof: bool, + kind: BodyKind, +} + +enum BodyKind { + Static(&'static str), + Streamed(BufReader), + Rendered(Renderer>>), +} + +impl hyper::body::Body for Body { + type Data = Bytes; + type Error = anyhow::Error; + + fn poll_frame( + mut self: Pin<&mut Self>, + _cx: &mut Context<'_>, + ) -> Poll, Self::Error>>> { + match &mut self.kind { + BodyKind::Static(s) => { + if s.is_empty() { + Poll::Ready(None) + } else { + let chunk = Bytes::from_static(s.as_bytes()); + *s = ""; + Poll::Ready(Some(Ok(Frame::data(chunk)))) + } + } + BodyKind::Rendered(renderer) => { + if let Ok(Some(line)) = renderer.next_line() { + let mut line = String::from_utf8_lossy(&line); + for pat in [ + "Undefined Behavior:", + "ERROR: AddressSanitizer:", + "attempted to leave type", + "misaligned pointer dereference", + ] { + if line.contains(pat) { + let replacement = format!("{pat}"); + line = line.replacen(pat, &replacement, 1).into(); + break; + } + } + let chunk = Bytes::copy_from_slice(line.as_bytes()); + Poll::Ready(Some(Ok(Frame::data(chunk)))) + } else { + Poll::Ready(None) + } + } + BodyKind::Streamed(reader) => { + let buf = reader.fill_buf()?; + let len = buf.len(); + let chunk = Bytes::copy_from_slice(buf); + reader.consume(len); + reader.fill_buf()?; + if chunk.is_empty() { + Poll::Ready(None) + } else { + Poll::Ready(Some(Ok(Frame::data(chunk)))) + } + } + } + } + + fn is_end_stream(&self) -> bool { + self.is_eof + } + + fn size_hint(&self) -> SizeHint { + match &self.kind { + BodyKind::Static(s) => SizeHint::with_exact(s.len() as u64), + BodyKind::Streamed(_) | BodyKind::Rendered { .. } => SizeHint::default(), + } + } +} diff --git a/server/src/tokiort.rs b/server/src/tokiort.rs new file mode 100644 index 0000000..5719999 --- /dev/null +++ b/server/src/tokiort.rs @@ -0,0 +1,152 @@ +use std::{ + pin::Pin, + task::{Context, Poll}, +}; + +use pin_project_lite::pin_project; + +pin_project! { + #[derive(Debug)] + pub struct TokioIo { + #[pin] + inner: T, + } +} + +impl TokioIo { + pub fn new(inner: T) -> Self { + Self { inner } + } +} + +impl hyper::rt::Read for TokioIo +where + T: tokio::io::AsyncRead, +{ + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + mut buf: hyper::rt::ReadBufCursor<'_>, + ) -> Poll> { + let n = unsafe { + let mut tbuf = tokio::io::ReadBuf::uninit(buf.as_mut()); + match tokio::io::AsyncRead::poll_read(self.project().inner, cx, &mut tbuf) { + Poll::Ready(Ok(())) => tbuf.filled().len(), + other => return other, + } + }; + + unsafe { + buf.advance(n); + } + Poll::Ready(Ok(())) + } +} + +impl hyper::rt::Write for TokioIo +where + T: tokio::io::AsyncWrite, +{ + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + tokio::io::AsyncWrite::poll_write(self.project().inner, cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + tokio::io::AsyncWrite::poll_flush(self.project().inner, cx) + } + + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + tokio::io::AsyncWrite::poll_shutdown(self.project().inner, cx) + } + + fn is_write_vectored(&self) -> bool { + tokio::io::AsyncWrite::is_write_vectored(&self.inner) + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[std::io::IoSlice<'_>], + ) -> Poll> { + tokio::io::AsyncWrite::poll_write_vectored(self.project().inner, cx, bufs) + } +} + +/* +impl tokio::io::AsyncRead for TokioIo +where + T: hyper::rt::Read, +{ + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + tbuf: &mut tokio::io::ReadBuf<'_>, + ) -> Poll> { + //let init = tbuf.initialized().len(); + let filled = tbuf.filled().len(); + let sub_filled = unsafe { + let mut buf = hyper::rt::ReadBuf::uninit(tbuf.unfilled_mut()); + + match hyper::rt::Read::poll_read(self.project().inner, cx, buf.unfilled()) { + Poll::Ready(Ok(())) => buf.filled().len(), + other => return other, + } + }; + + let n_filled = filled + sub_filled; + // At least sub_filled bytes had to have been initialized. + let n_init = sub_filled; + unsafe { + tbuf.assume_init(n_init); + tbuf.set_filled(n_filled); + } + + Poll::Ready(Ok(())) + } +} +*/ + +/* +impl tokio::io::AsyncWrite for TokioIo +where + T: hyper::rt::Write, +{ + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + buf: &[u8], + ) -> Poll> { + hyper::rt::Write::poll_write(self.project().inner, cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + hyper::rt::Write::poll_flush(self.project().inner, cx) + } + + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + ) -> Poll> { + hyper::rt::Write::poll_shutdown(self.project().inner, cx) + } + + fn is_write_vectored(&self) -> bool { + hyper::rt::Write::is_write_vectored(&self.inner) + } + + fn poll_write_vectored( + self: Pin<&mut Self>, + cx: &mut Context<'_>, + bufs: &[std::io::IoSlice<'_>], + ) -> Poll> { + hyper::rt::Write::poll_write_vectored(self.project().inner, cx, bufs) + } +} +*/ diff --git a/src/client.rs b/src/client.rs index c170fd0..92829a9 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,273 +1,154 @@ -use crate::{Crate, Status, Tool, Version}; -use aws_sdk_s3::model::{CompletedMultipartUpload, CompletedPart, Object}; -use aws_smithy_types_convert::date_time::DateTimeExt; +use crate::{Crate, Tool, Version}; +use anyhow::Result; use backoff::Error; use backoff::ExponentialBackoff; -use color_eyre::Result; -use futures_util::StreamExt; -use futures_util::TryFutureExt; -use std::collections::HashMap; -use std::future::Future; +use ssh2::Session; +use std::io::Read; +use std::io::Write; +use std::net::TcpStream; +use std::path::Path; +use xz2::write::XzDecoder; #[derive(Clone)] pub struct Client { - inner: aws_sdk_s3::Client, - bucket: String, + session: Session, tool: Tool, } -const CHUNK_SIZE: usize = 5 * 1024 * 1024; - impl Client { - pub async fn new(tool: Tool, bucket: &str) -> Result { - let config = aws_config::load_from_env().await; - let inner = aws_sdk_s3::Client::new(&config); - Ok(Self { - inner, - bucket: bucket.to_string(), - tool, - }) - } - - pub fn tool(&self) -> Tool { - self.tool - } - - pub async fn upload(&self, key: &str, data: &[u8], content_type: &str) -> Result<()> { - retry(|| self._upload(key, data, content_type)).await - } - - async fn _upload(&self, key: &str, data: &[u8], content_type: &str) -> Result<()> { - // S3 has a minimum multipart upload size of 5 MB. If we are below that, we need to use - // PutObject. - if data.len() < CHUNK_SIZE { - self.inner - .put_object() - .bucket(&self.bucket) - .key(key) - .body(data.to_vec().into()) - .content_type(content_type) - .send() - .await?; - return Ok(()); - } - - let res = self - .inner - .create_multipart_upload() - .bucket(&self.bucket) - .key(key) - .content_type(content_type) - .send() - .await?; - let upload_id = res.upload_id().unwrap(); - let mut parts = Vec::new(); - for (part_number, chunk) in data.chunks(CHUNK_SIZE).enumerate() { - // part numbers must start at 1 - let part_number = part_number as i32 + 1; - let upload_part_res = self - .inner - .upload_part() - .key(key) - .bucket(&self.bucket) - .upload_id(upload_id) - .body(chunk.to_vec().into()) - .part_number(part_number) - .send() - .await?; - parts.push( - CompletedPart::builder() - .e_tag(upload_part_res.e_tag.unwrap_or_default()) - .part_number(part_number) - .build(), - ) - } - let completed_multipart_upload = CompletedMultipartUpload::builder() - .set_parts(Some(parts)) - .build(); - self.inner - .complete_multipart_upload() - .bucket(&self.bucket) - .key(key) - .multipart_upload(completed_multipart_upload) - .upload_id(upload_id) - .send() - .await?; - + pub fn new(tool: Tool, server: &str) -> Result { + let stream = TcpStream::connect(server)?; + let mut session = Session::new()?; + session.set_tcp_stream(stream); + session.handshake()?; + session.userauth_pubkey_file( + "ubuntu", + None, + Path::new("/home/ben/.ssh/general-purpose.pem"), + None, + )?; + session.set_keepalive(true, 60); + + let sftp = session.sftp()?; + let raw_dir = Path::new(tool.raw_path()); + let parent = raw_dir.parent().unwrap(); + let _ = sftp.mkdir(parent, 0o755); + let _ = sftp.mkdir(raw_dir, 0o755); + + Ok(Self { session, tool }) + } + + pub fn upload(&self, key: &str, data: &[u8]) -> Result<()> { + self._upload(key, data) + } + + fn _upload(&self, key: &str, data: &[u8]) -> Result<()> { + log::debug!("Attempting upload to {}", key); + let parent = Path::new(key).parent().unwrap(); + let sftp = self.session.sftp()?; + let _ = sftp.mkdir(parent, 0o755); + + let mut remote_file = + self.session + .scp_send(Path::new(key), 0o644, data.len() as u64, None)?; + remote_file.write_all(data)?; + remote_file.send_eof()?; + remote_file.wait_eof()?; + remote_file.close()?; + remote_file.wait_close()?; + log::debug!("Completed upload to {}", key); Ok(()) } - pub async fn upload_raw(&self, krate: &Crate, data: Vec) -> Result<()> { - self.upload(&self.tool.raw_crate_path(krate), &data, "text/plain") - .await - } - - pub async fn upload_html(&self, krate: &Crate, data: Vec) -> Result<()> { - let key = self.tool.rendered_crate_path(krate); - self.upload(&key, &data, "text/html;charset=utf-8").await - } - - pub async fn download_raw(&self, krate: &Crate) -> Result> { - self.download(&self.tool.raw_crate_path(krate)).await + pub fn upload_raw(&self, krate: &Crate, data: &[u8]) -> Result<()> { + self.upload(&self.tool.raw_crate_path(krate), data) } - pub async fn download_html(&self, krate: &Crate) -> Result> { - self.download(&self.tool.rendered_crate_path(krate)).await + pub fn download_raw(&self, krate: &Crate) -> Result> { + let bytes = self.download(&self.tool.raw_crate_path(krate))?; + let mut decoder = XzDecoder::new(Vec::new()); + decoder.write_all(&bytes)?; + Ok(decoder.finish()?) } - async fn download(&self, key: &str) -> Result> { - retry(|| self._download(key)).await + fn download(&self, key: &str) -> Result> { + self._download(key) } - async fn _download(&self, key: &str) -> Result> { - let response = self - .inner - .get_object() - .bucket(&self.bucket) - .key(key) - .send() - .await?; - let bytes = response.body.collect().await?; - Ok(bytes.to_vec()) + fn _download(&self, key: &str) -> Result> { + log::debug!("Attempting download of {}", key); + let (mut remote_file, stat) = self.session.scp_recv(Path::new(key))?; + let mut contents = Vec::with_capacity(stat.size() as usize); + remote_file.read_to_end(&mut contents)?; + log::debug!("Completed download of {}", key); + Ok(contents) } - pub async fn get_crate_downloads(&self) -> Result>> { - let response = self - .inner - .get_object() - .bucket(&self.bucket) - .key("downloads.json") - .send() - .await?; - let bytes = response.body.collect().await?; - let blob = bytes.to_vec(); - let crates: HashMap<_, _> = serde_json::from_slice(&blob)?; - Ok(crates) - } - - pub async fn get_crate_versions(&self) -> Result> { - let response = self - .inner - .get_object() - .bucket(&self.bucket) - .key("crates.json") - .send() - .await?; - let bytes = response.body.collect().await?; - let blob = bytes.to_vec(); + pub fn get_crate_versions(&self) -> Result> { + let blob = self.download("/crater-at-home/crates.json")?; let crates: Vec<(String, String)> = serde_json::from_slice(&blob)?; let crates = crates .into_iter() .map(|krate| Crate { name: krate.0, version: Version::parse(&krate.1), - status: Status::Unknown, recent_downloads: None, }) .collect(); Ok(crates) } - pub async fn list_finished_crates(&self, dur: Option) -> Result> { - let now = time::OffsetDateTime::now_utc(); - let prefix = format!("{}/", self.tool.raw_path()); - let mut res = self - .inner - .list_objects_v2() - .bucket(&self.bucket) - .prefix(&prefix) - .into_paginator() - .send(); + pub fn list_finished_crates(&self, _dur: Option) -> Result> { let mut files = Vec::new(); - while let Some(res) = res.next().await { - let page = res?; - for obj in page.contents().unwrap_or_default() { - if let Some(dur) = dur { - if let Some(modified) = obj.last_modified() { - let modified = modified.to_time().unwrap(); - // Ignore crates older than dur - if now - modified > dur { - continue; - } - } - } - if let Some(key) = obj.key().and_then(|key| key.strip_prefix(&prefix)) { - let mut it = key.split('/'); - let Some(name) = it.next() else { - continue; - }; - let Some(version) = it.next() else { - continue; - }; - files.push(Crate { - name: name.to_string(), - version: Version::parse(version), - status: Status::Unknown, - recent_downloads: None, - }); + let prefix = Path::new(self.tool.raw_path()); + + let sftp = self.session.sftp()?; + let mut dir = match sftp.opendir(prefix) { + Ok(dir) => dir, + Err(e) => { + if e.code() == ssh2::ErrorCode::SFTP(2) { + sftp.mkdir(prefix, 0o755)?; + return Ok(Vec::new()); } + return Err(e)?; } - } - Ok(files) - } - - pub async fn list_rendered_crates(&self) -> Result> { - let prefix = format!("{}/", self.tool.html_path()); - let mut res = self - .inner - .list_objects_v2() - .bucket(&self.bucket) - .prefix(&prefix) - .into_paginator() - .send(); - let mut files = Vec::new(); - while let Some(res) = res.next().await { - let page = res?; - for obj in page.contents().unwrap_or_default() { - if let Some(key) = obj.key().and_then(|key| key.strip_prefix(&prefix)) { - files.push(key.to_string()); + }; + while let Ok((name, _stat)) = dir.readdir() { + if name == Path::new(".") || name == Path::new("..") { + continue; + } + let path = prefix.join(&name); + let mut name_dir = sftp.opendir(&path)?; + while let Ok((version, _stat)) = name_dir.readdir() { + if version == Path::new(".") || version == Path::new("..") { + continue; } + files.push(Crate { + name: name.display().to_string(), + version: Version::parse(version.to_str().unwrap()), + recent_downloads: None, + }); } } - Ok(files) - } - pub async fn upload_landing_page(&self, data: Vec) -> Result<()> { - self.upload( - self.tool.landing_page_path(), - &data, - "text/html;charset=utf-8", - ) - .await - } - - pub async fn list_db(&self) -> Result> { - let res = retry(move || { - self.inner - .list_objects_v2() - .bucket(&self.bucket) - .prefix("crates.json") - .max_keys(1) - .send() - }) - .await?; - let meta = res.contents.and_then(|c| c.first().cloned()); - Ok(meta) + Ok(files) } } -async fn retry(mut f: Func) -> std::result::Result +fn retry(mut f: Func) -> std::result::Result where - Func: FnMut() -> Fut, - Fut: Future>, + Func: FnMut() -> std::result::Result, E: std::fmt::Display, { - backoff::future::retry_notify( + backoff::retry_notify( ExponentialBackoff::default(), || f().map_err(Error::transient), |e, _| { log::warn!("{}", e); }, ) - .await + .map_err(|e| match e { + backoff::Error::Permanent(e) => e, + backoff::Error::Transient { err, .. } => err, + }) } diff --git a/src/db_dump.rs b/src/db_dump.rs index 94e462d..fcb2ed5 100644 --- a/src/db_dump.rs +++ b/src/db_dump.rs @@ -1,5 +1,5 @@ -use crate::{Crate, Status, Version}; -use color_eyre::Result; +use crate::{Crate, Version}; +use anyhow::Result; use flate2::read::GzDecoder; use fxhash::FxHashMap; use serde::Deserialize; @@ -83,7 +83,6 @@ pub fn download() -> Result> { name: name.clone(), recent_downloads: Some(krate.recent_downloads), version: krate.version, - status: Status::Unknown, }) }) .collect::>(); diff --git a/src/diagnose.rs b/src/diagnose.rs index 02dc45c..f823ade 100644 --- a/src/diagnose.rs +++ b/src/diagnose.rs @@ -1,17 +1,15 @@ -use crate::{Cause, Crate, Status}; - -use color_eyre::Result; +use crate::{Cause, Status}; use once_cell::sync::Lazy; use regex::Regex; static ANSI_REGEX: Lazy = Lazy::new(|| Regex::new("\x1b(\\[[0-9;?]*[A-HJKSTfhilmnsu]|\\(B)").unwrap()); -pub fn diagnose(krate: &mut Crate, output: &[u8]) -> Result<()> { +pub fn diagnose(output: &[u8]) -> Status { let output = String::from_utf8_lossy(output); let output = ANSI_REGEX.replace_all(&output, "").to_string(); // Strip ANSI escape codes from the output; - krate.status = if output.contains("Undefined Behavior: ") { + if output.contains("Undefined Behavior: ") { Status::UB { cause: diagnose_output(&output), } @@ -61,8 +59,7 @@ pub fn diagnose(krate: &mut Crate, output: &[u8]) -> Result<()> { Status::Error(String::new()) } else { Status::Passing - }; - Ok(()) + } } fn diagnose_asan(output: &str) -> Vec { @@ -116,7 +113,7 @@ fn diagnose_output(output: &str) -> Vec { let kind; if line.contains("Data race detected") { - kind = "data race".to_string() + kind = "data race".to_string(); } else if line.contains("encountered uninitialized") || line.contains("this operation requires initialized memory") { @@ -157,7 +154,7 @@ fn diagnose_output(output: &str) -> Vec { } } else if line.contains("type validation failed") { let second = line.split(": encountered").nth(1).unwrap().trim(); - kind = format!("type validation failed: encountered {}", second); + kind = format!("type validation failed: encountered {second}"); } else { kind = line .split("Undefined Behavior: ") @@ -181,7 +178,7 @@ fn diagnose_output(output: &str) -> Vec { } } } - causes.push(Cause { kind, source_crate }) + causes.push(Cause { kind, source_crate }); } causes.sort(); diff --git a/src/main.rs b/src/main.rs index cf2cf89..96cf397 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ +use anyhow::Result; use clap::Parser; -use color_eyre::Result; use diagnose::diagnose; use std::{fmt, str::FromStr}; @@ -30,12 +30,11 @@ fn main() -> Result<()> { std::env::set_var("RUST_LOG", "info"); } env_logger::init(); - color_eyre::install()?; let args = Cli::parse(); match args.command { - Commands::Run(args) => run::run(args), - Commands::Sync(args) => sync::run(args), + Commands::Run(args) => run::run(&args), + Commands::Sync(args) => sync::run(&args), } } @@ -50,38 +49,16 @@ pub enum Tool { impl Tool { pub fn raw_path(self) -> &'static str { match self { - Tool::Miri => "miri/raw", - Tool::Asan => "asan/raw", - Tool::Build => "build/raw", - Tool::Check => "check/raw", + Tool::Miri => "/crater-at-home/miri/raw", + Tool::Asan => "/crater-at-home/asan/raw", + Tool::Build => "/crater-at-home/build/raw", + Tool::Check => "/crater-at-home/check/raw", } } pub fn raw_crate_path(self, krate: &Crate) -> String { format!("{}/{}/{}", self.raw_path(), krate.name, krate.version) } - - pub fn html_path(self) -> &'static str { - match self { - Tool::Miri => "miri/logs", - Tool::Asan => "asan/logs", - Tool::Build => "build/logs", - Tool::Check => "check/logs", - } - } - - pub fn rendered_crate_path(self, krate: &Crate) -> String { - format!("{}/{}/{}", self.html_path(), krate.name, krate.version) - } - - pub fn landing_page_path(self) -> &'static str { - match self { - Tool::Miri => "miri/index.html", - Tool::Asan => "asan/index.html", - Tool::Build => "build/index.html", - Tool::Check => "check/index.html", - } - } } impl fmt::Display for Tool { @@ -105,7 +82,7 @@ impl FromStr for Tool { "asan" => Ok(Self::Asan), "build" => Ok(Self::Build), "check" => Ok(Self::Check), - _ => Err(format!("Invalid tool {}", s)), + _ => Err(format!("Not a supported tool: {s}")), } } } @@ -115,7 +92,6 @@ pub struct Crate { pub name: String, pub version: Version, pub recent_downloads: Option, - pub status: Status, } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Hash, Debug)] @@ -144,8 +120,8 @@ impl Version { impl fmt::Display for Version { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { - Version::Parsed(v) => write!(f, "{}", v), - Version::Unparsed(v) => write!(f, "{}", v), + Version::Parsed(v) => write!(f, "{v}"), + Version::Unparsed(v) => write!(f, "{v}"), } } } diff --git a/src/render.rs b/src/render.rs index 351def1..9ae8bd1 100644 --- a/src/render.rs +++ b/src/render.rs @@ -1,72 +1,7 @@ use crate::{Crate, Status}; -use color_eyre::eyre::Result; +use anyhow::Result; use std::fmt::Write; -#[rustfmt::skip] -macro_rules! log_format { - () => { -r#"{} {} - - -
{} {}
-
{}
"# - } -} - -pub fn render_crate(krate: &Crate, output: &[u8]) -> String { - let (css, mut encoded) = - ansi_to_html::render(format!("{}/{}", krate.name, krate.version), output); - - // Remove blank rows from the bottom of the terminal output - let ending = "\n"; - while encoded.ends_with(ending) { - encoded.remove(encoded.len() - ending.len()); - } - - for pat in [ - "Undefined Behavior:", - "ERROR: AddressSanitizer:", - "SIGILL: illegal instruction", - "attempted to leave type", - "misaligned pointer dereference", - "unsafe precondition(s) violated", - ] { - if encoded.contains(pat) { - let replacement = format!("{}", pat); - encoded = encoded.replacen(pat, &replacement, 1); - break; - } - } - - format!( - log_format!(), - css, krate.name, krate.version, krate.name, krate.version, encoded - ) -} - const OUTPUT_HEADER: &str = r#" - -

Hello! This website hosts a library of logs, displayed as if you have just run cargo miri test on every published crate on crates.io. -

Try searching for a crate below, if one is found you will be redirected to the build output for its most recently published version. For crates where Miri detects UB, the page will be automatically scrolled to the first UB report. -

- -

-

-"); - - client.upload_landing_page(output.into_bytes()).await?; - - Ok(()) -} - -static ERROR_PAGE: &str = r#" -oops -
error: No such file or directory (http error 404)
-
-error: aborting due to previous error
"#;