diff options
author | Janak Ramakrishnan <janakr@google.com> | 2016-11-17 17:01:46 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2016-11-17 18:18:46 +0000 |
commit | 5e9467320db2ceda40e55a5b4594c73d34ce479e (patch) | |
tree | 2c7fb97244b459650e4a083321411dc22156b0eb /src/main/java/com/google/devtools/build | |
parent | 2ca06f5beb9571215b12158d0dd945b72b00d38a (diff) |
Stop including the size of the action cache file in our crash message. I've never seen a case it was useful, and it adds to startup latency by putting a file stat on the critical path of every command.
--
MOS_MIGRATED_REVID=139467038
Diffstat (limited to 'src/main/java/com/google/devtools/build')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java index e437180d09..d6d0c485a6 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandEnvironment.java @@ -23,7 +23,6 @@ import com.google.common.eventbus.EventBus; import com.google.devtools.build.lib.actions.ActionInput; import com.google.devtools.build.lib.actions.PackageRootResolver; import com.google.devtools.build.lib.actions.cache.ActionCache; -import com.google.devtools.build.lib.actions.cache.CompactPersistentActionCache; import com.google.devtools.build.lib.analysis.BlazeDirectories; import com.google.devtools.build.lib.analysis.BuildView; import com.google.devtools.build.lib.analysis.SkyframePackageRootResolver; @@ -354,11 +353,10 @@ public final class CommandEnvironment { } /** - * An array of String values useful if Blaze crashes. - * For now, just returns the size of the action cache and the build id; the latter as - * soon as it is determined. + * An array of String values useful if Blaze crashes. For now, just returns the build id as soon + * as it is determined. */ - public String[] getCrashData() { + String[] getCrashData() { if (crashData == null) { String buildId; if (commandId == null) { @@ -366,11 +364,7 @@ public final class CommandEnvironment { } else { buildId = commandId + " (build id)"; } - crashData = new String[]{ - getFileSizeString(CompactPersistentActionCache.cacheFile(workspace.getCacheDirectory()), - "action cache"), - buildId, - }; + crashData = new String[] {buildId}; } return crashData; } @@ -382,14 +376,6 @@ public final class CommandEnvironment { } } - private static String getFileSizeString(Path path, String type) { - try { - return String.format("%d bytes (%s)", path.getFileSize(), type); - } catch (IOException e) { - return String.format("unknown file size (%s)", type); - } - } - /** * This method only exists for the benefit of InfoCommand, which needs to construct a {@link * BuildConfigurationCollection} without running a full loading phase. Don't add any more clients; |