Skip to content

Commit 8dc1517

Browse files
committed
ci: switch to using openssl-sys
Also remove architecture stuff in build process.
1 parent 66dff65 commit 8dc1517

11 files changed

+39
-56
lines changed

Cargo.lock

+27-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ sea-orm = { version = "=1.0.0-rc.5", features = [
2929
"debug-print",
3030
"postgres-array",
3131
"macros",
32-
"runtime-tokio-rustls",
32+
"runtime-tokio-native-tls",
3333
"sqlx-postgres",
3434
"with-chrono",
3535
"with-json",

Dockerfile

+2-10
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN moon run frontend:build transactional:build
2222
RUN moon docker prune
2323

2424
FROM --platform=$BUILDPLATFORM lukemathwalker/cargo-chef AS backend-chef
25-
RUN apt-get update && apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross clang llvm ca-certificates
25+
RUN apt-get update && apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu libc6-dev-arm64-cross clang llvm ca-certificates pkg-config make g++ libssl-dev
2626
RUN update-ca-certificates
2727
WORKDIR app
2828

@@ -32,7 +32,6 @@ RUN cargo chef prepare --recipe-path recipe.json
3232

3333
FROM backend-chef AS backend-builder
3434
# build specific
35-
ARG TARGETARCH
3635
ARG BUILD_PROFILE=release
3736
# application specific
3837
ARG APP_VERSION
@@ -41,15 +40,8 @@ ARG DEFAULT_MAL_CLIENT_ID
4140
RUN test -n "$APP_VERSION" && \
4241
test -n "$DEFAULT_TMDB_ACCESS_TOKEN" && \
4342
test -n "$DEFAULT_MAL_CLIENT_ID"
44-
ENV RUST_TARGET_TRIPLE_arm64="aarch64-unknown-linux-gnu"
45-
ENV RUST_TARGET_TRIPLE_amd64="x86_64-unknown-linux-gnu"
46-
ENV TARGET_CC="clang"
47-
ENV TARGET_AR="llvm-ar"
48-
ENV CFLAGS_aarch64_unknown_linux_gnu="--sysroot=/usr/aarch64-linux-gnu"
49-
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
5043
COPY --from=backend-planner /app/recipe.json recipe.json
51-
RUN rustup target add $(eval "echo \$RUST_TARGET_TRIPLE_$TARGETARCH")
52-
RUN cargo chef cook --profile $BUILD_PROFILE --target $(eval "echo \$RUST_TARGET_TRIPLE_$TARGETARCH") --recipe-path recipe.json
44+
RUN cargo chef cook --profile $BUILD_PROFILE --recipe-path recipe.json
5345
COPY . .
5446
COPY --from=frontend-builder /app/apps/backend/templates ./apps/backend/templates
5547
RUN APP_VERSION=$APP_VERSION \

apps/backend/Cargo.toml

+1-6
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ isolang = { version = "=2.4.0", features = ["list_languages"] }
4444
itertools = "=0.13.0"
4545
jsonwebtoken = { version = "=9.3.0", default-features = false }
4646
kinded = "=0.3.0"
47-
lettre = { version = "=0.11.7", features = [
48-
"rustls-tls",
49-
"smtp-transport",
50-
"builder",
51-
], default-features = false }
47+
lettre = "=0.11.7"
5248
markdown = "=1.0.0-alpha.18"
5349
mime_guess = "=2.0.5"
5450
nanoid = { workspace = true }
@@ -60,7 +56,6 @@ regex = "=1.10.5"
6056
# FIXME: Upgrade once https://github.com/seanmonstar/reqwest/pull/1620 is merged
6157
reqwest = { git = "https://github.com/thomasqueirozb/reqwest", branch = "base_url", features = [
6258
"json",
63-
"rustls-tls",
6459
"stream",
6560
], default-features = false }
6661
rs-utils = { path = "../../libs/rs-utils" }

apps/backend/ci/build-app.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22

33
set -euxo pipefail
44

5-
export RUST_TARGET_TRIPLE=$(eval "echo \$RUST_TARGET_TRIPLE_$TARGETARCH")
6-
7-
rustup target add $RUST_TARGET_TRIPLE
8-
cargo build --profile ${BUILD_PROFILE} --bin ryot --target ${RUST_TARGET_TRIPLE}
9-
cp -R /app/target/${RUST_TARGET_TRIPLE}/${BUILD_PROFILE}/ryot /app/ryot
5+
cargo build --profile ${BUILD_PROFILE} --bin ryot
6+
cp -R /app/target/${BUILD_PROFILE}/ryot /app/ryot

apps/backend/src/miscellaneous.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::{
22
collections::{HashMap, HashSet},
3+
fmt,
34
fs::File,
45
future::Future,
56
iter::zip,
@@ -583,9 +584,9 @@ struct ProgressUpdateCache {
583584
manga_chapter_number: Option<i32>,
584585
}
585586

586-
impl ToString for ProgressUpdateCache {
587-
fn to_string(&self) -> String {
588-
format!("{:#?}", self)
587+
impl fmt::Display for ProgressUpdateCache {
588+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
589+
write!(f, "{:#?}", self)
589590
}
590591
}
591592

apps/backend/src/notification.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,8 @@ impl NotificationPlatformSpecifics {
163163
config.server.smtp.password.to_owned(),
164164
);
165165

166-
let mailer = SmtpTransport::starttls_relay(&config.server.smtp.server)
166+
let mailer = SmtpTransport::relay(&config.server.smtp.server)
167167
.unwrap()
168-
.port(config.server.smtp.port)
169168
.credentials(credentials)
170169
.build();
171170

apps/backend/src/utils.rs

-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ pub struct AppServices {
7474
pub media_service: Arc<MiscellaneousService>,
7575
pub importer_service: Arc<ImporterService>,
7676
pub exporter_service: Arc<ExporterService>,
77-
pub file_storage_service: Arc<FileStorageService>,
7877
pub exercise_service: Arc<ExerciseService>,
7978
}
8079

@@ -159,7 +158,6 @@ pub async fn create_app_services(
159158
media_service,
160159
importer_service,
161160
exporter_service,
162-
file_storage_service,
163161
exercise_service,
164162
}
165163
}

docs/includes/backend-config-schema.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,6 @@ server:
206206
# @envvar SERVER_SMTP_PASSWORD
207207
password: ""
208208

209-
# @envvar SERVER_SMTP_PORT
210-
port: 587
211-
212209
# @envvar SERVER_SMTP_SERVER
213210
server: ""
214211

libs/config/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ pub struct SchedulerConfig {
338338
#[config(rename_all = "snake_case", env_prefix = "SERVER_SMTP_")]
339339
pub struct SmtpConfig {
340340
pub server: String,
341-
#[setting(default = 587)]
342-
pub port: u16,
343341
pub user: String,
344342
pub password: String,
345343
#[setting(default = "Ryot <no-reply@mailer.io>")]

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
profile = "default"
3-
channel = "1.77.2"
3+
channel = "1.80.0"

0 commit comments

Comments
 (0)