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

Use bazel query to create a list of targets to index in compilation db. #1471

Closed
wants to merge 2 commits into from
Closed

Use bazel query to create a list of targets to index in compilation db. #1471

wants to merge 2 commits into from

Conversation

hzeller
Copy link
Collaborator

@hzeller hzeller commented Sep 20, 2022

We can't use bazel query from within bazel, so this file is created in a script separately. The file is checked-in, so whenever set of files change, we could use that in the CI to test if it has been kept up-to-date.

@hzeller hzeller marked this pull request as draft September 20, 2022 01:01
@hzeller
Copy link
Collaborator Author

hzeller commented Sep 20, 2022

I have no idea why this fails on the CI, I can't reproduce it locally, maybe bazel-export @QuantamHD can help.

All this is doing providing a wider range of files that the compilation database contains for use in clang-tidy or clangd for instance. But now some tests fail to compile with some bazel failure which looks like some internal disagreement of how a particular rule is built...

@hzeller
Copy link
Collaborator Author

hzeller commented Feb 17, 2023

Rebased this old PR and played around with it a bit more, but still the same issue. And only on Mac and Windows, so I can't test it locally

It sounds like it there are two internal bazel actions that are conflicting ?

More context: what happens in this change is a new file with all targets imported in the toplevel BUILD-file (the new file is generated with a bazel query).

All the rules running on Linux seem to work fine (this is all using bazel 4 to be compatible with the oldest active LTS bazel). Do I need to update some skylark/rules_cc/... update ?

@hzeller
Copy link
Collaborator Author

hzeller commented Feb 18, 2023

Issue narrowed down. It is in fact not a Windows or Mac problem but a bazel version >= 5 situation.
Documented in https://github.com/hzeller/bazel-filegroup-issue

(it showed here under Windows and Mac, because the CI uses bazel 6 for these platforms while it uses bazel 4 on Linux).

We can't use bazel query from within bazel, so this file is
created in a script separately. The file is checked-in, so
whenever set of files change, we could use that in the CI
to test if it has been kept up-to-date.

Signed-off-by: Henner Zeller <[email protected]>
@hzeller
Copy link
Collaborator Author

hzeller commented Feb 20, 2023

Underlying issue:
bazelbuild/bazel#14294

This is broken since bazel 5.0.0 and no fix yet in sight.

Since bazel is also not providing a way to generate a compilation database out of the box, having a working compilation database that also includes all test dependencies will not be possible with bazel >= 5 until there is a workaround for the above.

We can't use bazel query from within bazel, so this file is
created in a script separately. The file is checked-in, so
whenever set of files change, we could use that in the CI
to test if it has been kept up-to-date.

Signed-off-by: Henner Zeller <[email protected]>
@hzeller hzeller closed this Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant