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

[7.1.0] Add a profile span for building the upload manifest. #21184

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1325,32 +1325,35 @@ private Single<UploadManifest> buildUploadManifestAsync(
RemoteAction action, SpawnResult spawnResult) {
return Single.fromCallable(
() -> {
ImmutableList.Builder<Path> outputFiles = ImmutableList.builder();
// Check that all mandatory outputs are created.
for (ActionInput outputFile : action.getSpawn().getOutputFiles()) {
Symlinks followSymlinks = outputFile.isSymlink() ? Symlinks.NOFOLLOW : Symlinks.FOLLOW;
Path localPath = execRoot.getRelative(outputFile.getExecPath());
if (action.getSpawn().isMandatoryOutput(outputFile)
&& !localPath.exists(followSymlinks)) {
throw new IOException(
"Expected output " + prettyPrint(outputFile) + " was not created locally.");
try (SilentCloseable c = Profiler.instance().profile("build upload manifest")) {
ImmutableList.Builder<Path> outputFiles = ImmutableList.builder();
// Check that all mandatory outputs are created.
for (ActionInput outputFile : action.getSpawn().getOutputFiles()) {
Symlinks followSymlinks =
outputFile.isSymlink() ? Symlinks.NOFOLLOW : Symlinks.FOLLOW;
Path localPath = execRoot.getRelative(outputFile.getExecPath());
if (action.getSpawn().isMandatoryOutput(outputFile)
&& !localPath.exists(followSymlinks)) {
throw new IOException(
"Expected output " + prettyPrint(outputFile) + " was not created locally.");
}
outputFiles.add(localPath);
}
outputFiles.add(localPath);
}

return UploadManifest.create(
remoteOptions,
remoteCache.getCacheCapabilities(),
digestUtil,
action.getRemotePathResolver(),
action.getActionKey(),
action.getAction(),
action.getCommand(),
outputFiles.build(),
action.getSpawnExecutionContext().getFileOutErr(),
spawnResult.exitCode(),
spawnResult.getStartTime(),
spawnResult.getWallTimeInMs());
return UploadManifest.create(
remoteOptions,
remoteCache.getCacheCapabilities(),
digestUtil,
action.getRemotePathResolver(),
action.getActionKey(),
action.getAction(),
action.getCommand(),
outputFiles.build(),
action.getSpawnExecutionContext().getFileOutErr(),
spawnResult.exitCode(),
spawnResult.getStartTime(),
spawnResult.getWallTimeInMs());
}
});
}

Expand Down
Loading