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

Implement cross compilation #89

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Implement cross compilation #89

wants to merge 1 commit into from

Conversation

MP91
Copy link
Contributor

@MP91 MP91 commented Mar 18, 2024

Description

Issue ticket number and link

Checklist

  • Vehicle App can be started with dapr run and is connecting to vehicle data broker

  • Vehicle App can process MQTT messages and call the seat service

  • Vehicle App can be deployed to local K3D and is running

  • Created/updated tests, if necessary. Code Coverage percentage on new code shall be >= 70%.

  • Extended the documentation in Velocitas repo

  • Extended the documentation in README.md

  • Devcontainer can be opened successfully

  • Devcontainer can be opened successfully behind a corporate proxy

  • Devcontainer can be re-built successfully

  • Release workflow is passing

@@ -47,7 +47,7 @@ else()
endif()

add_subdirectory(app)

set_target_properties(app PROPERTIES OUTPUT_NAME ${BIN_NAME})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due the cross compilation, the build is basically running twice and to ensure that both binaries are kept, I added this to have different names for the different architectures

FROM --platform=$TARGETPLATFORM bash:latest as mover
COPY --from=builder /workspace/build/bin/app_* /
COPY ./utils/delete.sh /delete.sh
CMD ["bash", "/delete.sh $TARGETPLATFROM"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CMD ["bash", "/delete.sh $TARGETPLATFROM"]
CMD ["bash", "/delete.sh", $TARGETPLATFROM]


# search headers and libraries in the target environment
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing empty newline at the end of the file


RUN strip /workspace/build/bin/app
# Intermediate stage to delete unused executable
FROM --platform=$TARGETPLATFORM bash:latest as mover
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a mover stage?

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.

2 participants