pzhdfy commented on code in PR #66227:
URL: https://github.com/apache/doris/pull/66227#discussion_r4060183564
##########
thirdparty/build-thirdparty.sh:
##########
@@ -2169,6 +2169,222 @@ build_lance_c() {
fi
}
+# paimon-rust
+build_paimon_rust() {
+ check_if_source_exist "${PAIMON_RUST_SOURCE}"
+ cd "${TP_SOURCE_DIR}/${PAIMON_RUST_SOURCE}"
+
+ rm -rf "${BUILD_DIR}"
+ mkdir -p "${BUILD_DIR}"
+
+ local cargo_bin="${PAIMON_RUST_CARGO:-${CARGO:-cargo}}"
+ if ! command -v "${cargo_bin}" >/dev/null 2>&1; then
+ echo "cargo is required to build paimon-rust. Install Rust 1.91.0 or
set PAIMON_RUST_CARGO."
+ exit 1
+ fi
+
+ local required_rust_version="1.91.0"
+ local cargo_env=(
+ "CARGO_BUILD_JOBS=${PARALLEL}"
+ "CARGO_TARGET_DIR=${PWD}/${BUILD_DIR}"
+ )
+ if command -v rustup >/dev/null 2>&1 && [[ -z "${RUSTUP_TOOLCHAIN}" ]];
then
+ if ! rustup toolchain list | grep -Eq '^1\.91\.0([[:space:]-]|$)'; then
+ rustup toolchain install "${required_rust_version}" --profile
minimal
+ fi
+ cargo_env+=("RUSTUP_TOOLCHAIN=${required_rust_version}")
+ fi
+
+ local cargo_version
+ if ! cargo_version="$(env "${cargo_env[@]}" "${cargo_bin}" --version | awk
'{print $2}')"; then
+ echo "failed to get cargo version for paimon-rust. Install Rust
${required_rust_version} or set PAIMON_RUST_CARGO/RUSTUP_TOOLCHAIN."
+ exit 1
+ fi
+ # Rust 1.91.0 is the minimum supported version. Allow newer toolchains when
Review Comment:
▎ Fixed — ensure_same_rust_toolchain compares the exact rustc -vV identity
(version, commit-hash, host, LLVM) across both builds and fails early in the
second one with both identities and the remediation printed. The identity is
stamped under TP_INSTALL_DIR, so the invariant also holds across separate
build-thirdparty.sh invocations (--continue, per-package builds). The caller's
cargo_env array reaches the probe via positional spreading (bash 3.2 / macOS
safe), and an explicit LANCE_C_CARGO/PAIMON_RUST_CARGO path resolves rustc from
the same directory first. All three branches verified by simulation: first run
stamps, the same toolchain passes, a different toolchain fails early.
--
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]