carbon-lang
carbon-lang copied to clipboard
Unable to build on Linux
When I run the command
bazel run //explorer -- ./explorer/testdata/print/format_only.carbon
I see the following error message:
INFO: Invocation ID: a94222fa-f225-441f-b5e5-0bf2f8269fb2
INFO: Analyzed target //explorer:explorer (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /mnt/d/Documents/Projects/carbon-lang/explorer/interpreter/BUILD:159:11: Compiling explorer/interpreter/resolve_names.cpp failed: (Exit 1): clang++ failed: error executing command /usr/lib/llvm-13/bin/clang++ -no-canonical-prefixes -fcolor-diagnostics -Werror -Wall -Wextra -Wthread-safety -Wself-assign -Wimplicit-fallthrough -Wctad-maybe-unsupported -Wno-unused-parameter -c -MD ... (remaining 86 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox
In file included from explorer/interpreter/resolve_names.cpp:5:
In file included from ./explorer/interpreter/resolve_names.h:8:
./explorer/ast/ast.h:8:10: fatal error: 'vector' file not found
#include <vector>
^~~~~~~~
1 error generated.
Target //explorer:explorer failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.468s, Critical Path: 0.37s
INFO: 13 processes: 13 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
Ubuntu version: 22.04 Kernel: 5.15.0-41-generic
Installed bazelisk and llvm using linuxbrew
I did not get the same error as you. However, please note that contribution_tools.md does state that export PATH="$(brew --prefix llvm)/bin:${PATH}" is only needed in MacOS and not Linux.
However, can you try to install lld and see if that works?
However, can you try to install
lldand see if that works?
That did solve my problem. Indeed i was using the wrong version for lld. I will delet my previous comments to clean up the conversation.
Can you please update to head? As part of preparing the debug instructions (https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/contribution_tools.md#troubleshooting-build-issues) I removed some special casing of clang-13 that judging by paths here you're probably running into.
(sorry for the slow response)