diff options
author | tomlu <tomlu@google.com> | 2018-04-10 08:21:38 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-10 08:22:44 -0700 |
commit | 62e99591c28a353fb1fe30991b4a9c148f857d06 (patch) | |
tree | 1cbef5cdde67fffd029a62352b36ee19bf6400fe /src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java | |
parent | 4245af9ce910c4d275274c3b64b86a3f73272415 (diff) |
Make SkylarkCustomCommandLine support efficient fingerprint calculation.
When using nested sets, we reuse sub-fingerprint computations by using the nested set key cache. map_each is supported.
All formats, before_each, join_with and so on are computed via adding a specific UUID to the fingerprint + the control string (eg. the format string) rather than performing the actual computation.
In legacy mode (existence of old map_fn), it falls back to trivial (and slow) fingerprint calculation.
RELNOTES: None
PiperOrigin-RevId: 192288783
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java index 7a3a79d116..44779236ae 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java @@ -13,6 +13,7 @@ // limitations under the License. package com.google.devtools.build.lib.analysis.skylark; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.actions.Action; @@ -850,6 +851,7 @@ public class SkylarkActionFactory implements SkylarkValue { return new String(latin1.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); } + /** Args module. */ @SkylarkModule( name = "Args", category = SkylarkModuleCategory.BUILTIN, @@ -879,7 +881,8 @@ public class SkylarkActionFactory implements SkylarkValue { + "# ]" + "</pre>" ) - static class Args extends SkylarkMutable { + @VisibleForTesting + public static class Args extends SkylarkMutable { private final Mutability mutability; private final SkylarkSemantics skylarkSemantics; private final SkylarkCustomCommandLine.Builder commandLine; |