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

--experimental_output_directory_naming_scheme=diff_against_baseline caused Bazel to rebuild whenever --run_under or --test_env change #18480

Closed
linzhp opened this issue May 23, 2023 · 11 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

@linzhp
Copy link
Contributor

linzhp commented May 23, 2023

Description of the bug:

When --experimental_output_directory_naming_scheme=diff_against_baseline, running --run_under echo or --test_env FOO=bar would invalidate the cache and rebuild everything. Bazel wouldn't rebuild if --experimental_output_directory_naming_scheme=diff_against_baseline is not given.

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

git clone git@github.com:bazelbuild/bazel-gazelle.git
cd bazel-gazelle
# populate the cache
bazel build --experimental_output_directory_naming_scheme=diff_against_baseline //cmd/gazelle
# This would rebuild everything.
bazel run --run_under echo --experimental_output_directory_naming_scheme=diff_against_baseline //cmd/gazelle
# This also rebuilds everything
bazel build --test_env FOO=bar --experimental_output_directory_naming_scheme=diff_against_baseline //cmd/gazelle

Which operating system are you running Bazel on?

macOS and Linux

What is the output of bazel info release?

release 6.2.0-homebrew

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?

No response

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

No response

@fmeum
Copy link
Collaborator

fmeum commented May 23, 2023

Cc @gregestren @sdtwigg

@gregestren gregestren added the team-Configurability platforms, toolchains, cquery, select(), config transitions label May 23, 2023
@fmeum
Copy link
Collaborator

fmeum commented May 23, 2023

@linzhp linzhp changed the title --experimental_output_directory_naming_scheme=diff_against_baseline caused Bazel to rebuild whenever --run_under changes --experimental_output_directory_naming_scheme=diff_against_baseline caused Bazel to rebuild whenever --run_under or --test_env change May 24, 2023
@gregestren
Copy link
Contributor

@sdtwigg for priority triage.

@aiuto aiuto added the P2 We'll consider working on this in future. (Assignee optional) label Aug 18, 2023
@sdtwigg
Copy link
Contributor

sdtwigg commented Aug 18, 2023

Do you still see this behavior when using diff_against_dynamic_baseline?

This is a bit peculiar as I would not expected a difference in analysis behavior due to that flag. In particular changes to either run_under and test_env would invalidate the analysis cache regardless of the setting of experimental_output_directory_naming_scheme.

Are you consistently seeing analysis cache discards but a difference in action cache behavior? If so, changing to diff_against_dynamic_baseline should fix the issue. (Technically, only for actions after an exec transition but actions before one should not have been exhibiting that issue anyways.)

@linzhp
Copy link
Contributor Author

linzhp commented Aug 19, 2023

#18561 fixes this issue

@fmeum
Copy link
Collaborator

fmeum commented Aug 25, 2023

@sdtwigg Based on #18480 (comment), could we proceed with the merge of #18561?

@sdtwigg
Copy link
Contributor

sdtwigg commented Aug 25, 2023

Yes, this looks all together now and was hoping to do the merge today or so.

@fmeum
Copy link
Collaborator

fmeum commented Sep 13, 2023

@bazel-io flag

@fmeum
Copy link
Collaborator

fmeum commented Sep 13, 2023

Cherry-picked in #19514

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Sep 13, 2023
@iancha1992
Copy link
Member

@bazel-io fork 6.4.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Sep 13, 2023
@iancha1992
Copy link
Member

A fix for this issue has been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks!

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

Successfully merging a pull request may close this issue.

9 participants