Closed FantasqueX closed 2 months ago
Hi @FantasqueX! Thanks for giving the tool a whirl, and I'm sorry about the error. That's definitely an opaque one.
This looks like some bazel internal issue (that's Bazel erroring out with the ActionConflictException)--and unfortunately not one I've seen before. Looks like Bazel's trying to generate two conflicting actions for building your test/test_allocator.cpp
.
Here's what I'd recommend trying:
Thanks! Chris
Hi @FantasqueX! Thanks for giving the tool a whirl, and I'm sorry about the error. That's definitely an opaque one.
This looks like some bazel internal issue (that's Bazel erroring out with the ActionConflictException)--and unfortunately not one I've seen before. Looks like Bazel's trying to generate two conflicting actions for building your
test/test_allocator.cpp
.Here's what I'd recommend trying:
- Let's see how widespread this is. Could you try using a refresh_compile_commands target to specify just the top level target you most care about? How about if you specify that test? (Seems like Bazel should be handling this case, but this gets at whether it's bazel perhaps generating conflicting actions from different targets, since refresh_all tries to analyze all targets at once.)
- If that doesn't fix/surface things, would you be down to also try adding Bazelisk as bazel to your path ? This tool reinvokes Bazel inside itself, so there's some chance this is coming from two incompatible versions of bazel operating on the same cache or something.
Thanks! Chris
Hi @cpsauer! Thanks for your advice. I've tried to add two refresh_compile_commands targets, the most interest one and test. Both of them are generated successfully. However, I don't know why the "all" target doesn't work. Maybe it's a Bazel bug :(
Great to hear the progress! Hopefully that unblocks you!
Any chance you'd be down to report the underlying problem to Bazel, too? (please cc me) To simplify, I think we could take this tool out of the equation by trying to see if it reproduces with a bazel build //...
(I'm guessing two targets (transitively) create that action, and then bazel fails to merge or distinguish them.)
I figure out the problem. We use https://github.com/grailbio/bazel-compilation-database which adds a target in root package. The root package target needs "test". If I remove bazel-compilation-database, the problem disappears.
Oh, very interesting to know there's a clash. Thanks for reporting--I bet that'll help out a bunch of folks who run across this in the future!
When I executed
bazelisk run @hedron_compile_commands//:refresh_all
, I gotI have no idea how to solve the problem. Any suggestion is welcome. My hedron_compile_commands is at
a14ad3a64e7bf398ab48105aaa0348e032ac87f8