github-actions[bot] commented on code in PR #67857:
URL: https://github.com/apache/doris/pull/67857#discussion_r3987432877


##########
docker/compilation/Dockerfile:
##########
@@ -103,9 +109,21 @@ RUN wget 
https://doris-community-bj-1308700295.cos.ap-beijing.myqcloud.com/tools
 RUN rm -f /etc/profile.d/ccache.* \
     && cp /etc/pki/tls/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
 
+# Install the Rust toolchain required by Lance-C.
+ENV CARGO_HOME=/opt/cargo RUSTUP_HOME=/opt/rustup
+ENV PATH="/opt/cargo/bin:${PATH}"
+RUN wget -q https://sh.rustup.rs -O /tmp/rustup-init.sh \
+    && sh /tmp/rustup-init.sh -y --no-modify-path --profile minimal 
--default-toolchain 1.91.0 \
+    && rm -f /tmp/rustup-init.sh \
+    && cargo --version && rustc --version
+
 # clone lastest source code, download and build third party
 COPY doris ${DEFAULT_DIR}/doris
-RUN cd ${DEFAULT_DIR}/doris && /bin/bash thirdparty/build-thirdparty.sh \
+# Cargo build scripts run on CentOS 7. The LDB linker introduces a
+# GLIBC_2.18 dependency; use system GCC for Rust linking and retain LDB for 
C/C++.
+RUN cd ${DEFAULT_DIR}/doris \
+    && CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/gcc \
+       /bin/bash thirdparty/build-thirdparty.sh \

Review Comment:
   [P2] Drop Cargo's build caches before squashing the image
   
   With `CARGO_HOME=/opt/cargo`, this full Lance-C build populates 
`/opt/cargo/registry` and `/opt/cargo/git` (the pinned lock graph has 704 
registry packages plus Git-sourced Lance entries). The cleanup below removes 
`thirdparty/src`, but `FROM scratch` then copies all of `/opt/cargo`, so every 
consumer of the compilation image must pull the downloaded crate archives, 
unpacked sources, index data, and Git checkouts even though the installed Rust 
toolchain only needs `/opt/cargo/bin` and `/opt/rustup`. Please remove the 
registry/Git caches after the build while retaining the toolchain, or 
explicitly justify and measure keeping that cache in the published image.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to