aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java
diff options
context:
space:
mode:
authorGravatar Michajlo Matijkiw <michajlo@google.com>2015-03-12 19:43:20 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-03-13 14:39:06 +0000
commit13459b4ee0e743da8f8416fc16bce64687f0c406 (patch)
tree2eb32207d9978f15aeeab9bfe048af3d0dd35859 /src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java
parent94588c2ceebca3328d3b84566306c91a8600fae6 (diff)
add baseline functionality for not saving unused artifacts
We define unused artifacts as those that aren't consumed by any action. This can be because an action produced more outputs than a dependent action needed, or because it's a top level artifact and we don't care about its contents, just that it was built without issue. Actions may prevent outputs from being discarded by declaring them as mandatory. This is particularly useful for test outputs. The motivation behind this change is to reduce storage overhead for things we can do without. It is worth noting this change doesn't cover all cases. In particular it has difficulty identifying *_binary artifacts as orphaned. This is due to the insertion of a virtual runfiles artifact which depends upon the rule's outputs. -- MOS_MIGRATED_REVID=88467504
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java b/src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java
index 3569f07a8b..64813aed07 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionMetadata.java
@@ -124,6 +124,14 @@ public interface ActionMetadata {
ImmutableSet<Artifact> getOutputs();
/**
+ * Returns the set of output Artifacts that are required to be saved. This is
+ * used to identify items that would otherwise be potentially identified as
+ * orphaned (not consumed by any downstream {@link Action}s and potentially
+ * discarded during the build process.
+ */
+ public ImmutableSet<Artifact> getMandatoryOutputs();
+
+ /**
* Returns the "primary" input of this action, if applicable.
*
* <p>For example, a C++ compile action would return the .cc file which is being compiled,