Skip to content

FileHandlingConfig fails to compile in projects after #5752 #6183

Description

@iantrettel
F´ Version 4.4.1
Affected Component File Handling Subtopology

Problem Description

#5752 removed INTERFACE from Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeLists.txt. This was needed because FileHandlingConfig.fpp now defines string constants (Paths.prmDbFile, Paths.sandboxDir), so FPP generates an FppConstantsAc.cpp that has to be compiled.

The module was not given any DEPENDS, though, so the resulting library target has no global F´ include directories. The generated FppConstantsAc.cpp includes Svc/Subtopologies/FileHandling/FileHandlingConfig/FppConstantsAc.hpp (a path relative to the F´ build root) plus the framework/config headers, and these can't be found.

Context / Environment

Execute fprime-util version-check and share the output.

((fprime-venv) ) workspace [87-fprime-4.4.1-update]$ fprime-util version-check
Operating System: Linux
CPU Architecture: aarch64
Platform: Linux-7.0.14-linuxkit-aarch64-with-glibc2.34
Python version: 3.12.14
CMake version: 3.26.0
Pip version: 26.2.1
Pip packages:
    fprime-tools==4.4.0
    fprime-gds==4.4.0
    fprime-fpp==3.4.0
Project submodules:
    https://github.com/nasa/fprime.git @ v4.4.1
    https://github.com/fprime-community/fprime-vxworks.git @ v4.4.0

How to Reproduce

  1. Use F´ v4.4.1 in a project that includes the FileHandling subtopology. In our case the project also overrides FileHandlingConfig.fpp via CONFIGURATION_OVERRIDES.
  2. fprime-util generate && fprime-util build
  3. Compiling Svc_Subtopologies_FileHandling_FileHandlingConfig / FppConstantsAc.cpp fails with missing-header errors.
[9/1023] Building CXX object F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeFiles/Svc_Subtopologies_FileHandling_FileHandlingConfig.dir/FppConstantsAc.cpp.o
FAILED: F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeFiles/Svc_Subtopologies_FileHandling_FileHandlingConfig.dir/FppConstantsAc.cpp.o 
/usr/bin/c++  -I/workspace/lib/fprime-hpsc -I/workspace/lib/fprime-hpsc-linux -I/workspace/lib/fprime-vxworks -I/workspace/build-fprime-automatic-linux/F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/.. -std=c++14 -Wno-unused-parameter -Wno-vla -DASSERT_FILE_ID=0x0085d98e -DASSERT_RELATIVE_PATH='"Svc/Subtopologies/FileHandling/FileHandlingConfig/FppConstantsAc.cpp"' -MD -MT F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeFiles/Svc_Subtopologies_FileHandling_FileHandlingConfig.dir/FppConstantsAc.cpp.o -MF F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeFiles/Svc_Subtopologies_FileHandling_FileHandlingConfig.dir/FppConstantsAc.cpp.o.d -o F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeFiles/Svc_Subtopologies_FileHandling_FileHandlingConfig.dir/FppConstantsAc.cpp.o -c /workspace/build-fprime-automatic-linux/F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/FppConstantsAc.cpp
/workspace/build-fprime-automatic-linux/F-Prime/Svc/Subtopologies/FileHandling/FileHandlingConfig/FppConstantsAc.cpp:7:10: fatal error: Svc/Subtopologies/FileHandling/FileHandlingConfig/FppConstantsAc.hpp: No such file or directory
    7 | #include "Svc/Subtopologies/FileHandling/FileHandlingConfig/FppConstantsAc.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[18/1023] Generating versions/version.hpp, versions/version.cpp, versions/version.json
ninja: build stopped: subcommand failed.
[ERROR] CMakeExecutionException: CMake erred with return code 1

Expected Behavior

FileHandlingConfig builds like the other subtopology config modules.

Proposed fix

Give the module the same dependency its siblings have:

--- a/Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeLists.txt
+++ b/Svc/Subtopologies/FileHandling/FileHandlingConfig/CMakeLists.txt
@@ -2,4 +2,6 @@ register_fprime_config(
     EXCLUDE_FROM_ALL
     AUTOCODER_INPUTS
         "${CMAKE_CURRENT_LIST_DIR}/FileHandlingConfig.fpp"
+    DEPENDS
+        Fw_Types
 )

With this change a clean native Linux build of our deployment succeeds, including FileHandlingConfig/FppConstantsAc.cpp.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcmakeIssues pertaining to the CMake build system.

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions