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

Bazel build and query invalidates cache #17914

Closed
jakeleventhal opened this issue Mar 29, 2023 · 3 comments
Closed

Bazel build and query invalidates cache #17914

jakeleventhal opened this issue Mar 29, 2023 · 3 comments
Assignees
Labels
more data needed P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug

Comments

@jakeleventhal
Copy link

jakeleventhal commented Mar 29, 2023

Description of the bug:

The cache seems to be invalidated upon each run when running on an aspect/rules_js js_run_devserver. local reproduction can be done without ibazel by running

bazel build <js_run_devserver_target>
bazel query <js_run_devserver_target>
bazel build <js_run_devserver_target>
bazel query <js_run_devserver_target>

The cache is invalidated between each of these commands. However, if i replace bazel query with bazel cquery, it seems to work just fine.

The analysis cache should not be discarded when running bazel query in this case. bazel cquery considers select statements but bazel query does not. That seems to be the cause.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

See above.

Which operating system are you running Bazel on?

macOS 13.3

What is the output of bazel info release?

release 6.1.0

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

bazelbuild/bazel-watcher#594

Any other information, logs, or outputs that you want to share?

No response

@gregestren
Copy link
Contributor

@sdtwigg for triage.

@sdtwigg
Copy link
Contributor

sdtwigg commented Aug 18, 2023

What does your bazelrc look like?

In bazelrc semantics, query does not inherit from build. (cquery does and you not seeing this behavior for cquery tempts me to think this is a bazelrc issue.)
You would need to either include an equivalent line for query for build lines (when the options are relevant).

If your Bazel version is after the work in #3054, you can now use common to enthusiastically apply options. (The old behavior of common was moved to always)

@sdtwigg sdtwigg added P2 We'll consider working on this in future. (Assignee optional) more data needed and removed untriaged labels Aug 18, 2023
@jakeleventhal jakeleventhal removed their assignment Aug 18, 2023
@jakeleventhal
Copy link
Author

I've moved off bazel for my project. It's going to be pretty difficult to reproduce. Best to assign to someone else or close the issue altogether.

@sdtwigg sdtwigg closed this as completed Aug 18, 2023
@brentleyjones brentleyjones closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more data needed P2 We'll consider working on this in future. (Assignee optional) team-Configurability platforms, toolchains, cquery, select(), config transitions type: bug
Projects
None yet
Development

No branches or pull requests

6 participants