From accbd337bf164f9a26786f986a3e7ced9bdbeb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 20 Jan 2023 14:39:19 -0300 Subject: [PATCH 1/7] github: build: Use cross in cargo step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99fa668..749b012 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,6 +91,7 @@ jobs: target: ${{ matrix.target }} - uses: actions-rs/cargo@v1 with: + use-cross: true command: build args: --release --bin simple-http-server --locked - uses: actions/upload-artifact@v2 From d51eddb0c0fdd16ebbee0c767e28c4cb7d34795b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 20 Jan 2023 14:39:29 -0300 Subject: [PATCH 2/7] github: build: Specify target in cargo step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 749b012..4a5b272 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,7 @@ jobs: with: use-cross: true command: build - args: --release --bin simple-http-server --locked + args: --release --bin simple-http-server --locked --target=${{ matrix.TARGET }} - uses: actions/upload-artifact@v2 with: name: ${{ matrix.target }}-simple-http-server${{ env.BINARY_EXTENSION }} From f1027f4497656e7ebe4acd3535f197f45326f17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 20 Jan 2023 14:43:12 -0300 Subject: [PATCH 3/7] github: build: Fix PATH_BINARY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a5b272..a61fa8e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,7 @@ jobs: target: x86_64-pc-windows-msvc env: BINARY_EXTENSION: ${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} - PATH_BINARY: ${{ github.workspace }}/target/release/simple-http-server${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} + PATH_BINARY: ${{ github.workspace }}/target/${{ matrix.TARGET }}/release/simple-http-server${{ matrix.EXTENSION }}${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 From fe903df3afc3e97bc83eccab28fb3bd9276e71ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 20 Jan 2023 15:43:42 -0300 Subject: [PATCH 4/7] Cargo: Add rustls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- Cargo.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 980fff2..aef3090 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ rand = "0.8.3" url = "2.1.0" hyper-native-tls = { version = "0.3.0", optional = true } openssl = { version = "0.10", features = ["vendored"], optional = true } +rustls = { version = "0.20", optional = true } mime_guess = "2.0" open = "1" # Iron crates @@ -33,6 +34,6 @@ percent-encoding = "2.1.0" path-dedot = "1" [features] -default = ["tls"] -only-openssl = ["tls", "openssl"] -tls = ["hyper-native-tls"] +default = ["native-tls"] +only-openssl = ["native-tls", "openssl"] +native-tls = ["hyper-native-tls"] From 224608c0566099b79e17da4a00aa51500bd36601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 20 Jan 2023 15:45:07 -0300 Subject: [PATCH 5/7] github: build: Use rustls with cross MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a61fa8e..3540fdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,7 @@ jobs: with: use-cross: true command: build - args: --release --bin simple-http-server --locked --target=${{ matrix.TARGET }} + args: --release --bin simple-http-server --locked --target=${{ matrix.TARGET }} --no-default-features --features=rustls - uses: actions/upload-artifact@v2 with: name: ${{ matrix.target }}-simple-http-server${{ env.BINARY_EXTENSION }} From f714e95870a555d18f71d69a9d3a715827b003ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 20 Jan 2023 15:45:19 -0300 Subject: [PATCH 6/7] Cargo.lock: Update file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- Cargo.lock | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index a41e384..48c0967 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,6 +75,12 @@ dependencies = [ "safemem", ] +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + [[package]] name = "byteorder" version = "1.4.3" @@ -345,6 +351,15 @@ dependencies = [ "log 0.4.17", ] +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "language-tags" version = "0.2.2" @@ -866,6 +881,33 @@ dependencies = [ "winapi", ] +[[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", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustls" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +dependencies = [ + "log 0.4.17", + "ring", + "sct", + "webpki", +] + [[package]] name = "safemem" version = "0.3.3" @@ -882,6 +924,16 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "security-framework" version = "2.6.1" @@ -926,6 +978,7 @@ dependencies = [ "percent-encoding 2.1.0", "pretty-bytes", "rand 0.8.5", + "rustls", "termcolor", "time", "url 2.2.2", @@ -937,6 +990,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "strsim" version = "0.8.0" @@ -1096,6 +1155,12 @@ dependencies = [ "traitobject", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "1.7.2" @@ -1155,6 +1220,80 @@ 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.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log 0.4.17", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "winapi" version = "0.3.9" From 6ebcb1abe216be545f9d2399167761d83bba6ff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 20 Jan 2023 16:08:17 -0300 Subject: [PATCH 7/7] github: build: Use deny over forbid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check: https://github.com/rust-lang/rust/issues/81670 Signed-off-by: Patrick José Pereira --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3540fdf..4ece2d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all-targets --all-features -- -F warnings + args: --all-targets --all-features -- -D warnings test: name: Unitest (${{ matrix.os }}) @@ -53,7 +53,7 @@ jobs: - uses: actions-rs/cargo@v1 env: RUST_BACKTRACE: full - RUSTFLAGS: -F warnings + RUSTFLAGS: -D warnings with: command: test args: --all --all-features