carbon-lang icon indicating copy to clipboard operation
carbon-lang copied to clipboard

Brew build on ubuntu fails when environment variable CC is set

Open jkamins7 opened this issue 3 years ago • 2 comments

Steps to reproduce:

export CC=clang

Then follow the tutorial

# Install bazelisk using Homebrew.
$ brew install bazelisk

# Install Clang/LLVM using Homebrew.
# Many Clang/LLVM releases aren't built with options we rely on.
$ brew install llvm
$ export PATH="$(brew --prefix llvm)/bin:${PATH}"

# Download Carbon's code.
$ git clone https://github.com/carbon-language/carbon-lang
[error.log](https://github.com/carbon-language/carbon-lang/files/9184539/error.log)

$ cd carbon-lang

# Build and run the explorer.
$ bazel run //explorer -- ./explorer/testdata/print/format_only.carbon

Output error.log

It seems like this issue is in this part of the code:

https://github.com/carbon-language/carbon-lang/blob/25b6a36b0d323fc81f0afe149552b5b0f6fc1350/bazel/cc_toolchains/clang_configuration.bzl#L29-L33

jkamins7 avatar Jul 25 '22 20:07 jkamins7

Can you provide the following:

echo $CC
$CC --version

jonmeow avatar Jul 25 '22 20:07 jonmeow

This would not have been the original output, since I installed homebrew after my first attempt. However, I'm still able to replicate the error

> echo $CC
clang
> $CC --version
Homebrew clang version 14.0.6
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/linuxbrew/.linuxbrew/opt/llvm/bin

Also, it's definitely CC since the following works

unset CC
bazel run //explorer -- ./explorer/testdata/print/format_only.carbon

jkamins7 avatar Jul 26 '22 00:07 jkamins7

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please comment or remove the inactive label. The long term label can also be added for issues which are expected to take time. This issue is labeled inactive because the last activity was over 90 days ago.

github-actions[bot] avatar Oct 24 '22 02:10 github-actions[bot]

I think this was addressed by #1724

jonmeow avatar Oct 24 '22 15:10 jonmeow