From 0352a590b806e23859857607a5981ec7d4bdacff Mon Sep 17 00:00:00 2001 From: Lukacs Berki Date: Thu, 25 Aug 2016 09:07:36 +0000 Subject: Add information about the key of conflicting actions to the error message in an effort to track down a spurious ActionConflictException. -- MOS_MIGRATED_REVID=131265803 --- .../google/devtools/build/lib/actions/MutableActionGraph.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java') diff --git a/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java b/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java index 637442dd4c..6eae2a3b67 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java +++ b/src/main/java/com/google/devtools/build/lib/actions/MutableActionGraph.java @@ -143,6 +143,12 @@ public interface MutableActionGraph extends ActionGraph { } } + private static String getKey(ActionAnalysisMetadata action) { + return action instanceof Action + ? ((Action) action).getKey() + : null; + } + // See also Actions.canBeShared() private static String suffix(ActionAnalysisMetadata a, ActionAnalysisMetadata b) { // Note: the error message reveals to users the names of intermediate files that are not @@ -161,6 +167,7 @@ public interface MutableActionGraph extends ActionGraph { addStringDetail(sb, "Configuration", aNull ? null : aOwner.getConfigurationChecksum(), bNull ? null : bOwner.getConfigurationChecksum()); addStringDetail(sb, "Mnemonic", a.getMnemonic(), b.getMnemonic()); + addStringDetail(sb, "Action key", getKey(a), getKey(b)); if ((a instanceof ActionExecutionMetadata) && (b instanceof ActionExecutionMetadata)) { addStringDetail( @@ -187,7 +194,7 @@ public interface MutableActionGraph extends ActionGraph { && bPrimaryInput != null && aPrimaryInput.toString().equals(bPrimaryInput.toString()))) { if (aPrimaryInput != bPrimaryInput) { - sb.append("Primary outputs are different objects: ") + sb.append("Primary inputs are different objects: ") .append(System.identityHashCode(aPrimaryInput)) .append(", ") .append(System.identityHashCode(bPrimaryInput)) -- cgit v1.2.3