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
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-extractorhttp_archive(
name="hedron_compile_commands",
sha256="c8029e92da302f0a32fd0d4059358c8657b5cb82628000b7b5e259c73f91882d",
strip_prefix="bazel-compile-commands-extractor-4f28899228fb3ad0126897876f147ca15026151e",
# 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/4f28899228fb3ad0126897876f147ca15026151e.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()
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.
)
Any ideas how to fix this? It was working last time I checked in March 2024
The text was updated successfully, but these errors were encountered:
Since it was working 6 months ago, I thought may be upgrading bazel caused this(bazelisk automatically upgrades bazel)
Hence
Fixed this by downgrading bazel(to a random value - no binary search was done) by adding a file .bazelversion in the repo with the following content
7.1.0# NOTE: 8 Oct 2024, refresh_compile_commands are failing, hence downgrading bazel
This fixed the problem. Don't know what to make of it.
[UPDATE]
I did some binary search and seems like 7.1.2 is the last working version. Issue started with 7.2.0rc1
I believe the issue was reported #199 and may be fixed by #219
Problem
Bazel Version
OS Details
cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=24.04 DISTRIB_CODENAME=noble DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
WORKSPACE file (stripped)
base/BUILD.bazel file
BUILD.bazel in repository root
Any ideas how to fix this? It was working last time I checked in March 2024
The text was updated successfully, but these errors were encountered: