Skip to content

CMake: Fix stale staging of headers, modules list, and temporal SQL in build output#7720

Merged
petrasovaa merged 1 commit into
OSGeo:mainfrom
petrasovaa:cmake-output-staging-fixes
Jul 15, 2026
Merged

CMake: Fix stale staging of headers, modules list, and temporal SQL in build output#7720
petrasovaa merged 1 commit into
OSGeo:mainfrom
petrasovaa:cmake-output-staging-fixes

Conversation

@petrasovaa

Copy link
Copy Markdown
Contributor

These were identified problems by AI during unrelated work, below is the AI explanation. Probably not high priority, but could be useful.

This PR fixes three CMake staging defects that leave the runnable tree under build/output stale or incomplete, typically after editing headers or switching branches. Each showed up as confusing failures unrelated to
the change under test.

What changed:

  • Staged headers now refresh. The copy command in include/CMakeLists.txt had no DEPENDS, so once a header was staged it was never re-copied. Editing a header (e.g. include/grass/gis.h) caused compilation against the stale copy and GIS_H_VERSION mismatch fatal errors at runtime.

  • Stale modules no longer linger in ALL_MODULES. Modules append themselves to modules_list as CACHE INTERNAL, but the top-level set(modules_list) only cleared the normal variable, so the cached list accumulated across configures. After switching to a branch where a module no longer exists, builds failed with "No rule to make target". The cache entry is now reset at the start of each configure, before any module registers, which keeps the previous membership (including the helper programs from lib/ and utils/) while dropping stale entries.

  • Temporal SQL templates are staged. lib/temporal/SQL/*.sql were install-only, so temporal database creation failed when running from build/output before cmake --install. They are now copied next to the library, following the lib/gis etc-file staging pattern. As with that pattern, the copy runs when the library relinks, not when only a .sql file changes.

Verification:

  • Touching gis.h and building INCLUDE_HEADERS re-runs the copy.
  • A bogus module name injected into the cached modules_list disappears on reconfigure, and the pre-existing helper program entries are kept.
  • After deleting the staged etc/sql, rebuilding grass_temporal stages all 30 .sql files (and only those, not the Makefile in the same directory).

AI disclosure: implemented and verified by Claude (Fable).

@petrasovaa
petrasovaa requested a review from nilason July 14, 2026 21:11
@github-actions github-actions Bot added temporal Related to temporal data processing libraries CMake labels Jul 15, 2026

@nilason nilason left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, in particular the header files have bothered me for a while, but I always kicked that can further down the road.

@petrasovaa
petrasovaa merged commit f037662 into OSGeo:main Jul 15, 2026
22 checks passed
@petrasovaa
petrasovaa deleted the cmake-output-staging-fixes branch July 15, 2026 20:49
@github-actions github-actions Bot added this to the 8.6.0 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake libraries temporal Related to temporal data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants