From a607c6bed7bb92e188dbf977a7ba495cc93c5b50 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Wed, 8 Feb 2023 14:49:50 +0100 Subject: [PATCH] ci: Move away from OpenSSL to rust-tls --- .github/workflows/build.yml | 74 +++++----- Cargo.lock | 271 ++++++++++++------------------------ Cargo.toml | 2 +- 3 files changed, 128 insertions(+), 219 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index adf7c04..6a86b37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,48 +19,56 @@ jobs: - name: Done run: exit 0 build: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: profile: ["release"] #"dev" - target: [i686-unknown-linux-gnu, i686-pc-windows-msvc, x86_64-apple-darwin, x86_64-pc-windows-msvc, x86_64-unknown-linux-gnu] # + target: [i686-unknown-linux-gnu, i686-pc-windows-gnu, x86_64-apple-darwin, x86_64-pc-windows-gnu, x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu] include: - - os: ubuntu-latest - target: i686-unknown-linux-gnu - arch: i386 - - os: windows-latest - target: i686-pc-windows-msvc - arch: i386 - - os: ubuntu-latest - target: x86_64-apple-darwin - arch: amd64 - - os: windows-latest - target: x86_64-pc-windows-msvc - arch: amd64 - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - arch: amd64 + - target: i686-unknown-linux-gnu +# install: gcc-multilib g++-multilib +# os: ubuntu-latest + - target: i686-pc-windows-gnu +# install: gcc-mingw-w64-i686 +# os: ubuntu-latest + - target: x86_64-apple-darwin +# install: +# os: ubuntu-latest + - target: x86_64-pc-windows-gnu +# install: gcc-mingw-w64-x86-64 +# os: ubuntu-latest + - target: x86_64-unknown-linux-gnu +# install: gcc-multilib g++-multilib +# os: ubuntu-latest + - target: aarch64-unknown-linux-gnu +# install: gcc-aarch64-linux-gnu +# os: ubuntu-latest + steps: - - name: Install OpenSSL - if: ${{ matrix.os == 'ubuntu-latest' }} - run: | - sudo dpkg --print-architecture - sudo dpkg --print-foreign-architectures - sudo dpkg --add-architecture ${{ matrix.arch }} - sudo dpkg --print-architecture - sudo dpkg --print-foreign-architectures - sudo apt-get update - sudo apt-get install -y libssl-dev:${{ matrix.arch }} + - uses: Swatinem/rust-cache@v2 +# - name: Install cross compilers +# if: ${{ matrix.os == 'ubuntu-latest' }} +# run: | +# sudo apt-get update +# sudo apt-get install -y ${{ matrix.install }} - uses: actions-rs/toolchain@v1 with: toolchain: stable target: ${{ matrix.target }} - profile: minimal + override: true +# profile: minimal - uses: actions/checkout@v3 + - name: Install cargo-zigbuild + uses: baptiste0928/cargo-install@v1 + with: + crate: cargo-zigbuild + - name: install zig + run: | + pip3 install ziglang - uses: actions-rs/cargo@v1 with: - command: build + command: zigbuild args: --target ${{ matrix.target }} --profile ${{ matrix.profile }} --package magma-scraper - uses: actions/upload-artifact@v3 name: upload release artifact @@ -68,13 +76,13 @@ jobs: with: name: magma_scraper-${{ matrix.target}}-release path: | - target/release/magma_scraper.* - target/${{ matrix.target }}/release/magma_scraper.* + target/release/magma_scraper* + target/${{ matrix.target }}/release/magma_scraper* - uses: actions/upload-artifact@v3 name: upload dev artifact if: ${{ matrix.profile == 'dev' }} with: name: magma_scraper-${{ matrix.target}}-dev-${{ matrix.feature }} path: | - target/release/magma_scraper.* - target/${{ matrix.target }}/release/magma_scraper.* + target/debug/magma_scraper* + target/${{ matrix.target }}/debug/magma_scraper* diff --git a/Cargo.lock b/Cargo.lock index c396cf6..c9b6316 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,22 +66,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - [[package]] name = "encoding_rs" version = "0.8.32" @@ -91,36 +75,12 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.1.0" @@ -271,16 +231,16 @@ dependencies = [ ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-rustls" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ - "bytes", + "http", "hyper", - "native-tls", + "rustls", "tokio", - "tokio-native-tls", + "tokio-rustls", ] [[package]] @@ -303,15 +263,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "ipnet" version = "2.7.1" @@ -401,24 +352,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "num_cpus" version = "1.15.0" @@ -444,51 +377,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" -[[package]] -name = "openssl" -version = "0.10.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -530,12 +418,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - [[package]] name = "proc-macro2" version = "1.0.51" @@ -563,15 +445,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "reqwest" version = "0.11.14" @@ -587,70 +460,86 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-tls", + "hyper-rustls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "winreg", ] [[package]] -name = "ryu" -version = "1.0.12" +name = "ring" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] [[package]] -name = "schannel" -version = "0.1.21" +name = "rustls" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ - "windows-sys 0.42.0", + "log", + "ring", + "sct", + "webpki", ] [[package]] -name = "scopeguard" -version = "1.1.0" +name = "rustls-pemfile" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64", +] [[package]] -name = "security-framework" -version = "2.8.2" +name = "ryu" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] -name = "security-framework-sys" -version = "2.8.0" +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "core-foundation-sys", - "libc", + "ring", + "untrusted", ] [[package]] @@ -743,6 +632,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "syn" version = "1.0.107" @@ -754,20 +649,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - [[package]] name = "time" version = "0.3.17" @@ -844,13 +725,14 @@ dependencies = [ ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "tokio-rustls" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "native-tls", + "rustls", "tokio", + "webpki", ] [[package]] @@ -920,6 +802,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -931,12 +819,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "want" version = "0.3.0" @@ -1029,6 +911,25 @@ dependencies = [ "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 = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 4088f33..bad1fb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,5 +12,5 @@ simple_logger = "4.0.0" serde = { version = "1.0.125", features = ["derive"] } serde_json = "1.0.92" tokio = { version = "1.6.1", features = ["full"] } #todo: only enable sensible features -reqwest = "0.11.14" +reqwest = {version = "0.11.14", features = ["rustls-tls"], default-features = false} bytes = "1.0.1" #we need this for one fn return type in download.rs \ No newline at end of file