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

Add the --experimental_remote_require_cached flag #18942

Closed
wants to merge 1 commit into from

Conversation

jmmv
Copy link
Contributor

@jmmv jmmv commented Jul 14, 2023

When set to true, this flag causes Bazel to abort the build whenever it encounters an action that is not cached.

This is very useful when trying to troubleshoot action caching issues across machines because it allows running a build on one and having it fail on another as soon as there is a problem without tainting what already exists in the cache.

My workflow is to essentially do:

  1. Machine 1: bazel clean
  2. Machine 1: bazel build ...
  3. Machine 2: bazel clean
  4. Machine 2: bazel build --experimental_remote_require_cached ...

which makes step 4 fail on the first action that wasn't cached as expected. Then I can address that problem and re-run step 4 to encounter the next issue.

@jmmv jmmv marked this pull request as ready for review July 14, 2023 16:31
@jmmv jmmv requested a review from a team as a code owner July 14, 2023 16:31
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Jul 14, 2023
@jmmv jmmv force-pushed the remote-require-cached branch from 1a60a39 to 3e8618b Compare July 17, 2023 20:52
@jmmv
Copy link
Contributor Author

jmmv commented Jul 17, 2023

I've updated the description of the PR as well as the one in the commit (which required a force-push) to more clearly explain how this flag is useful. I don't think the original thing I wrote made a lot of sense.

When set to true, this flag causes Bazel to abort the build whenever it
encounters an action that is not cached.

This is very useful when trying to troubleshoot action caching issues
across machines because it allows running a build on one and having it
fail on another as soon as there is a problem without tainting what
already exists in the cache.

My workflow is to essentially do:

1. Machine 1: bazel clean
2. Machine 1: bazel build ...
3. Machine 2: bazel clean
4. Machine 2: bazel build --experimental_remote_require_cached ...

which makes step 4 fail on the first action that wasn't cached as
expected. Then I can address that problem and re-run step 4 to
encounter the next issue.
@jmmv jmmv force-pushed the remote-require-cached branch from 3e8618b to 7df859a Compare July 17, 2023 20:58
Copy link
Member

@coeuvre coeuvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@coeuvre coeuvre added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jul 18, 2023
@brentleyjones brentleyjones changed the title Add the remote_require_cached flag Add the --experimental_remote_require_cached flag Jul 18, 2023
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jul 19, 2023
@brentleyjones
Copy link
Contributor

@bazel-io flag

@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 Jul 25, 2023
@keertk
Copy link
Member

keertk commented Jul 25, 2023

@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 Jul 25, 2023
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Jul 25, 2023
When set to true, this flag causes Bazel to abort the build whenever it encounters an action that is not cached.

This is very useful when trying to troubleshoot action caching issues across machines because it allows running a build on one and having it fail on another as soon as there is a problem without tainting what already exists in the cache.

My workflow is to essentially do:

1. Machine 1: bazel clean
2. Machine 1: bazel build ...
3. Machine 2: bazel clean
4. Machine 2: bazel build --remote_require_cached ...

which makes step 4 fail on the first action that wasn't cached as expected. Then I can address that problem and re-run step 4 to encounter the next issue.

Closes bazelbuild#18942.

PiperOrigin-RevId: 549242966
Change-Id: Ib46a2eb8cce6f4444968882e99c21284fc6bc4f8
iancha1992 added a commit that referenced this pull request Jul 26, 2023
When set to true, this flag causes Bazel to abort the build whenever it encounters an action that is not cached.

This is very useful when trying to troubleshoot action caching issues across machines because it allows running a build on one and having it fail on another as soon as there is a problem without tainting what already exists in the cache.

My workflow is to essentially do:

1. Machine 1: bazel clean
2. Machine 1: bazel build ...
3. Machine 2: bazel clean
4. Machine 2: bazel build --remote_require_cached ...

which makes step 4 fail on the first action that wasn't cached as expected. Then I can address that problem and re-run step 4 to encounter the next issue.

Closes #18942.

PiperOrigin-RevId: 549242966
Change-Id: Ib46a2eb8cce6f4444968882e99c21284fc6bc4f8

Co-authored-by: Julio Merino <[email protected]>
@iancha1992
Copy link
Member

The changes in this PR have been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants