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

Adjust some build troubleshooting notes #4471

Merged
merged 10 commits into from
Nov 4, 2024

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Nov 1, 2024

Came up due to libc++ install issues

We've discussed clang version verification, and adding that as long as I'm in here. The more significant bit is the libc++ check, which if it's not installed should fail like:

(tons of output)
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/llvm-16/lib/clang/16/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
/usr/local/google/home/jperkins/.cache/bazel/_bazel_jperkins/85deb7d9d96f7e0e80b42618a55969d7/external/_main~clang_toolchain_extension~bazel_cc_toolchain/_temp:6:2: error: "No libc++ install found!"
#error "No libc++ install found!"
 ^
1 error generated.
ERROR: Analysis of target '//toolchain:toolchain' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.265s, Critical Path: 0.08s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully

pre-commit runs bazel, and GitHub runners have an old clang by default (caught by the new check), so I'm installing here for a consistent version.

@github-actions github-actions bot added the documentation An issue or proposed change to our documentation label Nov 1, 2024
@github-actions github-actions bot requested a review from josh11b November 1, 2024 21:59

Changes to packages installed on your system may not be noticed by `bazel`. This
includes things such as changing LLVM versions, or installing libc++. Running
`bazel clean` should force cached state to be rebuilt.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave a breadcrumb of the exact error here, so a search will turn it up as well?

Suggestion:

As one example, Bazel may raise "absolute path inclusion(s) found in rule" and "includes the following non-builtin files with absolute paths" as an error for libc++ includes if the location of the standard library header files changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now tackling the libc++ issue down a different route, just validation during repo setup (also clang versions that we'd discussed in the past)

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but maybe good to double check that with the precise & functional testing of libc++ now this has enough info in the troubleshooting from @danakj's perspective before merging?

bazel/cc_toolchains/clang_configuration.bzl Outdated Show resolved Hide resolved
Copy link
Contributor

@danakj danakj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jonmeow jonmeow added this pull request to the merge queue Nov 4, 2024
Merged via the queue into carbon-language:trunk with commit 9af06cc Nov 4, 2024
8 checks passed
@jonmeow jonmeow deleted the troubleshooting branch November 4, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or proposed change to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants