-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Change open-amp/libmetal to build non-recursive #7769
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7769 +/- ##
=======================================
Coverage 55.01% 55.01%
=======================================
Files 483 483
Lines 53946 53946
Branches 10493 10493
=======================================
Hits 29678 29678
Misses 19982 19982
Partials 4286 4286 Continue to review full report at Codecov.
|
ext/hal/CMakeLists.txt
Outdated
@@ -1,5 +1,13 @@ | |||
if(CONFIG_LIBMETAL) |
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.
This libmetal-specific code does not belong in ext/hal/CMakeLists.txt.
It should be pushed into libmetal somehow.
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.
How, I don't think it makes sense to modify the CMakeLists.txt file in libmetal. I don't see a way to do this beyond moving libmetal down another dir, but that seems silly just to avoid a little CMake foo in ext/hal that is clearly related to libmetal.
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 agree with @SebastianBoe , we should not allow the top level CMakeLists.txt file to be come the place where modules are being configured, this will become unmaintainable if everyone starts putting their logic in there. Going down one level seems reasonable, we did this for a few other modules. Also, the README.libmetal does not belong in there.
All of this seems silly now, but when we move to multi-git structure, it will become necessary.
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.
"Going down one level seems reasonable, we did this for a few other modules."
+1
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.
Ok, I'll change it, what's an example where we do this one additional level stuff?
ext/hal/CMakeLists.txt
Outdated
add_subdirectory(atmel) | ||
add_subdirectory(cmsis) | ||
add_subdirectory_ifdef(CONFIG_LIBMETAL libmetal) |
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.
_if_kconfig(libmetal) is preferable when the define matches the directory name.
ext/lib/ipc/CMakeLists.txt
Outdated
set(WITH_LIBMETAL_FIND OFF CACHE BOOL "" FORCE) | ||
set(LIBMETAL_INCLUDE_DIR ${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib/include) | ||
set(LIBMETAL_LIB ${ZEPHYR_BINARY_DIR}/ext/hal/libmetal/lib) | ||
endif(CONFIG_OPENAMP) |
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.
This should also be moved into an openamp-specific build script.
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.
Same comment as related to libmetal, above.
Shouldn't there be a DNM tag? It doesn't seem to build ... Will resume reviewing when it builds and can be tested. Kindly do not dismiss this review EDIT: ninja: error: 'openamp_remote-prefix/src/openamp_remote-build/zephyr/zephyr.bin', needed by 'zephyr/include/generated/core-m0.inc', missing and no known rule to make it |
The ninja build issue isn't directly related, there is an issue #7760 for that. |
Okay, so it is broken on master as well. Anyway, I can't review openamp without testing it. So this review is blocked until #7760 is resolved. |
Why can't you test it w/Make instead of ninja? |
I can. Was not aware #7760 was Ninja-specific. |
I can't find any documentation that explains what the files in samples/subsys/ipc/openamp/platform are. |
what docs do you expect? |
libmetal itself isn't an ipc library, its a generic HAL abstraction library so move it into ext/hal where it belongs. Signed-off-by: Kumar Gala <[email protected]>
Pull in a slightly more recent version of libmetal with changes to the build system to improve integration with Zephyr. This change will break anything that builds with Zephyr and libmetal (which at this point is only the open-amp example). Will fix that shortly. Signed-off-by: Kumar Gala <[email protected]>
With recent changes to libmetal we can now include and build it directly as a zephyr library rather than doing a recursive make. We remove ext/hal/libmetal.cmake as part of this change and introduce a Kconfig option for libmetal. This is a partial fix for issue zephyrproject-rtos#7673. Signed-off-by: Kumar Gala <[email protected]>
Move open-amp to be in ext/lib/ipc/open-amp/open-amp. This allows us to be Zephyr specific files and config like README (for import), CMakeLists.txt file, Kconfig, etc in ext/lib/ipc/open-amp/ that don't conflict with any files that might have the same name in ext/lib/ipc/open-amp/open-amp. Signed-off-by: Kumar Gala <[email protected]>
Pull in a slightly more recent version of open-amp with changes to the build system to improve integration with Zephyr. The recent changes let us embedded open-amp without having to use recursive building. Signed-off-by: Kumar Gala <[email protected]>
With recent changes to open-amp we can now include and build it directly as a zephyr library rather than doing a recursive make. We remove ext/lib/ipc/open-amp.cmake as part of this change and introduce a Kconfig option for open-amp. Fixes: zephyrproject-rtos#7673 Signed-off-by: Kumar Gala <[email protected]>
A toplevel comment in each source file. |
Is there any way for a user to know whether OpenAMP is compatible with his platform? E.g. which platforms do we claim support for the sample? Just lpcxpresso54114_m4? If so that should be explicitly stated in the sample docs instead of implied through the command example and build script code. The same applies to open-amp itself. Do we claim that open-amp will work on all Zephyr platforms, or just the intersecting platforms of open-amp and Zephyr? This should be explicitly documented in open-amp's documentation. |
For application's with self-contained slaves that don't need to import configuration from the master I believe it will be cleaner to have master Kconfig point to an application source directory instead of an image. As can be seen in this patch: It results in less copy-paste boilerplate in the master application build scripts and less magic paths in the prj.conf. |
So fair, but is that directly related to these changes? |
agree with @galak here, this is about the high priority bug we have lingering, lets resolve any documentation and configuration enhancements to some other PR, it this PR resolve the recursive build issue, lets merge it. |
The comments associated with this PR have been addressed, other comments about the sample docs, etc will be addressed in a follow up PR.
I've created PR #7881 for the cleanups you mention in this PR. |
No, but my review of the Open-AMP integration was dismissed so I am doing it now. |
This fixes issue #7673.