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

investigate cargo zigbuild for cross-compiling targeting lower GLIBC version #15749

Closed
1 of 3 tasks
BugenZhao opened this issue Mar 18, 2024 · 1 comment
Closed
1 of 3 tasks
Labels
component/ci type/enhancement Improvements to existing implementation.
Milestone

Comments

@BugenZhao
Copy link
Member

BugenZhao commented Mar 18, 2024

To make the release binary compatible with most Linux distros, we decided to build it on manylinux2014 starting from #4556 since it features GLIBC 2.17, which is relatively low.

However, the outdated environment also makes maintenance difficult for us. Examples:

Theoretically, the target GLIBC version does not have to be the same with the host GLIBC version, which is essentially the idea of cross-compiling. For a long time, however, this has been considered difficult and impossible.

Fortunately, the build system from zig makes the life easier to do cross-compiling on C/C++ dependencies (see https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html). There's also a wrapper for using zig cc in Rust projects named cargo-zigbuild.

By including the GLIBC version in --target, we're able to make the artifact linked with a different version of GLIBC than the current system uses. Ideally, this allows us to use an arbitrary distro for building RisingWave Linux binaries and still makes it compatible with most old systems.

cargo zigbuild --target aarch64-unknown-linux-gnu.2.17 -p risingwave_cmd_all

However, there're still some outstanding issues for this to work correctly. Generally, it requires all -sys dependencies to correct handle the cases for cross-compiling.

@BugenZhao BugenZhao added type/enhancement Improvements to existing implementation. component/ci labels Mar 18, 2024
@github-actions github-actions bot added this to the release-1.8 milestone Mar 18, 2024
@BugenZhao BugenZhao changed the title investigate cargo zigbuild for cross-compiling with lower GLIBC version investigate cargo zigbuild for cross-compiling targeting lower GLIBC version Mar 18, 2024
@BugenZhao
Copy link
Member Author

Since #15821, this is no longer a must-have.

@BugenZhao BugenZhao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ci type/enhancement Improvements to existing implementation.
Projects
None yet
Development

No branches or pull requests

1 participant