cpp-tutorial doesn't work on AArch64 systems
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- build-system, documentation
Research direction
Start with the stage1 C++ tutorial and inspect its WORKSPACE and .bazelrc files, focusing on the explicit x86 references and compiler settings. Run bazel build //main:hello-world on an AArch64 system to reproduce the failure. Done means the introductory tutorial builds reliably without requiring users to remove those files, while custom toolchains remain a separate concern.
Written by the indexing model from the issue text.
Description
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?
- Dominant language
- Starlark
- Stars
- 957
- Forks
- 578
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazelbuild/examples
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
bazelbuild/examples#706 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
bazelbuild/examples#650 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
bazelbuild/examples#642 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
bazelbuild/examples#641 · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
bazelbuild/examples#634 · 2 comments ·
All issues in bazelbuild/examples
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
Builders
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100