diff --git a/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java b/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java index 2593a677a967d5..89f0da82b7a0ae 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java +++ b/src/main/java/com/google/devtools/build/lib/remote/ByteStreamBuildEventArtifactUploader.java @@ -63,6 +63,8 @@ class ByteStreamBuildEventArtifactUploader extends AbstractReferenceCounted implements BuildEventArtifactUploader { private static final Pattern TEST_LOG_PATTERN = Pattern.compile(".*/bazel-out/[^/]*/testlogs/.*"); + private static final Pattern BUILD_LOG_PATTERN = + Pattern.compile(".*/bazel-out/_tmp/actions/std(err|out)-.*"); private final Executor executor; private final ExtendedEventHandler reporter; @@ -216,14 +218,15 @@ private boolean shouldUpload(PathMetadata path) { path.getDigest() != null && !path.isRemote() && !path.isDirectory() && !path.isOmitted(); if (remoteBuildEventUploadMode == RemoteBuildEventUploadMode.MINIMAL) { - result = result && (isTestLog(path) || isProfile(path)); + result = result && (isLog(path) || isProfile(path)); } return result; } - private boolean isTestLog(PathMetadata path) { - return TEST_LOG_PATTERN.matcher(path.getPath().getPathString()).matches(); + private boolean isLog(PathMetadata path) { + return TEST_LOG_PATTERN.matcher(path.getPath().getPathString()).matches() + || BUILD_LOG_PATTERN.matcher(path.getPath().getPathString()).matches(); } private boolean isProfile(PathMetadata path) { diff --git a/src/test/shell/bazel/remote/remote_build_event_uploader_test.sh b/src/test/shell/bazel/remote/remote_build_event_uploader_test.sh index 2611ce305f434e..4ab18ea3ec6645 100755 --- a/src/test/shell/bazel/remote/remote_build_event_uploader_test.sh +++ b/src/test/shell/bazel/remote/remote_build_event_uploader_test.sh @@ -269,6 +269,29 @@ EOF expect_log "command.profile.gz.*bytestream://" || fail "should upload profile data" } +function test_upload_minimal_upload_buildlogs() { + mkdir -p a + cat > a/BUILD <& $TEST_log || true + + cat bep.json > $TEST_log + expect_log "stdout.*bytestream://" || fail "should upload stdout" + expect_log "stderr.*bytestream://" || fail "should upload stderr" + expect_log "command.profile.gz.*bytestream://" || fail "should upload profile data" +} + function test_upload_minimal_upload_profile() { mkdir -p a cat > a/BUILD <