]> Untitled Git - lemmy.git/commitdiff
Enable lto, strip symbols via cargo.toml (#2512)
authorNutomic <me@nutomic.com>
Tue, 25 Oct 2022 15:10:07 +0000 (15:10 +0000)
committerGitHub <noreply@github.com>
Tue, 25 Oct 2022 15:10:07 +0000 (15:10 +0000)
Cargo.toml
docker/dev/Dockerfile
docker/prod/Dockerfile
docker/prod/Dockerfile.arm

index 18cf4eb39170cb34b9cbe18d8fffea82c362bab9..58fb33257941a7884013fb12471743f17a3353c1 100644 (file)
@@ -11,7 +11,13 @@ rust-version = "1.57"
 [lib]
 doctest = false
 
+[profile.release]
+strip = "symbols"
+debug = 0
+lto = "thin"
+
 [profile.dev]
+strip = "symbols"
 debug = 0
 
 [features]
index 13ff656566b64fd7f543ac54daf857c205384cc8..14096dc07cf523f60eea103fd1d4031f58374c3e 100644 (file)
@@ -29,9 +29,6 @@ COPY . .
 RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
 RUN cargo build --target ${CARGO_BUILD_TARGET}
 
-# reduce binary size
-RUN strip ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server
-
 RUN cp ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server /app/lemmy_server
 
 # The alpine runner
index 68968007cb28d24db5ab19a6fc7e82515fdb9fab..33a77af88f89c4ff1275a499e8f331df2da8ee77 100644 (file)
@@ -11,9 +11,6 @@ COPY ./ ./
 RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
 RUN cargo build --release
 
-# reduce binary size
-RUN strip ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server
-
 RUN cp ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server /app/lemmy_server
 
 # The alpine runner
index 2076e942df66aae3b3c256289c0f311d80e1f8fd..926fa8a7aa57e454932a130699f3ca8f074263c2 100644 (file)
@@ -15,9 +15,6 @@ RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/
 
 RUN cargo build --release
 
-# reduce binary size
-RUN strip ./target/release/lemmy_server
-
 RUN cp ./target/release/lemmy_server /app/lemmy_server
 
 # The Debian runner