Skip to content

Conversation

@ZacBlanco
Copy link
Collaborator

@ZacBlanco ZacBlanco commented Jan 6, 2026

What problem does this PR solve?

Adds the debug and test build to the CI matrix

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 🚀 Performance improvement (optimization)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🔨 Refactoring (no logic changes)
  • 🔧 Build/CI or Infrastructure changes
  • 📝 Documentation only

Description

Adds debug mode build to CI builds.

Performance Impact

  • No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).
  • Positive Impact: I have run benchmarks.
  • Negative Impact: Explained below (e.g., trade-off for correctness).

Release Note

N/A

Checklist (For Author)

  • I have added/updated unit tests (ctest).
  • I have verified the code with local build (Release/Debug).
  • I have run clang-format / linters.
  • (Optional) I have run Sanitizers (ASAN/TSAN) locally for complex C++ changes.
  • No need to test or manual test.

Breaking Changes

  • No
  • Yes (Description: ...)

@ZacBlanco ZacBlanco changed the title Add debug build to CI matrix ci: Add debug build to CI matrix Jan 6, 2026
@ZacBlanco ZacBlanco force-pushed the ci-debug-build branch 3 times, most recently from 35257ff to 4aa809c Compare January 9, 2026 01:08
@yangzhg yangzhg added the ci Pipeline & resource management for continuous integration label Jan 9, 2026
@ZacBlanco ZacBlanco force-pushed the ci-debug-build branch 6 times, most recently from 844ab2b to d9e86a8 Compare January 12, 2026 18:13
@ZacBlanco ZacBlanco marked this pull request as ready for review January 12, 2026 18:33
@ZacBlanco ZacBlanco requested a review from kexianda January 12, 2026 18:37
conanfile.py Outdated
tc.cache_variables["MAX_LINK_JOBS"] = num_link_job

if self.options.get_safe("ci_debug_minsize"):
tc.cache_variables["CMAKE_CXX_FLAGS_DEBUG"] = ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to touch this?
CMAKE_CXX_FLAGS_DEBUG flag will controlled by conan build -s build_type=xxx

To use the Release dependencies:
conan install . -sbuild_type=$${DEPENDENCY_BUILD_TYPE:-${BUILD_TYPE}}
It will work, I guess.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my testing I found CMAKE_CXX_FLAGS_DEBUG is always set to "-g". In order to create a "debug" build but without the debug info, I needed to remove the "-g" argument from the compilation flags. I found if I just set this variable to "" then -g is removed from the compilation command. This variable is set even in non-debug builds. It just only gets used when the build type is set to Debug.

This was the solution I came up with to strip debug info, but I'm happy to do it another way if you have a suggestion

@ZacBlanco ZacBlanco force-pushed the ci-debug-build branch 2 times, most recently from 14f73ac to ac59340 Compare January 14, 2026 02:00
conanfile.py Outdated
"enable_test": [True, False],
"build_benchmark": ["off", "basic", "on"],
"enable_coverage": [True, False],
"ci_debug_minsize": [True, False],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conan options are the attributes of a library, and these options will exposed to the user (gluten/presto ...)
From my point of view, "ci_debug_minsize" should not be an option.
It is only for CI. Use an environment variable?

btw, build_benchmark / enable_coverage also should be removed. (I will try to remove them later)

Copy link
Collaborator Author

@ZacBlanco ZacBlanco Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I think that makes sense.

I changed the strategy to modify the cmake variable by instead configuring the profile with the following value in the [conf] section:

tools.cmake.cmaketoolchain:extra_variables={"CMAKE_CXX_FLAGS_DEBUG": ""}

This avoids having any specific logic in the build conanfile for CI, which I feel is a much better solution. Configuring the environment seems better to me anyways.

@ZacBlanco ZacBlanco force-pushed the ci-debug-build branch 5 times, most recently from bb0a4e7 to de3ebdf Compare January 15, 2026 23:26
- debug info makes the build very slow due to limited disk perf
- debug info is not really required in CI. We just want the code and
tests to run as if debug is enabled (-O0)
- BOLT_BUILD_TIME added as a cached variable. This
prevents inadvertent changes to version.h which causes recompilation every time we call a `make`
command
- version.h is now generated to _build/<BUILD_TYPE>/gen_cpp/bolt/version/version.h
- In the case you use the makefile to configure, calling
the same target twice in a row will no longer delete
the CMakeCache.txt
- With the version.h changes, CI builds for release and
release_spark profiles will now improve in time by 2-4
minutes for every job due to not recompiling.
- changes benchmarks-build to build-only with a
matrix using benchmarks and debug_with_test
- Added IN_CI variable to force dependencies to be
built in release mode as opposed to debug mode
purely for CI. This is used in conjunction with the `-s &:...` arguments to the conan build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pipeline & resource management for continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants