Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fprime-util generate displays generic error when library is missing target restrictions #2486

Closed
kbotteon opened this issue Jan 16, 2024 · 2 comments
Assignees
Labels
bug cmake Issues pertaining to the CMake build system. High Priority High Priority issue that needs to be resolved.

Comments

@kbotteon
Copy link
Contributor

F´ Version 3.4.0
Affected Component fprime-util

Problem Description

@LeStarch, per our conversation earlier, you requested a bug report with the following notes:

  • fprime-util generate will produce a generic error when one of the subrepos listed as a library_location in settings.ini is missing the correct restrict_platforms() verbiage in its any of its CMake files.
  • One example is that in which a library is added to access one or several files, but a target-specific static library included as a MOD_DEP is also specified

How to Reproduce

  1. Include as a library_location any submodule or folder tree which includes a CMake that uses a path in a cmake/toolchain file
  2. Alternatively, set a MOD_DEPS that is satisfied by a lower-level CMake file with a restrict_platforms() that does not match the higher-level CMake file
  3. Observe an error like:

CMake error at fprime/cmake/target/build.cmake:75 (add_dependencies): The dependency myLib.a of target MyTarget does not exist

Expected Behavior

Reading the CMake call/error stack will eventually get you to a line pointing to the underlying offending CMake file. I'm not sure how you would like to improve this.

@kbotteon kbotteon added the bug label Jan 16, 2024
@LeStarch
Copy link
Collaborator

What is happening is that restrict_platforms can remove a library from the build which is a dependency of another library. This causes the above generic error.

This can be fixed by adding code to track available by restricted targets, and alerting the user when selected as a dependency.

@LeStarch LeStarch added cmake Issues pertaining to the CMake build system. High Priority High Priority issue that needs to be resolved. labels Mar 27, 2024
@LeStarch
Copy link
Collaborator

Note: this can be fixed partially. It can be fixed, but only if the restricted platform comes first in the build order. Otherwise this cannot be guaranteed. Since this is most cases, I'll make the fix.

LeStarch added a commit to LeStarch/fprime that referenced this issue Mar 28, 2024
@LeStarch LeStarch self-assigned this Mar 28, 2024
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. High Priority High Priority issue that needs to be resolved.
Projects
None yet
Development

No branches or pull requests

2 participants