Skip to content

feat(CMake): deliverables target, no LTO in CI Debug builds, Windows stub gates fix - #1412

Closed
BotellaA wants to merge 3 commits into
nextfrom
feat/deliverables-target
Closed

BotellaA wants to merge 3 commits into
nextfrom
feat/deliverables-target

Conversation

@BotellaA

@BotellaA BotellaA commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

1. deliverables target

Why

Some CI jobs need everything a package or a wheel ships, but not the tests. The Linux Python test job, for example, compiles every C++ test just to run the Python tests, which build-linux already covers. Today the only way to build "everything except the tests" is to list folder targets (src/geode/all, src/bin/all, bindings/python/all), and those differ between repos (Geode-solutions/actions#111).

What

A new custom target, deliverables, created next to essential and third_party in GlobalOptions.cmake. It depends on every:

  • library (add_geode_library),
  • binary (add_geode_binary),
  • Python module (add_geode_python_binding).

cmake --build . -t deliverables then builds what cpack and the wheel target need, without the tests. It follows the same pattern as essential.

2. No link-time optimization in CI Debug builds

Why

CppTargets.cmake turns on link-time optimization (LTO) whenever the compiler supports it, Debug builds included. In the CI test builds that means -flto=thin (clang), -flto (gcc) and /GL + /LTCG (MSVC). The links then redo the optimization of every object, for binaries that are only tested once. Links also can't be cached, which would cap what a compiler cache could save.

Measured locally on Geode-Common, CPU time, with the CI flags (-O2 -D_GLIBCXX_ASSERTIONS, clang, unity on):

Build LTO on (today) LTO off Change
From scratch (101 compiles, 75 links) 862 s 550 s −36%
One file changed (1 compile, 29 links) 67 s 14 s −79%
Relink everything (73 links) 102 s 24 s −76%

What

When GEODE_CI_DEBUG_FLAGS is set (only the CI test builds set it), CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG is set to OFF:

  • CI Debug builds: no LTO.
  • CI Release builds (nightly, deploy): LTO kept, even with the variable set.
  • Builds outside CI: unchanged.

I checked these three cases on a minimal CMake project with clang, by looking for -flto in the generated compile commands.

It's an environment variable, so it also reaches the inner project of superbuild repos, which a -D option on the outer configure wouldn't.

3. Fix: stub gates on Windows (from #1411)

Bug

On Windows, test-py-stubs and test-py-wrapper-stubs fail:

ImportError: DLL load failed while importing geode_common_py_core: The specified module could not be found.
error: pybind11-stubgen failed on geode_common_py_core

check_python_stubs.py runs pybind11-stubgen and mypy.stubtest in their own process. That process didn't import geode_test_env, which adds the dependency DLL folders (GEODE_DLL_DIRECTORIES). Since Python 3.8, Windows no longer searches PATH for the DLLs of an extension module. The other Python tests pass because they import geode_test_env themselves.

The CI didn't report it: the Windows Python test job ignored ctest failures (PowerShell without stop-on-error). Seen on Geode-Common_private (next): 2 of 9 Python tests failed, and the job was still green.

Fix

Both tools now run through a small wrapper (python_module_command). It imports geode_test_env when it's available (it isn't for the wheel target, which runs the same gates), then runs the module like python -m, with the same arguments and exit code. Checked locally with a standard-library module.

🤖 Generated with Claude Code

Builds everything a package or a wheel ships, without the tests:
libraries, binaries and Python modules. CI jobs that only package or run
the Python tests no longer compile the C++ tests (cmake --build . -t
deliverables).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BotellaA
BotellaA requested a review from panquez November 17, 2026 09:23
BotellaA pushed a commit to Geode-solutions/actions that referenced this pull request Nov 17, 2026
Replaces the lookup of the folder targets (Geode-solutions/OpenGeode#1412),
falls back to building everything with older OpenGeode releases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With GEODE_CI_DEBUG_FLAGS (CI test builds), Debug builds no longer use
link-time optimization: the links redid the optimization of every object.
Measured on Geode-Common (clang, CI flags): -36% CPU for a full build,
-79% after a one-file change. Release builds keep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BotellaA BotellaA changed the title feat(CMake): deliverables target feat(CMake): deliverables target, no LTO in CI Debug builds Nov 17, 2026
BotellaA pushed a commit to Geode-solutions/actions that referenced this pull request Nov 17, 2026
Requires an OpenGeode release with the deliverables target
(Geode-solutions/OpenGeode#1412) in every repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pybind11-stubgen and mypy.stubtest import the binding modules in their own
process, which did not import geode_test_env: on Windows, the DLLs of the
dependencies were not found (DLL load failed while importing ...), and
test-py-stubs and test-py-wrapper-stubs failed. The CI did not report it:
the Windows Python job ignored the ctest failures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BotellaA BotellaA changed the title feat(CMake): deliverables target, no LTO in CI Debug builds feat(CMake): deliverables target, no LTO in CI Debug builds, Windows stub gates fix Nov 17, 2026
@BotellaA

Copy link
Copy Markdown
Member Author

Merged into #1411, which now includes these changes.

@BotellaA BotellaA closed this Nov 17, 2026
@BotellaA
BotellaA deleted the feat/deliverables-target branch November 17, 2026 09:28
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.

1 participant