Skip to content

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

Merged
merged 6 commits into from
May 24, 2018

Conversation

galak
Copy link
Collaborator

@galak galak commented May 22, 2018

This fixes issue #7673.

@galak galak removed the request for review from dbkinder May 22, 2018 23:25
@codecov-io
Copy link

codecov-io commented May 23, 2018

Codecov Report

Merging #7769 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24b0b3c...b2a7971. Read the comment docs.

@@ -1,5 +1,13 @@
if(CONFIG_LIBMETAL)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link
Collaborator

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

Copy link
Collaborator Author

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?

add_subdirectory(atmel)
add_subdirectory(cmsis)
add_subdirectory_ifdef(CONFIG_LIBMETAL libmetal)
Copy link
Collaborator

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.

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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@SebastianBoe
Copy link
Collaborator

SebastianBoe commented May 23, 2018

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
as was done with the other OpenAMP reviews.

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

@galak
Copy link
Collaborator Author

galak commented May 23, 2018

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
as was done with the other OpenAMP reviews.

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.

@SebastianBoe
Copy link
Collaborator

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.

@galak
Copy link
Collaborator Author

galak commented May 23, 2018

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?

@SebastianBoe
Copy link
Collaborator

I can. Was not aware #7760 was Ninja-specific.

@SebastianBoe
Copy link
Collaborator

I can't find any documentation that explains what the files in samples/subsys/ipc/openamp/platform are.

@galak
Copy link
Collaborator Author

galak commented May 23, 2018

I can't find any documentation that explains what the files in samples/subsys/ipc/openamp/platform are.

what docs do you expect?

galak added 6 commits May 23, 2018 10:44
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]>
@SebastianBoe
Copy link
Collaborator

what docs do you expect?

A toplevel comment in each source file.

@SebastianBoe
Copy link
Collaborator

SebastianBoe commented May 24, 2018

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.

@SebastianBoe
Copy link
Collaborator

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:

SebastianBoe@f059efe

It results in less copy-paste boilerplate in the master application build scripts and less magic paths in the prj.conf.

@galak
Copy link
Collaborator Author

galak commented May 24, 2018

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.

So fair, but is that directly related to these changes?

@nashif
Copy link
Member

nashif commented May 24, 2018

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.

@galak galak dismissed SebastianBoe’s stale review May 24, 2018 14:18

The comments associated with this PR have been addressed, other comments about the sample docs, etc will be addressed in a follow up PR.

@galak galak merged commit 4e8438b into zephyrproject-rtos:master May 24, 2018
@galak
Copy link
Collaborator Author

galak commented May 24, 2018

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.

I've created PR #7881 for the cleanups you mention in this PR.

@SebastianBoe
Copy link
Collaborator

So fair, but is that directly related to these changes?

No, but my review of the Open-AMP integration was dismissed so I am doing it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants