Skip to content

Allow overriding build type via env var - #3161

Open
achirkin wants to merge 1 commit into
mainfrom
achirkin-fea-libraft-build-type
Open

achirkin wants to merge 1 commit into
mainfrom
achirkin-fea-libraft-build-type

Conversation

@achirkin

@achirkin achirkin commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Allow overriding the CMAKE_BUILD_TYPE in the build.sh script via environment variables.

Mirrors the LIBRAFT_BUILD_DIR pattern.

This allows, for example, writing LIBRAFT_BUILD_TYPE=RelWithDebInfo ./build.sh to build raft with debug symbols and optimization enabled - without modifying the build script.

Allow overriding the `CMAKE_BUILD_TYPE` in the `build.sh` script via environment variables.

Mirrors the `LIBRAFT_BUILD_DIR` pattern.

This allows, for example, writing `LIBRAFT_BUILD_TYPE=RelWithDebInfo ./build.sh` to build raft with debug symbols and optimization enabled - without modifying the build script.
@achirkin
achirkin requested a review from a team as a code owner October 1, 2026 05:16
@achirkin achirkin self-assigned this Oct 1, 2026
@achirkin achirkin added feature request New feature or request non-breaking Non-breaking change labels Oct 1, 2026
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/raft/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1d532fd0-b7b6-4daf-a97b-9f8c587d1ca7

📥 Commits

Reviewing files that changed from the base of the PR and between f197acb and 107231f.

📒 Files selected for processing (1)
  • build.sh

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Chores
    • Build configuration now honors a specified build type, using Release when none is provided. The build type is also handled consistently when passed to the configuration step.

Walkthrough

The build script now uses LIBRAFT_BUILD_TYPE as the default build type, with Release as the fallback. It quotes the build-type value in the CMake configure argument.

Changes

Build configuration

Layer / File(s) Summary
Build type selection and CMake argument
build.sh
BUILD_TYPE defaults to LIBRAFT_BUILD_TYPE when set and to Release otherwise. The CMake build-type argument now quotes the expanded value.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 10723

The environment variable can select the build type for the usual build invocation, while -g continues to request Debug. No actionable regression is established, so the change is mergeable subject to normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: allowing the build type to be overridden through an environment variable.
Description check ✅ Passed The description accurately explains the LIBRAFT_BUILD_TYPE override, its relationship to build.sh, and a valid usage example.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.64%. Comparing base (f197acb) to head (107231f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3161   +/-   ##
=======================================
  Coverage   57.64%   57.64%           
=======================================
  Files          19       19           
  Lines         517      517           
=======================================
  Hits          298      298           
  Misses        219      219           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Non-breaking change

2 participants