-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for cross compilation in Bazel #2849
Comments
Id' like to get into this one. Wanted to delve into Bazel for a while now. |
Issue Status: 1. Open 2. Started 3. Submitted 4. Done This issue now has a funding of 600.0 DAI (600.0 USD @ $1.0/DAI) attached to it.
|
Issue Status: 1. Open 2. Started 3. Submitted 4. Done Workers have applied to start work. These users each claimed they can complete the work by 3 months, 3 weeks from now. 1) suburbandad has applied to start work (Funders only: approve worker | reject worker). Using https://github.com/emacski/tensorflow-serving-arm as an example, build cross compile configs for linux-arm64 and windows-x86_64, leveraging https://github.com/dockcross/dockcross as the build environment. The net result should be that any host execution with x86_64 architecture should be able to cross compile for windows_x86-64 and linux_arm64 targets. I will first familiarize myself with the existing code, then I will research solutions to the problem. This seems potentially challenging, but I am willing to take it on, and I will not give up easily. If I am able to solve this, I will be sure to do so for MacOS as well. I will make sure to keep you consistantly updated on my progress, and should be able to make signifigant progress over the weekend. In the unlikely case that I do fail at fixing this issue. I will produce a write up with everything I found out while trying to do this bounty. Thank you for your consideration Learn more on the Gitcoin Issue Details page. |
@lzxm160, it has to be bazel. We might be adding more complicated build logic that wouldn't be supported natively with gomod. |
@prestonvanloon sure,I'll try if you approve |
@lzxm160, I took a quick look at your profile on gitcoin and you have 3 abandoned tasks. I wouldn't want to award this task to you so that no one else has the opportunity to work on it then have it abandoned later. Do you have a plan on how to do this? If you already know the solution then I'd accept it and award the bounty, but this is something that won't be easy for someone who isn't familiar with bazel toolchains. |
@prestonvanloon understand,I'll try first |
To anyone interested in working on this, please build from branch We've added some progress towards this goal with #2970. You can see the TODO here: prysm/tools/binary_targets.bzl Lines 1 to 9 in 25d8b48
Suggested workflow here would be to uncomment those lines then build the following from linux:
If both of those targets build on linux, then this issue can be resolved. |
I tried building the darwin_amd64 and windows_amd64 rules on my machine and it worked fine. is this still an issue? |
This is resolved by toolchains in rules_go. |
Reopening this as we still have cross compile issues. |
I have this script to build and upload multiple platform binaries here: https://gist.github.com/prestonvanloon/32fdec43aba8bd96c656739ada69a23e#file-build_and_upload-sh To consider this issue resolved, we should be able to run the above script on linux and successfully build all four targets: Host machine: linux amd64 Targets:
|
Issue Status: 1. Open 2. Started 3. Submitted 4. Done The funding of this issue was increased to 1000.0 SAI (1000.0 USD @ $1.0/SAI) .
|
I am working on a cross-compiling docker container and toolchains that will support cross compiling arm64, darwin and windows from any x86-64 machine that has docker installed. So far I have docker images and toolchain branches for : arm64/linux/clang10 -> successfully builds prysm beacon-chain and validator |
Awesome progress @SuburbanDad. If possible, can you check in the ARM build? We can start providing arm64 docker images sooner |
I will get it into a committable state tonight and publish the MVP docker cross compiler image 👍 |
PR submitted for all four working targets. 🎉 |
Update: @SuburbanDad's PR meets all of the requirements of the bounty. In PR review, I asked if we could make use of bazel's remote build execution and/or docker sandbox. Over a few days of offline discussion, @SuburbanDad and I were able to connect the plumbing from PR #4945 into the bazel RBE and bazel docker sandbox functionality for cross compile. So far, we are able to cross compile and confirm the following:
@SuburbanDad and I will work together to merge our changes into PR #4945 by the end of the week.This will enable us to leverage RBE in our continuous integration and more importantly provide signed executable binaries for each tagged release of Prysm's beacon-node and validator targets. 🎉 |
@ceresstation This is good to go! Please release the bounty to @SuburbanDad |
⚡️ A tip worth 1000.00000 SAI (1000.0 USD @ $1.0/SAI) has been granted to @SuburbanDad for this issue from @ceresstation. ⚡️ Nice work @SuburbanDad! Your tip has automatically been deposited in the ETH address we have on file.
|
Issue Status: 1. Open 2. Started 3. Submitted 4. Done This Bounty has been completed. Additional Tips for this Bounty:
|
Currently, we're unable to build for other OS / architecture whenever the binary target depends on a cgo library. This includes any dependency on go-ethereum in the beacon-chain and potentially a future BLS library.
To reproduce the issue, try building the beacon chain with a different toolchain specified.
Building in on linux targeting windows:
Building on linux amd64 targeting arm64.
Important caveats:
These blocked issues may have some additional context from previous attempts to resolve this.
Blocking #654
Blocking #2546
The text was updated successfully, but these errors were encountered: