forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only inject metadata for outputs that cannot be reconstructed by skyf…
…rame later Currently, they are symlinks. For other outputs, let skyframe read action file system to construct the metadata. Before this change, we inject metadata of symlink outputs, tree outputs and file outputs inside `RemoteActionFileSystem#flush()` if these outputs are stored inside the in-memory fs. If the outputs are somehow generated in the local fs, skyframe will read the fs later to construct metadata for them. However, for tree outputs, skyframe always create an empty directory before action execution in the in-memory fs. So inside the `flush`, we always inject metadata for it. It means local tree outputs are ignored. We could update the code to also read local file system when reading tree files, but then the problem is how to construct metadata from file status which is well done by skyframe. So instead of injecting metadata by traversal the filesystem inside `flush`, we just let skyframe to do the job. Fixes bazelbuild#16789. Closes bazelbuild#16812. PiperOrigin-RevId: 491622005 Change-Id: I10434e6856a1b2a207f39e07122a9b646edf518c
- Loading branch information
Showing
5 changed files
with
97 additions
and
50 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/google/devtools/build/lib/actions/RemoteFileStatus.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2022 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.google.devtools.build.lib.actions; | ||
|
||
import com.google.devtools.build.lib.actions.FileArtifactValue.RemoteFileArtifactValue; | ||
import com.google.devtools.build.lib.vfs.FileStatusWithDigest; | ||
|
||
/** | ||
* A FileStatus that exists remotely and provides remote metadata. | ||
* | ||
* <p>Filesystem may return implementation of this interface if the files are stored remotely. When | ||
* checking outputs of actions, Skyframe will inject the metadata returned by {@link | ||
* #getRemoteMetadata()} if the output file has {@link RemoteFileStatus}. | ||
*/ | ||
public interface RemoteFileStatus extends FileStatusWithDigest { | ||
RemoteFileArtifactValue getRemoteMetadata(); | ||
} |
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
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
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