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

cpp-tutorial doesn't work on AArch64 systems #384

Open
stevecapperarm opened this issue Dec 15, 2023 · 0 comments
Open

cpp-tutorial doesn't work on AArch64 systems #384

stevecapperarm opened this issue Dec 15, 2023 · 0 comments

Comments

@stevecapperarm
Copy link

Hello,
I was following the Bazel C++ build tutorial, and for stage1, I got the following:

$ bazel build //main:hello-world
Starting local Bazel server and connecting to it...
ERROR: While resolving toolchains for target //main:hello-world: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
ERROR: Analysis of target '//main:hello-world' failed; build aborted: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
INFO: Elapsed time: 3.004s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (12 packages loaded, 18 targets configured)

Digging into this, it appears that the WORKSPACE file has explicit references to X86 architecture. Changing this AArch64 then resulted in Bazel bombing out trying to run x86 binaries on my AArch64 system :-(. Also, the .bazelrc file was purposefully preventing the system supplied compiler from being used.

In the end I got everything working as I expected thusly,

$ rm WORKSPACE .bazelrc && touch WORKSPACE
$ bazel build //main:hello-world

Would it be possible to please simplify the tutorial to getting stuff building reliably and simply to begin with, then for folks who want to employ custom toolchains/etc have a separate stage for that?

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

No branches or pull requests

1 participant