[VL] Respect INSTALL_PREFIX in Velox native builds#12331
Merged
jackylee-ch merged 1 commit intoJul 2, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a unified native-build “component isolation” resolver (dev/build-isolation.sh) and wires it into the Velox/Arrow build entrypoints so that path-discovery isolation (CMake + compiler include search demotion) is consistently applied across macOS and Linux.
Changes:
- Add
dev/build-isolation.shto compute isolation policy, generate a toolchain fragment, and export discovery/ignore flags for all nested CMake builds. - Update native build entrypoints (
builddeps-veloxbe.sh,build-velox.sh,build-helper-functions.sh) to consume the resolver outputs instead of duplicating macOS-only/usr/localignore logic. - Add a dry-run scenario test harness (
dev/tests/test-build-isolation.sh) and ignore generated artifacts via.gitignore; hardendev/build-arrow.sh’s managed-dir cleanup behavior.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ep/build-velox/src/build-velox.sh | Sources the isolation resolver and injects resolved CMake/compiler isolation flags into Velox’s build. |
| dev/tests/test-build-isolation.sh | Adds dry-run tests validating resolved isolation behavior and propagation. |
| dev/builddeps-veloxbe.sh | Establishes/install-prefix explicitness and applies resolver-derived CMake isolation across native build stages. |
| dev/build-isolation.sh | New single-source resolver that generates toolchain/env artifacts and exports isolation flags/toolchain. |
| dev/build-helper-functions.sh | Uses the resolver to apply isolation flags consistently for CMake-based dependency builds. |
| dev/build-arrow.sh | Avoids wiping user-provided Arrow prefixes and consults resolver for standalone prefix defaults. |
| .gitignore | Ignores generated isolation artifacts under .gluten-build-cache/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
51280f4 to
44b67a8
Compare
44b67a8 to
c6f0328
Compare
Comment on lines
+265
to
+268
| if [ -n "${INSTALL_PREFIX:-}" ]; then | ||
| GLUTEN_CMAKE_OPTIONS+=" -DCMAKE_PREFIX_PATH=$INSTALL_PREFIX" | ||
| GLUTEN_CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" | ||
| fi |
Propagate a user-provided INSTALL_PREFIX into the native Velox build flow by exporting it on Linux when set and passing it to CMake as CMAKE_PREFIX_PATH/CMAKE_INSTALL_PREFIX for dependency builds, Velox, and Gluten CPP. This keeps Linux's existing system-path discovery unchanged unless the user explicitly chooses a prefix. On macOS, keep the existing /usr/local isolation only when the effective INSTALL_PREFIX is outside /usr/local. Also demote /usr/local/include in compiler flags so Apple clang does not prefer stale system headers over the selected install prefix, and patch fetched Velox setup scripts before --run_setup_script=ON builds dependencies such as Folly. Teach the Gluten Velox module to resolve thrift from CMAKE_INSTALL_PREFIX/CMAKE_PREFIX_PATH before falling back to /usr/local.
c6f0328 to
6304aa8
Compare
Contributor
Author
philo-he
approved these changes
Jul 1, 2026
philo-he
left a comment
Member
There was a problem hiding this comment.
LGTM. Just one follow-up suggestion. Thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are proposed in this pull request?
This PR keeps the native build behavior focused on INSTALL_PREFIX propagation and macOS-only /usr/local protection.
How was this patch tested?
git diff --checkbash -n dev/build-helper-functions.sh dev/builddeps-veloxbe.sh ep/build-velox/src/build-velox.sh ep/build-velox/src/get-velox.shenv PATH=/opt/homebrew/Cellar/llvm@15/15.0.7/bin:$PATH ./dev/format-cpp-code.shenv CCACHE_DISABLE=1 cmake --build cpp/build -j4ctest --test-dir cpp/build -R 'VeloxColumnar|VeloxRowToColumnar|VeloxBatchResizer|ValueStreamDynamicFilter|MemoryManagerTest|MultiMemoryManagerTest' --output-on-failure -j1(71/71 passed).velox_batch_resizer_benchmark,delta_bitmap_benchmark,plan_validator_util, andgeneric_benchmark.parquet_write_benchmarkwas checked separately and currently fails because the benchmark passes an aggregate memory pool to a leaf-only Velox allocation path; that file is not changed by this PR./usr/local/includematches./opt/homebrew/includeappears only as-isystem, with INSTALL_PREFIX include paths kept ahead of it.Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)