-
Notifications
You must be signed in to change notification settings - Fork 249
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
Cross-compile? #297
Comments
Hey Terris, I think the best would be for you to try and let us know of any issues you have so that we can try helping you. We are not aware of any blockers that might prevent you from following along with that blog post. Good luck! |
Hello @terrisgit , yes, this is the right direction. One should use the general approach for cross compiling C++ projects in Bazel, rules_foreign_cc are taking all the cross compilation information from Bazel C++ toolchain. |
I tried to specify the toolchain when invoking b2 with bootstrap_options and user_options to specify something like arm-linux-gnueabihf, but I was not able to get it to work, so I gave up. It was fun but it's more than I can handle. |
I was not able to get it to work with CMake projects either. mjbots/rpi_bazel#3 updated |
In case you want to help https://github.com/dev-guy/pi-bazel-boost-vsomeip |
@terrisgit you can run "bazel build --spawn_strategy=standalone" for the execution without sandbox. As far as I can tell by the message, it is something with the crosstool configuration itself, as CMake can not successfully compile some simple test program using the tools and flags passed to it. Also, there should be the full script file used by cmake_external in ./bazel-gen///logs/ directory, this may help. |
Thank you for the reply. I will add --spawn_strategy=standalone to .bazelrc. TL/DR: Neither CMake nor Boost work with mjbots/rpi_bazel If there's an alternative to getting these to cross-compile for the Pi and other platforms, I will use that instead. I just can't find anything. I'm not waiting for it - I want to grease the wheels for everyone in the IoT/embedded industry by donating some of my time and passion to the cause. Unfortunately, I don't have the technical expertise in Bazel to contribute, although I am learning my way through the forest. The issues I've encountered are impediments to using Bazel for cross compilation that cause people on deadlines to use scripting+CMake+chewing gum+chicken wire instead. There are a lot of smart people working on and using Bazel. We can fix this. |
Update: These two projects, mjbots/rpi_bazel and bazelbuild/rules_foreign_cc are philosophically opposed. There are now several repos - which fall outside the bazelbuild organization - that attempt to convert the build processes of projects that use CMake and b2 to Bazel. Without official bazelbuild support, they are all at risk of being abandoned or, at least, incomplete, since converting every CMake project to Bazel is impossible. I guess I need to better understand what rpi_bazel is doing and try to make it work with rules_foreign_cc. That seems to be the only long-term path forward. Unfortunately, understanding rpi_bazel requires the highest level of Bazel mastery. Lack of examples is probably the biggest reason why organizations with deadlines give up on Bazel. I'm trying to cross-compile something that uses boost and a CMake project. If we could get this working, it would go a long way to proving that Bazel is superior to everything else, since it works with b2 and CMake without trying to replace them. That's the philosophy that I believe in. |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_foreign_cc! |
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?" |
I have a Bazel project that needs to build Boost etc. for Raspberry Pi on Ubuntu. I am using rules_foreign_cc today successfully to build both boost b2 and CMake projects but haven't yet tried cross compilation. How much trouble do you suppose I'm in for?
I was about to embark on a project following the approach described here:
https://jpieper.com/2018/10/28/configuring-bazel-to-cross-compile-for-the-raspberry-pi-3/
The text was updated successfully, but these errors were encountered: