Skip to content

Conversation

@baibaichen
Copy link
Contributor

What changes were proposed in this pull request?

Gluten's incremental C++ builds take ~3 minutes even for no-op builds (make-based workflow), making the AI-driven edit → compile → test → fix loop impractically slow. With this new dev/inc-build-cpp.sh script using Ninja and smart vcpkg timestamp preservation, incremental builds now complete in under 30 seconds and zero-change builds in 0.27 seconds.

Performance Improvements:

  • Switch from Make to Ninja: 4m53s → 0.1s no-op builds (1400x faster)
  • Skip redundant cmake configure steps (let Ninja handle regeneration)
  • Default skip vcpkg check (use --update_vcpkg when needed)
  • Preserve vcpkg timestamps to avoid unnecessary relinking
  • Result: 3m14s → 0.27s total no-op time

Features:

  • Auto-detects BUILD_TYPE from velox _build/debug or _build/release directory
  • Auto-detects SCALA_VERSION from backends-velox/target/scala-X.XX directory
  • Auto-extracts vcpkg options (BUILD_TESTS, ENABLE_S3/GCS/ABFS) from CMakeCache.txt
  • Validates CMakeCache.txt exists (required for incremental build)
  • Self-contained: no dependency on build-helper-functions.sh for easy maintenance

Usage:

./dev/inc-build-cpp.sh [--build_type=Debug|Release] [--scala_version=2.13] [--update_vcpkg]

Why are the changes needed?

AI-assisted development requires fast iteration cycles. The existing dev/package-vcpkg.sh is designed for full builds and includes overhead from Velox source reset, OS dependency setup, and Maven builds. This script focuses purely on incremental C++ compilation for the edit → compile → test → fix loop.

Does this PR introduce any user-facing change?

No, this is a developer tool for faster C++ incremental builds.

How was this patch tested?

  • Syntax validation: bash -n dev/inc-build-cpp.sh
  • No-op build performance verified: 0.27s (down from 3m14s)
  • Incremental build after single-file change: ~25s
  • All lines ≤ 100 characters for code readability

Related Issue

Fixes #11559 (PR 2 of 2)
Previous PR: #11560


🤖 AI-Assisted Development: This PR was created with Claude Code to optimize the AI-driven development workflow.

@github-actions github-actions bot added the BUILD label Feb 10, 2026
@baibaichen
Copy link
Contributor Author

baibaichen commented Feb 10, 2026

@PHILO-HE @marin-ma

Add dev/inc-build-cpp.sh for fast incremental C++ builds with auto-detection:

Performance improvements:
- Switch from Make to Ninja: 4m53s -> 0.1s no-op (1400x faster)
- Skip redundant cmake configure steps (use 'cmake --build' directly)
- Default skip vcpkg check (use --update_vcpkg when needed)
- Preserve vcpkg timestamps to avoid unnecessary relinking
- Result: 3m14s -> 0.27s total no-op time

Auto-detection:
- BUILD_TYPE from velox _build/debug or _build/release directory
- SCALA_VERSION from backends-velox/target/scala-X.XX directory
- Vcpkg options (BUILD_TESTS, ENABLE_S3/GCS/ABFS) from CMakeCache.txt
- Validate CMakeCache.txt exists (required for incremental build)

Helper functions extracted to build-helper-functions.sh:
- initialize_num_threads, get_platform, get_maven_arch
- log_build_step, validate_directory
- setup_vcpkg_environment, copy_gluten_libraries

Usage: ./dev/inc-build-cpp.sh [--build_type=Debug|Release] [--scala_version=2.13] [--update_vcpkg]
@baibaichen baibaichen force-pushed the fix/incremental-build-script branch from d52add0 to 1041287 Compare February 10, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Build] Improve incremental build time

1 participant