Commit 44b67a8
[VL] Unify native-build component isolation via a single resolver (macOS + Linux)
Native-build path policy was duplicated across three shell entry points
(builddeps-veloxbe.sh, build-helper-functions.sh, build-velox.sh), each
independently hardcoding `-DCMAKE_IGNORE_PREFIX_PATH=/usr/local` on macOS only.
This left Linux without first-class isolation and, importantly, left Velox's
own dependency builds (folly, bundled Arrow, ...) unprotected from /usr/local.
Introduce dev/build-isolation.sh as a single source of truth. It normalizes all
path inputs, decides isolation on/off, and emits a CMake toolchain fragment +
path-policy.env + machine-readable resolved_{trusted,ignored,runtime_ignored}_roots
under the already-gitignored ep/_ep working dir. Every build layer consumes them.
Default behavior (user-facing contract):
* macOS and Linux both default-on (GLUTEN_BUILD_ISOLATION=auto -> on); vcpkg
forces off; explicit on+vcpkg fails fast (only one toolchain slot).
* macOS default: local prefix ${VELOX_HOME}/deps-install; /usr/local ignored.
* Linux default: setup still installs to system dirs (trusted-managed,
Docker/CI behavior and artifact locations unchanged); only ambient residue
(stray Conda, user CMake registry) is filtered -- effectively a no-op unless
you opt into a separate install.
* Either platform + explicit INSTALL_PREFIX (separate install): /usr/local and
/usr flip to ignored, with GLUTEN_ALLOW_IGNORED_ROOTS / GLUTEN_TRUST_PREFIX
escape hatches. GLUTEN_BUILD_ISOLATION=off is a full kill-switch.
Two-level isolation:
* CMake find policy: ignore roots + NO_SYSTEM_FROM_IMPORTED + package-registry
off, propagated to every nested cmake (incl. Velox's own dependency setup)
via the exported CMAKE_TOOLCHAIN_FILE. The toolchain carries only the ignore
policy -- it does NOT prepend trusted prefixes globally, which would wrongly
redirect Velox's/Arrow's self-contained bundled builds to deps-install.
* Compiler include search: CMAKE_IGNORE_* doesn't govern the compiler, and on
macOS clang searches /usr/local/include ahead of -isystem, so a stale header
there (e.g. an old gtest/fmt) shadows the bundled copy. The resolver exports
CFLAGS/CXXFLAGS with `-idirafter <ignored>/include` to demote those roots
below every -I/-isystem dir; child cmake processes inherit it.
build-arrow.sh: guard the destructive download-dir removal (never wipe a
user-provided ARROW_PREFIX) and resolve a sane default install prefix for
standalone runs instead of silently targeting /usr/local.
Verified end-to-end by a complete native macOS build (arm64): valid
libgluten.dylib + libvelox.dylib with zero /usr/local linkage (otool -L). The
resolver supports GLUTEN_ISOLATION_DRYRUN=1 to emit the policy without building.
Linux is a no-op by default, preserving existing Docker/CI behavior.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 473a5d2 commit 44b67a8
5 files changed
Lines changed: 570 additions & 29 deletions
File tree
- dev
- ep/build-velox/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
30 | 49 | | |
31 | 50 | | |
32 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
197 | 199 | | |
198 | 200 | | |
199 | 201 | | |
200 | | - | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
0 commit comments