Skip to content

fix: remove /Od /Ob0 override for Windows CI Release builds - #8961

Merged
timosachsenberg merged 1 commit into
developfrom
fix/remove-windows-od-override
Mar 20, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
fix/remove-windows-od-override

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #8932.

  • Removes the /Od /Ob0 override in tools/ci/cibuild.cmake that disabled all optimizations and inlining for Windows CI Release builds
  • Windows CI will now use CMake's default Release flags (/MD /O2 /Ob2 /DNDEBUG)

Context

The override was added in March 2021 (2cdd0c5a) by @jpfeuffer as a workaround for Windows CI builds being too slow to compile with optimizations on GitHub Actions runners — not because of nanobind (which wasn't part of the project until years later). The commit message was simply "disable optimization" and the surrounding commits show a sequence of attempts to get Windows CI build times under control.

Since 2021, GitHub Actions runners have gotten faster and the codebase/build system has evolved significantly, so this workaround is likely no longer needed. This PR tests whether Windows CI completes in time with default optimization flags.

Test plan

  • Windows CI build completes within the job timeout with /O2 /Ob2
  • No new build errors introduced

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Simplified CI build configuration by removing platform-specific compiler flag overrides, standardizing build settings across all generator environments.

The override was added in 2021 (2cdd0c5) as a workaround for slow
Windows CI builds with optimizations enabled — not for nanobind as
previously assumed. This caused all Windows Release binaries built
through CI to be completely unoptimized (/Od /Ob0 instead of /O2 /Ob2).

Remove the override entirely so Windows CI builds use CMake's default
Release flags (/MD /O2 /Ob2 /DNDEBUG), producing properly optimized
binaries.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f46e9298-10df-42d4-9a5b-6cf6a6aaa579

📥 Commits

Reviewing files that changed from the base of the PR and between 9d15bee and 44d77a9.

📒 Files selected for processing (1)
  • tools/ci/cibuild.cmake
💤 Files with no reviewable changes (1)
  • tools/ci/cibuild.cmake

📝 Walkthrough

Walkthrough

The CI build configuration removes Visual Studio–specific C++ compiler flag overrides (/Od /Ob0 for no optimization) that were previously applied to Release builds. Windows CI builds will now use default CMake Release optimization flags instead of the blanket no-optimization workaround.

Changes

Cohort / File(s) Summary
CI Build Configuration
tools/ci/cibuild.cmake
Removed conditional logic that appended Visual Studio–specific C++ release flags (/Od /Ob0 /DNDEBUG /EHsc) to OWN_OPTIONS when using Visual Studio generator. This allows Windows CI builds to use standard optimization settings.

Possibly related PRs

Poem

🐰 Flags of /Od no more shall reign,
Let optimizers' dance sustain!
With nanobind's targeted care,
Release builds run swift and fair.
Windows builds take flight—whoosh! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing the /Od /Ob0 override from Windows CI Release builds, which is the primary objective of the PR.
Linked Issues check ✅ Passed The PR successfully removes the global /Od /Ob0 override in tools/ci/cibuild.cmake as required by issue #8932, implementing option 1 of the suggested actions to use CMake's default Release flags.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to removing the override as specified in issue #8932; no unrelated modifications or extraneous changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remove-windows-od-override
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@timosachsenberg
timosachsenberg merged commit a04bfea into develop Mar 20, 2026
41 checks passed
@timosachsenberg
timosachsenberg deleted the fix/remove-windows-od-override branch March 20, 2026 10:49
github-actions Bot added a commit that referenced this pull request Mar 22, 2026
Add missing changelog entry for:
- Fix Windows CI Release builds: erroneous /Od /Ob0 flag override removed,
  Windows CI Release binaries are now properly optimized (#8961)

Co-authored-by: Copilot <[email protected]>
timosachsenberg pushed a commit that referenced this pull request Mar 22, 2026
Add missing changelog entry for:
- Fix Windows CI Release builds: erroneous /Od /Ob0 flag override removed,
  Windows CI Release binaries are now properly optimized (#8961)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
@timosachsenberg timosachsenberg mentioned this pull request Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows CI builds use /Od /Ob0 (no optimization) for Release — likely unintended

1 participant