Skip to content

Commit

Permalink
Drop Filesets from artifact groups, as we can never construct a valid…
Browse files Browse the repository at this point in the history
… pointer to them.

PiperOrigin-RevId: 227165800
  • Loading branch information
ericfelly authored and Copybara-Service committed Dec 28, 2018
1 parent 21c2582 commit 2765ca4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ public Iterable<Artifact> getLegacyFilteredImportantArtifacts() {
}
return Iterables.filter(
builder.build(),
(artifact) -> !artifact.isSourceArtifact() && !artifact.isMiddlemanArtifact());
(artifact) ->
!artifact.isSourceArtifact()
&& !artifact.isMiddlemanArtifact()
&& !artifact.isFileset());
}

@Override
Expand Down Expand Up @@ -309,13 +312,17 @@ public Collection<LocalFile> referencedLocalFiles() {
for (ArtifactsInOutputGroup group : outputs) {
if (group.areImportant()) {
for (Artifact artifact : group.getArtifacts()) {
builder.add(new LocalFile(pathResolver.toPath(artifact), LocalFileType.OUTPUT));
if (!artifact.isFileset()) {
builder.add(new LocalFile(pathResolver.toPath(artifact), LocalFileType.OUTPUT));
}
}
}
}
if (baselineCoverageArtifacts != null) {
for (Artifact artifact : baselineCoverageArtifacts) {
builder.add(new LocalFile(pathResolver.toPath(artifact), LocalFileType.OUTPUT));
if (!artifact.isFileset()) {
builder.add(new LocalFile(pathResolver.toPath(artifact), LocalFileType.OUTPUT));
}
}
}
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Collection<LocalFile> referencedLocalFiles() {
// This has to be consistent with the code below.
ImmutableList.Builder<LocalFile> artifacts = ImmutableList.builder();
for (Artifact artifact : view.directs()) {
if (artifact.isMiddlemanArtifact()) {
if (artifact.isMiddlemanArtifact() || artifact.isFileset()) {
continue;
}
artifacts.add(new LocalFile(pathResolver.toPath(artifact), LocalFileType.OUTPUT));
Expand All @@ -78,7 +78,7 @@ public BuildEventStreamProtos.BuildEvent asStreamProto(BuildEventContext convert
BuildEventStreamProtos.NamedSetOfFiles.newBuilder();
for (Artifact artifact : view.directs()) {
// We never want to report middleman artifacts. They are for internal use only.
if (artifact.isMiddlemanArtifact()) {
if (artifact.isMiddlemanArtifact() || artifact.isFileset()) {
continue;
}
String name = artifact.getRootRelativePathString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ public ArtifactPathResolver createPathResolverForArtifactValues(
Preconditions.checkState(shouldCreatePathResolverForArtifactValues());
return outputService.createPathResolverForArtifactValues(
directories.getExecRoot().asFragment(),
directories.getRelativeOutputPath(),
fileSystem,
getPathEntries(),
actionInputMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ default boolean supportsPathResolverForArtifactValues() {

default ArtifactPathResolver createPathResolverForArtifactValues(
PathFragment execRoot,
String relativeOutputPath,
FileSystem fileSystem,
ImmutableList<Root> pathEntries,
ActionInputMap actionInputMap,
Expand Down

0 comments on commit 2765ca4

Please sign in to comment.