Skip to content

Commit dca1a76

Browse files
committed
Fix Rust LTO compilation conflict in Docker build
- Remove incompatible LTO flags from RUSTFLAGS in Dockerfile.production - Add proper LTO configuration in Cargo.toml [profile.release] section - Fix 'options -C embed-bitcode=no and -C lto are incompatible' error - Use native CPU target optimization while avoiding bitcode conflicts
1 parent 7a51868 commit dca1a76

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

development/qnet-integration/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,10 @@ python = []
107107

108108
[[bin]]
109109
name = "qnet-node"
110-
path = "src/bin/qnet-node.rs"
110+
path = "src/bin/qnet-node.rs"
111+
112+
[profile.release]
113+
lto = true
114+
codegen-units = 1
115+
panic = "abort"
116+
opt-level = 3

development/qnet-integration/Dockerfile.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ WORKDIR /build
2424
COPY . .
2525

2626
# Build the specific binary with maximum optimization for production
27-
ENV RUSTFLAGS="-C target-cpu=native -C opt-level=3 -C lto=fat -C codegen-units=1"
27+
ENV RUSTFLAGS="-C target-cpu=native"
2828
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
2929

3030
RUN cargo build --release --bin qnet-node \

0 commit comments

Comments
 (0)