bazel icon indicating copy to clipboard operation
bazel copied to clipboard

bazel config invalidated from no changes module lock file

Open darkrift opened this issue 1 year ago • 4 comments

Description of the bug:

While trying to use bazel-determinator with 7.1.2 or even 7.2.0rc3, it errors out saying ERROR: No configurations found. This can happen if the 'config' subcommand is used after files, including their metadata, have changed since the last invocation of another subcommand. Try running a 'build' or 'cquery' directly followed by 'config'.

Manually running cquery and config one after another yields the same result, but it works when --lockfile_mode=off is specified however git reports no changes for MODULE.bazel.lock.

It works with 7.0.0 but I need to run cquery twice before running bazel config

Which category does this issue belong to?

Core

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

No response

Which operating system are you running Bazel on?

MacOS and debian

What is the output of bazel info release?

release 7.1.2

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 HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

https://github.com/bazelbuild/bazel/issues/15738

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

No response

darkrift avatar Jun 09 '24 10:06 darkrift

Manually running cquery and config one after another yields the same result, but it works when --lockfile_mode=off is specified however git reports no changes for MODULE.bazel.lock.

Could you clarify this a bit further? By "yields the same result", do you mean it gives the same error message? And --lockfile_mode=off means we don't read or write the MODULE.bazel.lock file at all, so it makes sense that git reports no changes.

Wyverald avatar Jun 11 '24 18:06 Wyverald

I see a similar issue, perhaps:

bazel cquery //src/...
bazel config
ERROR: No configurations found. This can happen if the 'config' subcommand is used after files, including their metadata, have changed since the last invocation of another subcommand. Try running a 'build' or 'cquery' directly followed by 'config'
cat >> .bazelrc
common --lockfile_mode=off
Ctrl-D
bazel cquery //src/...
bazel config
<outputs around 20 configurations>

I am using bazel 7.3.1, windows.

peakschris avatar Oct 01 '24 18:10 peakschris

I think that this has been fixed by https://github.com/bazelbuild/bazel/commit/72066952b4d8a05ed2a348c04e170ad4610c6357. Could you check with USE_BAZEL_VERSION=rolling?

fmeum avatar Oct 02 '24 14:10 fmeum

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

github-actions[bot] avatar Dec 07 '25 01:12 github-actions[bot]