Skip to content

CMake target unbound growth fix (cleanup of #6238) - #6277

Merged
LeStarch merged 3 commits into
nasa:develfrom
lestarch-autobot:devin/1793147492-pr-6238-cleanup
Oct 28, 2026
Merged

LeStarch merged 3 commits into
nasa:develfrom
lestarch-autobot:devin/1793147492-pr-6238-cleanup

Conversation

@lestarch-autobot

Copy link
Copy Markdown
Collaborator
Related Issue(s) Supersedes #6238
Has Unit Tests (y/n) n (CMake metadata change; verified by repeated configure/build, see below)
Documentation Included (y/n) n (function doc comments only)
Generative AI was used in this contribution (y/n) AI

Change Description

Cleanup of #6238 (CMake target unbound growth fix) with the fix from JPL-Devin#277 applied on top. The original commits from #6238 are kept as-is.

  • cmake/fprime-util.cmake: new fprime_util_metadata_remove(DIRECTORY), which deletes build-targets, sub-directories, tests, and test-dir .fprime-util files.
  • cmake/FPrime.cmake: the top-level binary directory reset now calls fprime_util_metadata_remove (delete) and no longer calls fprime_util_metadata_clear (truncate to empty).
  • cmake/FPrime.cmake: fprime_setup_included_code() also resets the directory that includes F´ (for example, TestDeploymentsProject's F-Prime binary directory) when that directory is not the root.

Rationale

#6238 truncates the root build-targets.fprime-util to an empty file. fprime-util reads a missing file as "fall back to the default target" but an empty file as "no targets". So fprime-util build in TestDeploymentsProject printed ninja: no work to do., and the Ref CI job produced no ref-build-artifacts-* (the Integration Tests failure on #6238). Deleting the files avoids this.

The F-Prime directory is entered with plain add_subdirectory, so no add_fprime_subdirectory parent resets its metadata. Before this change its build-targets still grew on every re-configure, even with #6238 applied.

Testing/Review Recommendations

Line counts of the metadata files after fprime-util generate and again after 3 × cmake .:

Tree File devel #6238 this PR
TestDeploymentsProject root build-targets absent empty → no-op build absent
TestDeploymentsProject root sub-directories 1 → 4 1 → 1 1 → 1
TestDeploymentsProject F-Prime/build-targets 2 → 8 2 → 8 2 → 2
fprime root root build-targets 2 → 8 — 2 → 2
fprime root root sub-directories 9 → 36 — 9 → 9
fprime root (--ut) root tests / build-targets — — 1 / 2, stable over 2 re-configures
  • TestDeploymentsProject: fprime-util build ran all 938 steps and installed build-artifacts/Linux/Ref/bin/Ref. On CMake target unbound growth fix #6238 the same command prints ninja: no work to do.
  • Repro from CMake target unbound growth fix #6238 review: ran touch default/config/OsCfg.fpp && fprime-util build 3 times. CMake re-ran each time, the build passed, and the metadata counts stayed the same (F-Prime 2, root sub-dirs 1, Ref 1).
  • fprime-util check in Svc/CmdDispatcher (UT build): passed.
  • cmake/test pytest: 116 passed (CMake 3.26.0, same command as cmake-test.yml).
  • RPI Integration Tests on CMake target unbound growth fix #6238 failed during dependency install with OSError: [Errno 28] No space left on device on the self-hosted runner. That is unrelated to this diff.

Future Work

None.

Credit

Supersedes #6238 by @ablack-jpl; original commits retained unchanged. Fix ported from JPL-Devin#277.

Co-authored-by: Aaron Black aaron.black@jpl.nasa.gov
Co-authored-by: Aaron Black <ablack@.jpl.nasa.gov>
Co-authored-by: Thomas Boyer-Chammard 49786685+thomas-bc@users.noreply.github.com
Co-authored-by: M Starch LeStarch@googlemail.com

Triage → commit:

  • Review 6328562120 (TestDeploymentsProject builds nothing) → 6638b91
  • Integration Tests [ubuntu/macos] missing Ref artifact → 6638b91 (same root cause)
  • RPI Integration Tests (runner disk full) → no action, infra
  • Coverage bot (-0.02%) → no action, informational
  • Update/active logger min #277 Devin Review: plain add_subdirectory dirs accumulate → no action, already on devel and outside fprime-util tracking

Contributor Checklist

AI Usage (see policy)

Devin (AI) ported the #277 fix onto #6238, wrote the helper and its comments, and ran the configure/build verification above.

IAMAI

Aaron Black and others added 3 commits October 21, 2026 12:51
Truncating the project-root build-targets.fprime-util left an empty file where devel has none; fprime-util reads an empty file as "nothing to build", so building TestDeploymentsProject (find_package layout) became a no-op (CI: Ref "ninja: no work to do.", Integration Tests missing ref-build-artifacts). Remove the root metadata instead, and also reset the directory that includes F Prime in fprime_setup_included_code, which no add_fprime_subdirectory parent clears. Fix taken from JPL-Devin#277.

Co-authored-by: Aaron Black <aaron.black@jpl.nasa.gov>
Co-authored-by: Aaron Black <ablack@.jpl.nasa.gov>
Co-authored-by: Thomas Boyer-Chammard <49786685+thomas-bc@users.noreply.github.com>
Co-authored-by: M Starch <LeStarch@googlemail.com>
@lestarch-autobot lestarch-autobot mentioned this pull request Oct 28, 2026
3 tasks done
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report — base devel

Overall (line): 85.35% → 85.49% (+0.14)
Regression threshold: 0.50% (line).

Regressions

(none over threshold)

Modules changed

Module Line Δ Function Δ Branch Δ
Svc/FpySequencer 87.03 +0.09 99.54 +0.01 79.16 +0.06
Os/Generic 90.18 +0.10 89.13 +0.00 75.10 +0.20
Svc/Ccsds/CfdpManager 89.57 +0.13 96.04 +0.02 75.45 +0.44
Os 19.87 +0.16 22.58 +0.13 17.46 +0.18
Os/Posix 71.03 +0.39 87.50 +0.00 51.12 +0.45
Fw/DataStructures 98.22 +0.62 96.56 -0.58 83.03 +0.91
Svc/DpCatalog 83.75 +0.88 97.22 +0.16 73.00 +0.64
Utils 47.86 +1.18 46.73 +1.02 49.73 +0.29
Svc/TlmPacketizer 94.85 +2.54 100.00 +0.00 84.57 +6.21

New modules

Module Line Function Branch
Fw/Prm 0.00 0.00 0.00

Modules without UTs

CFDP/Checksum/GTest, Drv/LinuxGpioDriver, Drv/LinuxI2cDriver, Drv/LinuxSpiDriver, Drv/Ports/DataTypes, Drv/PosixUartDriver, FppTestProject/FppTest/topology/async, FppTestProject/FppTest/topology/components/Comp, FppTestProject/FppTest/topology/components/Framework, FppTestProject/FppTest/topology/components/Receiver, FppTestProject/FppTest/topology/components/Sender, FppTestProject/FppTest/topology/guarded, FppTestProject/FppTest/topology/sync, FppTestProject/FppTest/topology/top_ports, FppTestProject/FppTest/topology/types, Fw/Com, Fw/Comp, Fw/FilePacket/GTest, Fw/Fpy, Fw/Obj, Fw/Port, Fw/Sm, Fw/Test, Fw/Types/GTest, Os/Models, Svc/Ccsds/Types, Svc/Ccsds/Utils, Svc/FatalHandler, Svc/Subtopologies/CdhCore, Svc/Subtopologies/ComCcsds, Svc/Subtopologies/ComCcsdsSdls, Svc/Subtopologies/ComFprime, Svc/Subtopologies/ComLoggerTee, Svc/Subtopologies/DataProducts, Svc/Subtopologies/DpCompression, Svc/Subtopologies/FileHandling, Svc/Subtopologies/FileHandlingCfdp, Svc/Subtopologies/FileHandlingCfdp/FileHandlingCfdpConfig, TestDeploymentsProject/Ref/DpDemo, TestDeploymentsProject/Ref/PingReceiver, TestDeploymentsProject/Ref/RecvBuffApp, TestDeploymentsProject/Ref/SendBuffApp, TestDeploymentsProject/Ref/Top, TestDeploymentsProject/Ref/TypeDemo, cmake/test/data/TestConfigDeployment, cmake/test/data/TestDeployment/TestBuildAutocoder, cmake/test/data/TestDeployment/TestDuplicateDirective, cmake/test/data/TestDeployment/TestHeaderAutocoder, cmake/test/data/TestDeployment/TestLinkDepends, cmake/test/data/TestDeployment/TestRelative, cmake/test/data/test-fprime-library/TestLibrary/TestComponent, cmake/test/data/test-fprime-library2/TestLibrary2/TestComponent

@LeStarch
LeStarch merged commit 0ad9c1a into nasa:devel Oct 28, 2026
81 of 83 checks passed
@thomas-bc-autowot thomas-bc-autowot added bug cmake Issues pertaining to the CMake build system. labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cmake Issues pertaining to the CMake build system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants