Skip to content

build: establish src/core layout for support modules - #617

Open
somethingwithproof wants to merge 5 commits into
Cacti:developfrom
somethingwithproof:build/source-layout-core
Open

build: establish src/core layout for support modules#617
somethingwithproof wants to merge 5 commits into
Cacti:developfrom
somethingwithproof:build/source-layout-core

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Sep 5, 2026

Copy link
Copy Markdown
Member

What

  • move keywords.c/.h and locks.c/.h into src/core/
  • enable Automake subdir-objects for collision-safe nested object placement
  • update the Autotools binary, linked-test, standalone unit-test, and fuzz paths
  • make both cppcheck entry points share one complete nested-source discovery path
  • ignore nested Automake and Docker build artifacts
  • retain existing header include names and the Autotools build

The four production source/header files are 100% renames with no content changes. The remaining changes are build and verification plumbing required by the new paths.

Why

Spine production sources currently live in the repository root. This starts the domain layout in a small, reviewable batch instead of repeating #523, where the source move was coupled to an 11k-line CMake/platform rewrite. keywords and locks were selected because active PRs #597 and #614 do not modify their implementation files; only shared build manifests overlap #597.

subdir-objects is enabled in this first production move so future modules with the same basename cannot write the same top-level object under parallel builds.

Closes #616.

Verification

  • ./bootstrap with no subdirectory-source warnings
  • ./configure --with-mysql=$(brew --prefix mariadb-connector-c) --with-snmp=$(brew --prefix net-snmp) CPPFLAGS=-I$(brew --prefix openssl@3)/include LDFLAGS=-L$(brew --prefix openssl@3)/lib
  • warning-enabled make -j$(sysctl -n hw.ncpu); project sources compile, with Homebrew Net-SNMP header warnings only
  • make check (cmocka unavailable to Autoconf locally; 0 local tests)
  • make distcheck; archive verified to contain all four src/core files
  • cppcheck source discovery verified under macOS Bash 3 and includes all four relocated files
  • standalone tests/unit/Makefile compiles through header resolution with -I../../src/core (the local macOS link retains unrelated existing client-library/toolchain issues)
  • GitHub checks pass, including fuzz, sanitizers, coverage, distcheck, gcc/clang, SNMPv3, and Rocky Linux

The local macOS fuzz build reaches both relocated files, then fails identically on untouched util.c (INT_MAX) and Net-SNMP API declarations on both this branch and develop. Linux fuzz CI is the authoritative fuzz-build result.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Copilot AI lite review requested due to automatic review settings September 5, 2026 23:01

Copilot AI 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.

🟡 Changes recommended

The make cppcheck Docker target is likely to fail to resolve locks.h/keywords.h after the move because it does not pass updated include paths.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR begins establishing a src/core/ domain layout by relocating two low-coupling support modules (locks and keywords) while preserving existing header include names and keeping the Autotools build as the primary build system.

Changes:

  • Move locks.c/.h and keywords.c/.h into src/core/ (rename-only)
  • Update Autotools source/header lists and global include paths to build against the new layout
  • Update fuzz build source paths and include paths to reach the relocated modules
File summaries
File Description
Makefile.am Updates Autotools spine_SOURCES, linked-test sources, distributed headers list, and adds src/core to include paths.
tests/fuzz/Makefile Points fuzz build at src/core/{locks,keywords}.c and adds -I.../src/core include path.
src/core/locks.c Relocated implementation (rename-only per PR description).
src/core/locks.h Relocated header (rename-only per PR description).
src/core/keywords.c Relocated implementation (rename-only per PR description).
src/core/keywords.h Relocated header (rename-only per PR description).
Review details
  • Files reviewed: 2/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Makefile.am

Copilot AI 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.

🟡 Changes recommended

scripts/verify.sh now depends on Bash-only features but is invoked via /bin/sh in at least one existing path, making it fragile unless it self-reexecs under Bash.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 4/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread scripts/verify.sh Outdated
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>

Copilot AI 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.

🟡 Changes recommended

configure.ac enables subdir-objects, which contradicts the PR’s stated intent to defer it and changes object placement beyond a rename-only move.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 6/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread configure.ac

Copilot AI 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.

🟢 Approval recommended

The moved modules resolve correctly via updated include paths and all referenced build/verification entry points shown in the diff consistently reference the new src/core locations.

Review details
  • Files reviewed: 6/11 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: establish src/core layout for support modules

2 participants