Skip to content

Commit

Permalink
Automated rollback of commit c7a4784.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

b/317338477

*** Original change description ***

1) handle output path mapping support for TreeArtfifact which is only relevant internally

2) the cl also addresses conflict with JavaCRIU implementation when BasicActionInput is also opted in for path stripping. For JavaCRIU, there are BasicActionInput with exec path like third_party/blaze_worker_snapshots/Javac/21874088937a06f2/pages-2.img. Such path would be mapped to third_party/cfg/Javac/21874088937a06f2/pages-2.img causing failures

PiperOrigin-RevId: 592839774
Change-Id: If1d655f70c8a4ea16bbde34451e3bdeb556d552b
  • Loading branch information
jin authored and copybara-github committed Dec 21, 2023
1 parent 71787cf commit 3127825
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private ActionInputHelper() {}
* implement equality via path comparison. Since file caches are keyed by ActionInput, equality
* checking does come up.
*/
public abstract static class BasicActionInput implements ActionInput {
private abstract static class BasicActionInput implements ActionInput {

// TODO(lberki): Plumb this flag from InputTree.build() somehow.
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.ActionInput;
import com.google.devtools.build.lib.actions.ActionInputHelper.BasicActionInput;
import com.google.devtools.build.lib.actions.Artifact.DerivedArtifact;
import com.google.devtools.build.lib.actions.CommandLineItem;
import com.google.devtools.build.lib.actions.CommandLineItem.ExceptionlessMapFn;
Expand Down Expand Up @@ -121,7 +120,7 @@ private static PathMapper create(
return new PathMapper() {
@Override
public String getMappedExecPathString(ActionInput artifact) {
if (isSupportedInputType(artifact) && isOutputPath(artifact, outputRoot)) {
if (artifact instanceof DerivedArtifact || artifact instanceof ParamFileActionInput) {
return strip(artifact.getExecPath()).getPathString();
} else {
return artifact.getExecPathString();
Expand Down Expand Up @@ -179,12 +178,6 @@ public ExceptionlessMapFn<Object> getMapFn(@Nullable String previousFlag) {
}
return MapFn.DEFAULT;
}

private boolean isSupportedInputType(ActionInput artifact) {
return artifact instanceof DerivedArtifact
|| artifact instanceof ParamFileActionInput
|| artifact instanceof BasicActionInput;
}
};
}

Expand Down Expand Up @@ -280,12 +273,6 @@ private static boolean isPathStrippable(
* Strips the configuration prefix from an output artifact's exec path.
*/
private static PathFragment strip(PathFragment execPath) {
if (execPath.subFragment(1, 2).getPathString().equals("tmp")) {
return execPath
.subFragment(0, 2)
.getRelative(FIXED_CONFIG_SEGMENT)
.getRelative(execPath.subFragment(3));
}
return execPath
.subFragment(0, 1)
// Keep the config segment, but replace it with a fixed string to improve cacheability while
Expand Down

0 comments on commit 3127825

Please sign in to comment.