Repository navigation
CMake target unbound growth fix (cleanup of #6238) - #6277
Conversation
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>
Coverage report — base
|
| 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
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: newfprime_util_metadata_remove(DIRECTORY), which deletesbuild-targets,sub-directories,tests, andtest-dir.fprime-utilfiles.cmake/FPrime.cmake: the top-level binary directory reset now callsfprime_util_metadata_remove(delete) and no longer callsfprime_util_metadata_clear(truncate to empty).cmake/FPrime.cmake:fprime_setup_included_code()also resets the directory that includes F´ (for example,TestDeploymentsProject'sF-Primebinary directory) when that directory is not the root.Rationale
#6238 truncates the root
build-targets.fprime-utilto an empty file.fprime-utilreads a missing file as "fall back to the default target" but an empty file as "no targets". Sofprime-util buildinTestDeploymentsProjectprintedninja: no work to do., and the Ref CI job produced noref-build-artifacts-*(the Integration Tests failure on #6238). Deleting the files avoids this.The
F-Primedirectory is entered with plainadd_subdirectory, so noadd_fprime_subdirectoryparent resets its metadata. Before this change itsbuild-targetsstill grew on every re-configure, even with #6238 applied.Testing/Review Recommendations
Line counts of the metadata files after
fprime-util generateand again after 3 ×cmake .:build-targetssub-directoriesF-Prime/build-targetsbuild-targetssub-directories--ut)tests/build-targetsTestDeploymentsProject:fprime-util buildran all 938 steps and installedbuild-artifacts/Linux/Ref/bin/Ref. On CMake target unbound growth fix #6238 the same command printsninja: no work to do.touch default/config/OsCfg.fpp && fprime-util build3 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 checkinSvc/CmdDispatcher(UT build): passed.cmake/testpytest: 116 passed (CMake 3.26.0, same command ascmake-test.yml).OSError: [Errno 28] No space left on deviceon 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:
add_subdirectorydirs accumulate → no action, already on devel and outside fprime-util trackingContributor 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.
AGENTS.md).IAMAI