Code Monkey home page Code Monkey logo

Comments (8)

irengrig avatar irengrig commented on July 26, 2024

Sorry.
Yes, this is a bug with rules_foreign_cc to not provide the default toolchain implementation.
I just added default toolchain in #213, with "linux" be assumed to be a os name to be passed to CMake. (I.e. that is what is recorded into CMake's crosstool file.
If the platform name should be different, it can be overridden with passing correct CMAKE_SYSTEM_NAME, but as we better try to pass the correct name, I will try to improve on that)

I will continue to check it with amd64/aarch64 later today in a Docker container. Are there more speicfic details to take into account?

Sorry again.

from rules_foreign_cc.

moderation avatar moderation commented on July 26, 2024

Thanks. I can confirm that if I modify the following Envoy will build on aarch64.

diff --git a/~/Library/rules_foreign_cc/tools/build_defs/shell_toolchain//toolchains/toolchain_mappings.bzl b/~/Library/envoyproxy/moderation/rules_foreign_cc/tools/build_defs/shell_toolchain/toolchains/toolchain_mappings.bzl
index af9647e..42fa81a 100644
--- a/~/Library/rules_foreign_cc/tools/build_defs/shell_toolchain//toolchains/toolchain_mappings.bzl
+++ b/~/Library/envoyproxy/moderation/rules_foreign_cc/tools/build_defs/shell_toolchain/toolchains/toolchain_mappings.bzl
@@ -11,7 +11,7 @@ TOOLCHAIN_MAPPINGS = [
     _ToolchainMapping(
         exec_compatible_with = [
             "@bazel_tools//platforms:linux",
-            "@bazel_tools//platforms:x86_64",
+            "@bazel_tools//platforms:aarch64",
         ],
         file = "@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains/impl:linux_commands.bzl",
     ),

I'll try using CMAKE_SYSTEM_NAME. I did have a couple of tries at adding a new ToolchainMapping section but ran into errors. So hopefully it won't be too hard to add aarch64 in addition to x86_64. There are teams building Envoy for the IBM ppc64le architecture as well so I expect there will be several architectures that need to be added.

from rules_foreign_cc.

irengrig avatar irengrig commented on July 26, 2024

I just provided the possibility to introduce custom ToolchainMappings: #214.
Please refer to example there.
I will make it now that CMAKE_SYSTEM_NAME comes from os_name() function, if it is not windows-linux-osx.

Currently I am experimenting with the amd64/alpine container, should I select some better variant?

from rules_foreign_cc.

moderation avatar moderation commented on July 26, 2024

I just tested the latest commit and it works on aarch64. Thanks for the quick turnaround.

from rules_foreign_cc.

irengrig avatar irengrig commented on July 26, 2024

I will make it now that CMAKE_SYSTEM_NAME comes from os_name() function

Done in #215.

from rules_foreign_cc.

irengrig avatar irengrig commented on July 26, 2024

I just tested the latest commit and it works on aarch64. Thanks for the quick turnaround.

Cool, thank you!

from rules_foreign_cc.

irengrig avatar irengrig commented on July 26, 2024

Can I close the issue then?

from rules_foreign_cc.

moderation avatar moderation commented on July 26, 2024

Yes - thanks again for the quick turnaround.

from rules_foreign_cc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.