-
Notifications
You must be signed in to change notification settings - Fork 4k
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
build-runfiles: remove temporary file prior to creating it #19241
Closed
EdSchouten
wants to merge
1
commit into
bazelbuild:master
from
EdSchouten:eschouten/20230814-runfiles-tempfile
Closed
build-runfiles: remove temporary file prior to creating it #19241
EdSchouten
wants to merge
1
commit into
bazelbuild:master
from
EdSchouten:eschouten/20230814-runfiles-tempfile
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
awaiting-review
PR is awaiting review from an assigned reviewer
label
Aug 14, 2023
sgowroji
added
the
team-Remote-Exec
Issues and PRs for the Execution (Remote) team
label
Aug 14, 2023
EdSchouten
force-pushed
the
eschouten/20230814-runfiles-tempfile
branch
from
August 14, 2023 14:53
4990fca
to
b718830
Compare
EdSchouten
added a commit
to EdSchouten/bazel
that referenced
this pull request
Aug 14, 2023
This change is the same in spirit to bazelbuild#19241. When using Bazel in combination with bb_clientd, bb_clientd may restore a copy of bazel-out/ from a snapshot. Files restored from the snapshot are not mutable, as they may be backed by other snapshots, a remote CAS, etc. etc. etc.. This change extends atomicallyWriteTo() to always write contents into a new file that is guaranteed to be writable. The logic that's added here is merely copy-pasted from what's already present at the bottom of the same function.
tjgq
requested changes
Aug 16, 2023
When building with Remote Output Service, bb_clientd has the ability to restore snapshots of previous bazel-out/ directories. Though the file contents of these snapshots are identical to what's created in the past, the files will be read-only. This is because the files may be shared by multiple snapshots. We have noticed that most of Bazel is fine with that. Most of the times Bazel is a good citizen, where it removes any files before recreating them. We did notice a very rare case where build-runfiles tries to make in-place modifications to a temporary file that it maintains. This change ensures that build-runfiles stops doing this.
EdSchouten
force-pushed
the
eschouten/20230814-runfiles-tempfile
branch
from
August 31, 2023 07:27
b718830
to
90d56d5
Compare
EdSchouten
added a commit
to EdSchouten/bazel
that referenced
this pull request
Aug 31, 2023
This change is the same in spirit to bazelbuild#19241. When using Bazel in combination with bb_clientd, bb_clientd may restore a copy of bazel-out/ from a snapshot. Files restored from the snapshot are not mutable, as they may be backed by other snapshots, a remote CAS, etc. etc. etc.. This change extends atomicallyWriteTo() to always write contents into a new file that is guaranteed to be writable. The logic that's added here is merely copy-pasted from what's already present at the bottom of the same function.
tjgq
approved these changes
Aug 31, 2023
tjgq
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
Aug 31, 2023
github-actions
bot
removed
the
awaiting-PR-merge
PR has been approved by a reviewer and is ready to be merge internally
label
Aug 31, 2023
@bazel-io flag |
bazel-io
added
the
potential release blocker
Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone
label
Aug 31, 2023
@bazel-io fork 6.4.0 |
bazel-io
removed
the
potential release blocker
Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone
label
Aug 31, 2023
This was referenced Aug 31, 2023
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Aug 31, 2023
When building with Remote Output Service, bb_clientd has the ability to restore snapshots of previous bazel-out/ directories. Though the file contents of these snapshots are identical to what's created in the past, the files will be read-only. This is because the files may be shared by multiple snapshots. We have noticed that most of Bazel is fine with that. Most of the times Bazel is a good citizen, where it removes any files before recreating them. We did notice a very rare case where build-runfiles tries to make in-place modifications to a temporary file that it maintains. This change ensures that build-runfiles stops doing this. Closes bazelbuild#19241. PiperOrigin-RevId: 561615005 Change-Id: I8ca95c7d35df8a53af8f632b10b4a6141d180631
iancha1992
pushed a commit
that referenced
this pull request
Aug 31, 2023
…19386) When building with Remote Output Service, bb_clientd has the ability to restore snapshots of previous bazel-out/ directories. Though the file contents of these snapshots are identical to what's created in the past, the files will be read-only. This is because the files may be shared by multiple snapshots. We have noticed that most of Bazel is fine with that. Most of the times Bazel is a good citizen, where it removes any files before recreating them. We did notice a very rare case where build-runfiles tries to make in-place modifications to a temporary file that it maintains. This change ensures that build-runfiles stops doing this. Closes #19241. Commit 357fc5f PiperOrigin-RevId: 561615005 Change-Id: I8ca95c7d35df8a53af8f632b10b4a6141d180631 Co-authored-by: Ed Schouten <eschouten@apple.com>
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. |
copybara-service bot
pushed a commit
that referenced
this pull request
Oct 6, 2023
This change is the same in spirit to #19241. When using Bazel in combination with bb_clientd, bb_clientd may restore a copy of bazel-out/ from a snapshot. Files restored from the snapshot are not mutable, as they may be backed by other snapshots, a remote CAS, etc. etc. etc.. This change extends atomicallyWriteTo() to always write contents into a new file that is guaranteed to be writable. The logic that's added here is merely copy-pasted from what's already present at the bottom of the same function. Closes #19243. PiperOrigin-RevId: 571276901 Change-Id: I3963ad6218e1557271c2bb4de94e89538ff512af
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When building with Remote Output Service, bb_clientd has the ability to restore snapshots of previous bazel-out/ directories. Though the file contents of these snapshots are identical to what's created in the past, the files will be read-only. This is because the files may be shared by multiple snapshots.
We have noticed that most of Bazel is fine with that. Most of the times Bazel is a good citizen, where it removes any files before recreating them. We did notice a very rare case where build-runfiles tries to make in-place modifications to a temporary file that it maintains. This change ensures that build-runfiles stops doing this.