Last active
December 4, 2018 04:26
-
-
Save justbuchanan/73baf217a4c67b2f3d8ed53a12759476 to your computer and use it in GitHub Desktop.
Example of bazel analysis failure related to kythe's llvm setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/bazel-* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cc_binary( | |
name = "this_works", | |
srcs = ["main.cc"], | |
deps = ["@io_kythe//kythe/cxx/common:kythe_uri"], | |
) | |
# This fails bazel analysis because it can't find the compiled llvm libraries, | |
# which are built outside of bazel. This doesn't actually depend on anything | |
# llvm-related, but the kythe/cxx/extractor/BUILD file load()s the llvm BUILD | |
# file. The error looks like: | |
# | |
# ERROR: /home/justin/.cache/bazel/_bazel_justin/9739324307232adeb4820707e35a9597/external/io_kythe/third_party/llvm/BUILD:88:1: Traceback (most recent call last): | |
# File "/home/justin/.cache/bazel/_bazel_justin/9739324307232adeb4820707e35a9597/external/io_kythe/third_party/llvm/BUILD", line 88 | |
# cc_resources(name = "clang_builtin_headers_re...", ..."])) | |
# File "/home/justin/.cache/bazel/_bazel_justin/9739324307232adeb4820707e35a9597/external/io_kythe/tools/build_rules/cc_resources.bzl", line 11, in cc_resources | |
# fail(("Empty `data` attribute in `%s`...)) | |
# Empty `data` attribute in `clang_builtin_headers_resources` | |
# ERROR: /home/justin/.cache/bazel/_bazel_justin/9739324307232adeb4820707e35a9597/external/io_kythe/third_party/llvm/BUILD:21:1: Target '@io_kythe//third_party/llvm:llvm/build/lib/libclangFormat.a' contains an error and its package is in error and referenced by '@io_kythe//third_party/llvm:llvm' | |
cc_binary( | |
name = "this_doesnt", | |
srcs = ["main.cc"], | |
deps = ["@io_kythe//kythe/cxx/extractor:lib"], | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main(int argc, char **argv) { | |
std::cout << "Hello world" << std::endl; | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | |
git_repository( | |
name = "io_kythe", | |
commit = "9474b21c8f6685575a5690ad341bb8c965f72589", | |
remote = "https://github.com/kythe/kythe", | |
) | |
load("@io_kythe//:setup.bzl", "kythe_rule_repositories") | |
kythe_rule_repositories() | |
load("@io_kythe//:external.bzl", "kythe_dependencies") | |
kythe_dependencies() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment