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

build: add cross-compile support #506

Merged
merged 3 commits into from
Dec 5, 2024

Conversation

bernot-dev
Copy link
Contributor

The build currently relies on QEMU emulation for arm64 builds (#346). This is slow.

This change uses Rust's ability to cross-compile for different platforms instead of relying on emulation, resulting in much faster builds.

Expected improvement is from ≈1h25m to <10m. Local cross-platform builds took about 3-7 minutes for me.

@bernot-dev bernot-dev requested a review from a team as a code owner December 5, 2024 19:06
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.9%. Comparing base (a2da58a) to head (a2f7d90).
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #506   +/-   ##
=====================================
  Coverage   73.9%   73.9%           
=====================================
  Files         50      50           
  Lines       3911    3911           
=====================================
  Hits        2894    2894           
  Misses      1017    1017           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.cargo/config.toml Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
cross-arch-build.sh Outdated Show resolved Hide resolved
@bernot-dev
Copy link
Contributor Author

After a bit of wrestling with dynamically linked libraries (back to musl), it's working now. I successfully build on amd64 for amd64 and arm64, and ran each image without arguments, resulting in the successful output of the help text in each case. This is sufficient to verify that compilation and linking completed successfully.

@bernot-dev bernot-dev requested a review from jsuereth December 5, 2024 21:09
Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

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

Thanks so much for the fixes!!!

@jsuereth jsuereth merged commit fa30323 into open-telemetry:main Dec 5, 2024
23 checks passed
@bernot-dev bernot-dev deleted the cross-compile branch December 5, 2024 21:16
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