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

fix: decouple host and embedded builds #225

Merged
merged 24 commits into from
Apr 19, 2023

Conversation

rjaegers
Copy link
Member

@rjaegers rjaegers commented Mar 11, 2023

Description

When building for embedded targets it is no longer needed to first do a host build of amp-embedded-infra-lib.

Details

When using the Echo (RPC) framework based on Google Protocol Buffers, the compiler and compiler plug-ins are fetched from GitHub releases on-demand when building for embedded targets.

In case of a host build the built compiler plug-ins are used, in case of an embedded build the plug-ins are either consumed from a local amp-embedded-infra-lib install or downloaded via FetchContent.

How to use installed echo plug-ins

When wanting to use locally built echo plug-ins in either amp-embedded-infra-lib or a consuming project (i.e. a project using amp-embedded-infra-lib) when doing an embedded build; it is necessary to:

  • Set the CMAKE_INSTALL_PREFIX to a known location (amp-embedded-infra-lib uses CMakePresets.json to set it to ${sourceDir}/install)
  • Add the CMAKE_INSTALL_PREFIX to the CMAKE_PREFIX_PATH (e.g. list(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}"), this is necessary since the prefix paths are empty for a cross-compile.
  • Build and install the host configuration (resulting in an install directory)
  • Build the embedded configuration (check the configure step for a log line that the installed echo plug-ins are used)

Since protobuf is now statically linked we don't need to extend the path
The embedded build no longer depends on the availability of a host build of emil.
Protocol buffer compiler plug-ins for echo are fetched from GitHub releases on-demand when building for embedded.
In case of a host build the built compiler plug-ins are used.
@rjaegers rjaegers requested a review from a team as a code owner March 11, 2023 14:36
@github-actions
Copy link
Contributor

github-actions bot commented Mar 11, 2023

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 11 0 0.05s
✅ DOCKERFILE hadolint 1 0 0.07s
✅ JSON eslint-plugin-jsonc 10 0 0 1.5s
✅ JSON prettier 10 0 0 0.7s
⚠️ MARKDOWN markdownlint 7 0 11 0.66s
⚠️ MARKDOWN markdown-link-check 7 1 32.11s
✅ MARKDOWN markdown-table-formatter 7 0 0 0.45s
✅ SPELL misspell 37 0 0 0.22s
✅ YAML prettier 19 0 0 1.18s
✅ YAML v8r 19 0 6.93s
✅ YAML yamllint 19 0 0.35s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

CMakeLists.txt Outdated Show resolved Hide resolved
external/protoc/CMakeLists.txt Outdated Show resolved Hide resolved
protobuf/echo/protocol_buffer_echo.cmake Outdated Show resolved Hide resolved
protobuf/echo/protocol_buffer_echo.cmake Outdated Show resolved Hide resolved
@rjaegers rjaegers marked this pull request as draft March 21, 2023 08:46
@rjaegers rjaegers marked this pull request as ready for review April 17, 2023 12:48
protobuf/echo_attributes/CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
protobuf/echo/protocol_buffer_echo.cmake Outdated Show resolved Hide resolved
protobuf/echo/protocol_buffer_echo.cmake Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@rjaegers rjaegers enabled auto-merge April 19, 2023 10:09
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@rjaegers rjaegers added this pull request to the merge queue Apr 19, 2023
Merged via the queue into modern-cmake with commit d443b16 Apr 19, 2023
@rjaegers rjaegers deleted the feature/decouple-host-and-embedded-builds branch April 19, 2023 10:53
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.

3 participants