-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Removes 1-to-1 relation of deployments and projects #1994
Removes 1-to-1 relation of deployments and projects #1994
Conversation
@bocchino this allows the structure you were thinking of using (multiple deployments to a single project/build). |
This looks great to me! Looks like CI is not passing yet. I'll re-review when CI passes. |
@bocchino should be ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
) | ||
install(FILES ${FPRIME_CURRENT_DICTIONARY_FILE} DESTINATION ${TOOLCHAIN_NAME}/${MODULE}/dict COMPONENT ${MODULE}) | ||
add_custom_command(TARGET "${MODULE}" POST_BUILD COMMAND "${CMAKE_COMMAND}" | ||
-DCMAKE_INSTALL_COMPONENT=${MODULE} -P${CMAKE_BINARY_DIR}/cmake_install.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm opening #2031 to fix an issue introduced here:
CMake Error: No script specified for argument -P
gmake[3]: *** [CMakeFiles/Ref.dir/build.make:169: bin/Linux/Ref] Error 1
gmake[3]: *** Deleting file 'bin/Linux/Ref'
gmake[2]: *** [CMakeFiles/Makefile2:2352: CMakeFiles/Ref.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:2359: CMakeFiles/Ref.dir/rule] Error 2
gmake: *** [Makefile:184: Ref] Error 2
[ERROR] CMake erred with return code 2
root@2d500cea2ecc:/home/ptl# cmake --version
cmake version 3.18.4
Verification that this is the offending line:
root@2d500cea2ecc:/home/ptl/Ref/build-fprime-automatic-native# /usr/bin/cmake -DCMAKE_INSTALL_COMPONENT=Ref -P/home/ptl/Ref/build-fprime-automatic-native/cmake_install.cmake
CMake Error: No script specified for argument -P
With a space after -P
builds work for my version of CMake.
* Removes 1-to-1 relation of deployments and projects * Fixing CMake UTs * Making deployment subject to toolchain * Fixing CI and minimum tools version * Python formatting and fixing integration test run * Fixing RPI CI path * Fixing RPI remote run integration test
* Removes 1-to-1 relation of deployments and projects * Fixing CMake UTs * Making deployment subject to toolchain * Fixing CI and minimum tools version * Python formatting and fixing integration test run * Fixing RPI CI path * Fixing RPI remote run integration test
Change Description
This removes the 1-to-1 implicit requirement between
register_fprime_deployment
andPROJECT_NAME
. It also introduces the QoL improvementFPRIME_CURRENT_MODULE
, which removes the need to constantly callget_module_name()
in fprime modules (added withadd_fprime_subdirectory()
).Rationale
Having a
project
call and thusPROJECT_NAME
setting as a base requirement for adding a deployment has set F´ outside a more standard CMake structure (project is the root of a source tree).In general this policy has the following disadvantages:
../something
)All of this structure was done for one very specific reason: to support the case where multiple deployments intended to be built with the same toolchain needed different core F´ settings (setting.ini and configuration folder). This is not the most common use case of F´ but the design does complicate the more common use cases..
By weakening the 1-to-1 requirement, the disadvantages are resolved, while still allowing the more complicated structure to continue to work.
Naturally, this solution has some different drawbacks:
installed
in a deployment in the erroneous condition where a deployment is defined but does not define its own topology. See Future Work.Testing/Review Recommendations
Let CI fly!
Future Work
There is additional work that may be done to ease the drawbacks of this structure:
TOPOLOGY
variable to be set when runningregister_fprime_deployment
that specifies what module represents the topology for a given deployment. Default this todeployment/Top
as this is standard. The dictionary would then register as a property to this module and the deployment would pick-up the dictionary to install from there.add_fprime_subproject
API call to add a directory as a new independently configured fprime project to ease the use of the complex case.