You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some strange reason I am getting linking errors while running bazel run //:refresh_compile_commands. Prima facie it looks that I am doing something blatantly silly/stupid.
Would really appreciate if someone can point me in the right direction.
ls -lrt /usr/bin/ld
lrwxrwxrwx 1 root root 19 Jan 23 20:38 /usr/bin/ld -> x86_64-linux-gnu-ld
which ld
/usr/bin/ld
Here is my BUILD.bazel
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
buildifier(
name = "buildifier",
)
refresh_compile_commands(
name = "refresh_compile_commands",
# Specify the targets of interest.
# For example, specify a dict of targets and any flags required to build.
targets = {
"//base/...": "--config=dbg",
"//main/...": "--config=dbg",
"//workset_cache/...": "--config=dbg",
},
# No need to add flags already in .bazelrc. They're automatically picked up.
# If you don't need flags, a list of targets is also okay, as is a single target string.
# Wildcard patterns, like //... for everything, *are* allowed here, just like a build.
# As are additional targets (+) and subtractions (-), like in bazel query https://docs.bazel.build/versions/main/query.html#expressions
# And if you're working on a header-only library, specify a test or binary target that compiles it.
)
I am using WORKSPACE file. Here is the top of the file
workspace(name = "app0")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
http_archive(
name = "hedron_compile_commands",
sha256 = "1bb1d9ca4ad73d657defee62c28e6d704a3b7f9a763c849ae5bad600a7346fc6",
strip_prefix = "bazel-compile-commands-extractor-5bcb0bd8a917b2b48fb5dc55818515f4be3b63ff",
# Replace the commit hash in both places (below) with the latest, rather than using the stale one here.
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/5bcb0bd8a917b2b48fb5dc55818515f4be3b63ff.zip",
# When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'hedron_compile_commands' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
)
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
hedron_compile_commands_setup()
load("@hedron_compile_commands//:workspace_setup_transitive.bzl", "hedron_compile_commands_setup_transitive")
hedron_compile_commands_setup_transitive()
load("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive")
hedron_compile_commands_setup_transitive_transitive()
load("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive_transitive")
hedron_compile_commands_setup_transitive_transitive_transitive()
This is resolved if I do bazel run --action_env=CC=clang --verbose_failures --sandbox_debug //:refresh_compile_commands
My project is built using clang but atleast compilation for print_args shouldn't have any problem as gcc is also installed on my system and ld is at /usr/bin/ld
I am new to bazel and if someone can provide a oneliner, it would help in my understanding.
For some strange reason I am getting linking errors while running
bazel run //:refresh_compile_commands
. Prima facie it looks that I am doing something blatantly silly/stupid.Would really appreciate if someone can point me in the right direction.
ld is already present
ls -lrt /usr/bin/ld lrwxrwxrwx 1 root root 19 Jan 23 20:38 /usr/bin/ld -> x86_64-linux-gnu-ld
Here is my BUILD.bazel
I am using WORKSPACE file. Here is the top of the file
Bazel version
The text was updated successfully, but these errors were encountered: