From 2a3ab5c45b42321cf1495be7e294e5ec01298ca1 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 22 Mar 2023 07:25:08 -0700 Subject: [PATCH] Enable heuristically dropping GENQUERY_SCOPE nodes These are often not used after their parent genquery's configured target value is evaluated. PiperOrigin-RevId: 518561737 Change-Id: Ic76aab06be17674ed4e3bb574299b5abceb82d70 --- .../devtools/build/lib/rules/genquery/BUILD | 17 ++++++++---- .../GenQueryDirectPackageProviderFactory.java | 2 +- .../google/devtools/build/lib/skyframe/BUILD | 3 ++- .../NodeDroppingInconsistencyReceiver.java | 17 +++++++----- .../build/lib/skyframe/SkyframeExecutor.java | 26 +++++++++++++++++++ 5 files changed, 52 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD b/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD index 1c38ded65c24aa..a3fc23535a0e61 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD +++ b/src/main/java/com/google/devtools/build/lib/rules/genquery/BUILD @@ -17,11 +17,11 @@ java_library( name = "genquery", srcs = [ "GenQuery.java", - "GenQueryConfiguration.java", "GenQueryOutputStream.java", "GenQueryRule.java", ], deps = [ + ":genquery_configuration", ":genquery_package_providers", "//src/main/java/com/google/devtools/build/lib:keep-going-option", "//src/main/java/com/google/devtools/build/lib/actions", @@ -29,10 +29,7 @@ java_library( "//src/main/java/com/google/devtools/build/lib/analysis:actions/abstract_file_write_action", "//src/main/java/com/google/devtools/build/lib/analysis:actions/deterministic_writer", "//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster", - "//src/main/java/com/google/devtools/build/lib/analysis:config/build_options", "//src/main/java/com/google/devtools/build/lib/analysis:config/core_options", - "//src/main/java/com/google/devtools/build/lib/analysis:config/fragment", - "//src/main/java/com/google/devtools/build/lib/analysis:config/fragment_options", "//src/main/java/com/google/devtools/build/lib/analysis:configured_target", "//src/main/java/com/google/devtools/build/lib/analysis:rule_definition_environment", "//src/main/java/com/google/devtools/build/lib/cmdline", @@ -64,6 +61,17 @@ java_library( ], ) +java_library( + name = "genquery_configuration", + srcs = ["GenQueryConfiguration.java"], + deps = [ + "//src/main/java/com/google/devtools/build/lib/analysis:config/build_options", + "//src/main/java/com/google/devtools/build/lib/analysis:config/fragment", + "//src/main/java/com/google/devtools/build/lib/analysis:config/fragment_options", + "//src/main/java/com/google/devtools/common/options", + ], +) + java_library( name = "genquery_package_providers", srcs = [ @@ -76,7 +84,6 @@ java_library( "//src/main/java/com/google/devtools/build/lib/bugreport", "//src/main/java/com/google/devtools/build/lib/cmdline", "//src/main/java/com/google/devtools/build/lib/collect/nestedset", - "//src/main/java/com/google/devtools/build/lib/concurrent", "//src/main/java/com/google/devtools/build/lib/events", "//src/main/java/com/google/devtools/build/lib/packages", "//src/main/java/com/google/devtools/build/lib/pkgcache", diff --git a/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryDirectPackageProviderFactory.java b/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryDirectPackageProviderFactory.java index 835c6cc3e6b993..4bc2cde2a9053a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryDirectPackageProviderFactory.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQueryDirectPackageProviderFactory.java @@ -72,7 +72,7 @@ public class GenQueryDirectPackageProviderFactory implements GenQueryPackageProv * rules sharing the same scope will require only one scope traversal to occur. */ @AutoCodec - static class Key extends AbstractSkyKey.WithCachedHashCode> { + public static class Key extends AbstractSkyKey.WithCachedHashCode> { private static final SkyKeyInterner interner = SkyKey.newInterner(); private Key(ImmutableList