Skip to content
Snippets Groups Projects
Unverified Commit 276a8c2b authored by Nutomic's avatar Nutomic Committed by GitHub
Browse files

Enable lto, strip symbols via cargo.toml (#2512)

parent 9ac13a08
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,13 @@ rust-version = "1.57" ...@@ -11,7 +11,13 @@ rust-version = "1.57"
[lib] [lib]
doctest = false doctest = false
[profile.release]
strip = "symbols"
debug = 0
lto = "thin"
[profile.dev] [profile.dev]
strip = "symbols"
debug = 0 debug = 0
[features] [features]
......
...@@ -29,9 +29,6 @@ COPY . . ...@@ -29,9 +29,6 @@ COPY . .
RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs" RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
RUN cargo build --target ${CARGO_BUILD_TARGET} 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 RUN cp ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server /app/lemmy_server
# The alpine runner # The alpine runner
......
...@@ -11,9 +11,6 @@ COPY ./ ./ ...@@ -11,9 +11,6 @@ COPY ./ ./
RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs" RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/src/version.rs"
RUN cargo build --release 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 RUN cp ./target/$CARGO_BUILD_TARGET/$RUSTRELEASEDIR/lemmy_server /app/lemmy_server
# The alpine runner # The alpine runner
......
...@@ -15,9 +15,6 @@ RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/ ...@@ -15,9 +15,6 @@ RUN echo "pub const VERSION: &str = \"$(git describe --tag)\";" > "crates/utils/
RUN cargo build --release RUN cargo build --release
# reduce binary size
RUN strip ./target/release/lemmy_server
RUN cp ./target/release/lemmy_server /app/lemmy_server RUN cp ./target/release/lemmy_server /app/lemmy_server
# The Debian runner # The Debian runner
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment