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


##########
thirdparty/build-thirdparty.sh:
##########
@@ -2144,37 +2144,26 @@ build_lance_c() {
         exit 1
     fi
 
+    local required_rust_version="1.91.0"
     local cargo_env=(
         "CARGO_BUILD_JOBS=${PARALLEL}"
         "CARGO_TARGET_DIR=${PWD}/${BUILD_DIR}"
         "PROTOC=${TP_INSTALL_DIR}/bin/protoc"
     )
     if command -v rustup >/dev/null 2>&1 && [[ -z "${RUSTUP_TOOLCHAIN}" ]]; 
then
-        if rustup toolchain list | grep -q '^1.91.0'; then
-            cargo_env+=("RUSTUP_TOOLCHAIN=1.91.0")
+        if ! rustup toolchain list | grep -Eq '^1\.91\.0([[:space:]-]|$)'; then
+            rustup toolchain install "${required_rust_version}" --profile 
minimal

Review Comment:
   [P2] Respect an explicitly selected Cargo before invoking rustup
   
   `cargo_bin` may come from `LANCE_C_CARGO`/`CARGO`, but this branch runs 
whenever any unrelated `rustup` is on `PATH`. A network-restricted builder with 
an exact `/opt/rust-1.91/bin/cargo` (and matching `RUSTC`) plus rustup 
containing only `stable` now attempts `rustup toolchain install 1.91.0` and 
exits under `set -e` before checking the valid custom toolchain; 
`LANCE_C_CARGO_OFFLINE=ON` is only applied later. Please auto-manage rustup 
only for the default/rustup Cargo path and validate explicit tool overrides 
directly.



##########
thirdparty/build-thirdparty.sh:
##########
@@ -2144,37 +2144,26 @@ build_lance_c() {
         exit 1
     fi
 
+    local required_rust_version="1.91.0"
     local cargo_env=(
         "CARGO_BUILD_JOBS=${PARALLEL}"
         "CARGO_TARGET_DIR=${PWD}/${BUILD_DIR}"
         "PROTOC=${TP_INSTALL_DIR}/bin/protoc"
     )
     if command -v rustup >/dev/null 2>&1 && [[ -z "${RUSTUP_TOOLCHAIN}" ]]; 
then
-        if rustup toolchain list | grep -q '^1.91.0'; then
-            cargo_env+=("RUSTUP_TOOLCHAIN=1.91.0")
+        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 required_rust_version="1.91.0"
     local cargo_version
     if ! cargo_version="$(env "${cargo_env[@]}" "${cargo_bin}" --version | awk 
'{print $2}')"; then
         echo "failed to get cargo version for lance-c. Install Rust 
${required_rust_version} or set LANCE_C_CARGO/RUSTUP_TOOLCHAIN."
         exit 1
     fi
-    if ! awk -v required="${required_rust_version}" -v 
actual="${cargo_version}" 'BEGIN {
-            split(required, r, ".");
-            split(actual, a, ".");
-            for (i = 1; i <= 3; i++) {
-                if ((a[i] + 0) > (r[i] + 0)) {
-                    exit 0;
-                }
-                if ((a[i] + 0) < (r[i] + 0)) {
-                    exit 1;
-                }
-            }
-            exit 0;
-        }'; then
-        echo "lance-c requires Rust/Cargo ${required_rust_version} or newer, 
but found ${cargo_version}."
+    if [[ "${cargo_version}" != "${required_rust_version}" ]]; then

Review Comment:
   [P2] Pin the compiler that triggers this failure
   
   The reported `ethnum` failure is produced by `rustc`, but this gate 
validates only `cargo --version`. Cargo 1.91.0 can still execute a newer 
compiler through inherited `RUSTC`/`CARGO_BUILD_RUSTC` (or a standalone Cargo 
paired with a newer `rustc` on `PATH`), so that setup passes here and reaches 
the same E0512 path. Please select and version-check the actual compiler Cargo 
will use, then pass the paired 1.91.0 toolchain consistently into the build.



-- 
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