Automated rollback of commit
*** Reason for rollback ***
Breaks non-Rabbit builds, see b/111275650.
*** Original change description ***
Avoid long, duplicated directory structures. In the common case, generated
files are going to be beneath the target that generates them. In this case,
don't duplicated the package's path.
RELNOTES: None.
@@ -592,16 +592,8 @@ public class CppHelper {
private static Artifact getIncludesOutput(RuleContext ruleContext, Artifact src) {
Preconditions.checkArgument(!src.isSourceArtifact(), src);
- PathFragment pkgPath = ruleContext.getLabel().getPackageFragment();
- PathFragment fileName = src.getRootRelativePath();
- if (fileName.startsWith(pkgPath)) {
- // In most cases actions grep the includes of files that they create and that are located
- // within their own package. In this case, don't duplicate the package path underneath the
- // actions genfiles directory.
- fileName = fileName.relativeTo(pkgPath);
- }
return ruleContext.getGenfilesArtifact(
- fileName.replaceName(src.getFilename() + GREPPED_INCLUDES_SUFFIX));
+ src.getRootRelativePath().replaceName(src.getFilename() + GREPPED_INCLUDES_SUFFIX));
}
/**
