From fc31790937e026378d8a28dcbaf61ef8e96b6b99 Mon Sep 17 00:00:00 2001 From: ramiroaisen <52116153+ramiroaisen@users.noreply.github.com> Date: Thu, 11 Jan 2024 11:56:31 -0300 Subject: [PATCH] feat: use cross to compile and release --- .cargo/config.toml | 1 + Cargo.lock | 192 ------------------------ rs/internal-scripts/client/Cargo.toml | 2 +- rs/internal-scripts/producer/Cargo.toml | 2 +- rs/packages/ip/Cargo.toml | 2 +- rs/packages/mailer/Cargo.toml | 11 +- rs/packages/metre/Cargo.toml | 2 +- rs/packages/mp3/Cargo.toml | 2 +- rs/packages/payments/Cargo.toml | 2 +- scripts/src/release.mts | 6 +- 10 files changed, 20 insertions(+), 202 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index ff0dfcff..d7ed11eb 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,5 @@ [build] rustflags = ["--cfg", "tokio_unstable"] +# target="x86_64-unknown-linux-musl" # limit on parallel jobs to prevent os crash jobs = 12 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 7f25cb41..39966898 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -941,16 +941,6 @@ dependencies = [ "version_check", ] -[[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 0.2.147", -] - [[package]] name = "core-foundation-sys" version = "0.8.3" @@ -1876,21 +1866,6 @@ dependencies = [ "ttf-parser", ] -[[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.2.1" @@ -2591,19 +2566,6 @@ dependencies = [ "tokio-io-timeout", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.27", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "hyper-tungstenite" version = "0.13.0" @@ -3024,7 +2986,6 @@ dependencies = [ "httpdate", "idna 0.3.0", "mime", - "native-tls", "nom", "once_cell", "quoted_printable", @@ -3032,7 +2993,6 @@ dependencies = [ "rustls-pemfile", "socket2 0.4.9", "tokio", - "tokio-native-tls", "tokio-rustls", "webpki-roots 0.23.0", ] @@ -3622,24 +3582,6 @@ dependencies = [ "getrandom 0.2.8", ] -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc 0.2.147", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "neli" version = "0.5.3" @@ -3773,51 +3715,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl" -version = "0.10.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "foreign-types", - "libc 0.2.147", - "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 1.0.107", -] - -[[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.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" -dependencies = [ - "autocfg", - "cc", - "libc 0.2.147", - "pkg-config", - "vcpkg", -] - [[package]] name = "openstream" version = "0.1.0" @@ -4699,12 +4596,10 @@ dependencies = [ "http-body 0.4.5", "hyper 0.14.27", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -4714,7 +4609,6 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", - "tokio-native-tls", "tokio-rustls", "tokio-util", "tower-service", @@ -5026,16 +4920,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "schannel" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" -dependencies = [ - "lazy_static", - "windows-sys 0.36.1", -] - [[package]] name = "schematic" version = "0.11.0" @@ -5104,29 +4988,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "security-framework" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc 0.2.147", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" -dependencies = [ - "core-foundation-sys", - "libc 0.2.147", -] - [[package]] name = "selectors" version = "0.22.0" @@ -6178,16 +6039,6 @@ dependencies = [ "syn 2.0.29", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.24.1" @@ -7007,19 +6858,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - [[package]] name = "windows-sys" version = "0.42.0" @@ -7071,12 +6909,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -7089,12 +6921,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -7107,12 +6933,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -7125,12 +6945,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -7155,12 +6969,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" diff --git a/rs/internal-scripts/client/Cargo.toml b/rs/internal-scripts/client/Cargo.toml index 97f0d16b..0acc0ffd 100644 --- a/rs/internal-scripts/client/Cargo.toml +++ b/rs/internal-scripts/client/Cargo.toml @@ -14,7 +14,7 @@ hyper = { version = "0.14.27", features = ["full"] } jemallocator = "0.5.0" lazy_static = "1.4.0" rand = "0.8.5" -reqwest = { version = "0.11.12", features = ["rustls"] } +reqwest = { version = "0.11", default-features = false, features = [ "rustls-tls" ] } static_init = "1.0.3" tokio = { version = "1.29.0", features = ["full"] } diff --git a/rs/internal-scripts/producer/Cargo.toml b/rs/internal-scripts/producer/Cargo.toml index 15b21073..0402b03b 100644 --- a/rs/internal-scripts/producer/Cargo.toml +++ b/rs/internal-scripts/producer/Cargo.toml @@ -16,7 +16,7 @@ ffmpeg = { version = "0.1.0", path = "../../packages/ffmpeg" } futures = "0.1.14" hyper = { version = "0.14.27", features = ["full"] } multiqueue = "0.3.2" -reqwest = { version = "0.11.14", features = ["stream"] } +reqwest = { version = "0.11", default-features = false, features = ["stream", "rustls-tls"] } serde_json = { version = "1.0", features = ["preserve_order"] } stream-util = { version = "0.1.0", path = "../../packages/stream-util" } thiserror = "1.0.38" diff --git a/rs/packages/ip/Cargo.toml b/rs/packages/ip/Cargo.toml index 8f90f46e..2fab3ea4 100644 --- a/rs/packages/ip/Cargo.toml +++ b/rs/packages/ip/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -reqwest = { version = "0.11.12", features = [ "rustls-tls" ] } +reqwest = { version = "0.11", default-features = false, features = [ "rustls-tls", "rustls-tls" ] } test-util = { version = "0.1.0", path = "../test-util" } tokio = { version = "1.29.0", features = ["full"] } diff --git a/rs/packages/mailer/Cargo.toml b/rs/packages/mailer/Cargo.toml index 0067b4d0..372a3597 100644 --- a/rs/packages/mailer/Cargo.toml +++ b/rs/packages/mailer/Cargo.toml @@ -16,7 +16,16 @@ async-trait = "0.1.68" css-inline = "0.8.5" html2text = "0.5.1" hyper = { version = "0.14.27", features = ["server", "full"] } -lettre = { version = "0.10.4", features = ["tokio1_rustls", "smtp-transport", "tokio1", "tokio1-rustls-tls", "native-tls", "builder", "tokio1-native-tls", "rustls-tls"], default-features = false } +lettre = { version = "0.10.4", features = [ + "tokio1_rustls", + "smtp-transport", + "tokio1", + "tokio1-rustls-tls", + # "native-tls", + "builder", + # "tokio1-native-tls", + "rustls-tls" +], default-features = false } nanohtml2text = "0.1.4" prex = { version = "0.1.0", path = "../prex" } serde = { version = "1.0.162", features = ["derive"] } diff --git a/rs/packages/metre/Cargo.toml b/rs/packages/metre/Cargo.toml index b3d988e7..457c9d3f 100644 --- a/rs/packages/metre/Cargo.toml +++ b/rs/packages/metre/Cargo.toml @@ -12,4 +12,4 @@ serde_json = "1.0.104" toml = "0.7.6" serde_yaml = "0.9.25" thiserror = "1.0.44" -reqwest = { version = "0.11.18", features = ["blocking"] } \ No newline at end of file +reqwest = { version = "0.11", default-features = false, features = ["blocking", "rustls-tls"] } \ No newline at end of file diff --git a/rs/packages/mp3/Cargo.toml b/rs/packages/mp3/Cargo.toml index 85832b01..6c4852c6 100644 --- a/rs/packages/mp3/Cargo.toml +++ b/rs/packages/mp3/Cargo.toml @@ -13,5 +13,5 @@ keywords = ["mp3", "metadata"] name = "mp3" [dev-dependencies] -reqwest = { version = "0.11", features = ["blocking"] } +reqwest = { version = "0.11", default-features = false, features = ["blocking", "rustls-tls"] } simplemad = "0.9" diff --git a/rs/packages/payments/Cargo.toml b/rs/packages/payments/Cargo.toml index 9701054f..f5da87f6 100644 --- a/rs/packages/payments/Cargo.toml +++ b/rs/packages/payments/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] constants = { version = "0.1.0", path = "../../config/constants" } -reqwest = { version = "0.11.18", features = ["rustls-tls", "serde_json", "json"] } +reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "serde_json", "json"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.96" thiserror = "1.0.40" diff --git a/scripts/src/release.mts b/scripts/src/release.mts index 3099a58f..76b62646 100644 --- a/scripts/src/release.mts +++ b/scripts/src/release.mts @@ -12,8 +12,8 @@ const frontdir = { }; const binfile = { - src: `${basedir}/target/release/openstream`, - target: `${tmpdir}/target/release/openstream`, + src: `${basedir}/target/x86_64-unknown-linux-gnu/release/openstream`, + target: `${tmpdir}/targetrelease/openstream`, } const info = { target: `${tmpdir}/info.txt` }; @@ -30,7 +30,7 @@ const revision = (await $`git rev-parse HEAD`).stdout.trim(); const branch = (await $`git branch --show-current`).stdout.trim(); const comment = (await $`git --no-pager log -1 --format=%s`).stdout.trim(); -await $`cargo build --release --bin openstream --color always`; +await $`cross build --release --bin openstream --color always --target x86_64-unknown-linux-gnu`; await within(async () => { cd(frontdir.src);