This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new b58b2c53ff5 [enhancement](thirdparty) fix arrow build bug and clear
dangerous env… (#67535)
b58b2c53ff5 is described below
commit b58b2c53ff56354c692c2dc7634d724d8780838f
Author: yiguolei <[email protected]>
AuthorDate: Sat Sep 5 15:31:47 2026 +0800
[enhancement](thirdparty) fix arrow build bug and clear dangerous env…
(#67535)
… (#67523)
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
None
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change. - [ ] No code files have been
changed. - [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
---
thirdparty/AGENTS.md | 67 ++++++++++++++++++++++++
thirdparty/build-thirdparty.sh | 35 +++++++++++--
thirdparty/patches/apache-arrow-24.0.0-lzo.patch | 17 ++++++
3 files changed, 116 insertions(+), 3 deletions(-)
diff --git a/thirdparty/AGENTS.md b/thirdparty/AGENTS.md
new file mode 100644
index 00000000000..0af2d37f810
--- /dev/null
+++ b/thirdparty/AGENTS.md
@@ -0,0 +1,67 @@
+# Third-Party Dependency Lookup Guide
+
+This file applies to all changes under `thirdparty/`, including patches
applied to vendored
+projects.
+
+## Keep dependency lookup inside Doris third-party
+
+When locating a header, library, or CMake package provided by the Doris
third-party build, search
+only inside the Doris third-party install directory. Do not allow CMake to
fall back to system
+directories, user-installed packages, environment-provided prefixes, or
another checkout.
+
+The third-party build sets `CMAKE_INSTALL_PREFIX` to `${TP_INSTALL_DIR}`.
Prefer that existing
+value instead of introducing another variable for the same directory.
+
+For `find_path` and `find_library`:
+
+- Provide explicit `PATHS` below `${CMAKE_INSTALL_PREFIX}`.
+- Always specify `NO_DEFAULT_PATH`.
+- Use `NO_CACHE` and a Doris-specific result variable when supported, so a
stale CMake cache cannot
+ select a path outside the Doris third-party directory.
+- Use `REQUIRED` unless absence is an explicitly supported configuration.
+
+Example:
+
+```cmake
+find_path(DORIS_FOO_INCLUDE_DIR
+ NAMES foo/foo.h
+ PATHS "${CMAKE_INSTALL_PREFIX}/include"
+ NO_DEFAULT_PATH
+ NO_CACHE
+ REQUIRED)
+find_library(DORIS_FOO_LIBRARY
+ NAMES foo
+ PATHS "${CMAKE_INSTALL_PREFIX}/lib"
"${CMAKE_INSTALL_PREFIX}/lib64"
+ NO_DEFAULT_PATH
+ NO_CACHE
+ REQUIRED)
+```
+
+Apply the same rule to `find_package`: provide only package paths rooted under
+`${CMAKE_INSTALL_PREFIX}`, use `NO_DEFAULT_PATH`, and ensure a cached
`<Package>_DIR` cannot point
+outside that directory.
+
+Do not rely on an unconstrained `find_path`, `find_library`, `find_package`,
`CMAKE_PREFIX_PATH`,
+the host `PATH`, or platform default search paths for a Doris-managed
dependency. A dependency
+missing from the Doris third-party directory must fail configuration instead
of silently linking a
+different installation.
+
+System toolchain components and dependencies intentionally supplied by the
operating system are
+outside this rule, but that intent must be explicit in the surrounding build
configuration.
+
+## Preserve environment sanitization
+
+`build-thirdparty.sh` clears ambient CMake code-injection, vcpkg, and Conda
variables immediately
+after loading `env.sh`. Keep this sanitization before any third-party download
or build command,
+and add newly supported package-manager or CMake injection variables when they
could redirect
+dependency resolution outside the Doris third-party directory.
+
+Never `source` or use `.` to execute a script from an extracted third-party
source tree. Invoke
+upstream scripts as executables or through `bash`/`sh` so they run in a child
process. Keep each
+`build_<package>` function invocation inside its package subshell in the main
build loop. This
+boundary prevents exports, shell options, traps, functions, and
working-directory changes made by
+one package from leaking into later package builds, including if an upstream
script is accidentally
+sourced in the future.
+
+Only repository-owned initialization files such as `env.sh` and
`thirdparty/vars.sh` may be sourced,
+and they must be sourced before package builds begin.
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index 70dbdf8d877..5fd78684cff 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -76,6 +76,17 @@ if [[ "${ENABLE_THIRDPARTY_CCACHE:-OFF}" == "ON" ]]; then
echo "ccache is enabled for the cmake-based third-party packages"
fi
+# Do not let ambient CMake injection hooks or package-manager environments
+# alter third-party dependency resolution. Keep this after env.sh so custom
+# environment setup cannot reintroduce these values.
+unset CMAKE_TOOLCHAIN_FILE \
+ CMAKE_PROJECT_INCLUDE \
+ CMAKE_PROJECT_INCLUDE_BEFORE \
+ CMAKE_PROJECT_TOP_LEVEL_INCLUDES \
+ VCPKG_ROOT \
+ VCPKG_DEFAULT_TRIPLET \
+ CONDA_PREFIX
+
# Check args
usage() {
echo "
@@ -2337,8 +2348,22 @@ build_lance_c() {
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 [[ "${cargo_version}" != "${required_rust_version}" ]]; then
- echo "lance-c requires Rust/Cargo ${required_rust_version}, but found
${cargo_version}."
+ # Rust 1.91.0 is the minimum supported version. Allow newer toolchains when
+ # callers explicitly select one or rustup is unavailable on the system.
+ 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}."
echo "Install Rust ${required_rust_version} or set
LANCE_C_CARGO/RUSTUP_TOOLCHAIN."
exit 1
fi
@@ -2581,7 +2606,11 @@ for package in "${packages[@]}"; do
fi
if [[ "${CONTINUE}" -eq 0 ]] || [[ "${PACKAGE_FOUND}" -eq 1 ]]; then
command="build_${package}"
- ${command}
+ # Isolate each package from environment and working-directory changes
+ # made by its build function or by a sourced upstream script.
+ (
+ "${command}"
+ )
cd "${TP_DIR}"
cleanup_package_source "${package}"
echo "debug after clean: ${package}"
diff --git a/thirdparty/patches/apache-arrow-24.0.0-lzo.patch
b/thirdparty/patches/apache-arrow-24.0.0-lzo.patch
index d7076509756..fc5d2654fb2 100644
--- a/thirdparty/patches/apache-arrow-24.0.0-lzo.patch
+++ b/thirdparty/patches/apache-arrow-24.0.0-lzo.patch
@@ -1,3 +1,20 @@
+--- a/cpp/src/parquet/CMakeLists.txt
++++ b/cpp/src/parquet/CMakeLists.txt
+@@ -118,0 +119,14 @@
++find_path(DORIS_LZO_INCLUDE_DIR
++ NAMES lzo/lzo1x.h
++ PATHS "${CMAKE_INSTALL_PREFIX}/include"
++ NO_DEFAULT_PATH
++ NO_CACHE
++ REQUIRED)
++find_library(DORIS_LZO_LIBRARY
++ NAMES lzo2
++ PATHS "${CMAKE_INSTALL_PREFIX}/lib"
"${CMAKE_INSTALL_PREFIX}/lib64"
++ NO_DEFAULT_PATH
++ NO_CACHE
++ REQUIRED)
++include_directories(SYSTEM "${DORIS_LZO_INCLUDE_DIR}")
++link_libraries("${DORIS_LZO_LIBRARY}")
--- a/cpp/src/parquet/column_reader.cc
+++ b/cpp/src/parquet/column_reader.cc
@@ -29,6 +29,8 @@
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]