Handle the case where deploy_env causes partial extension information to be available to the extension registry generator.

With deploy_env, the message being extended may end up in the deploy_env binary's generated extension registry. However, the extension referencing that message is outside of deploy_env. For this case in the full runtime, we can synthesize the message as we don't need the loadPath (which is only used by lite runtime).


Rollback of commit 34de5d7d4a0678b3a4097cb7531fedb3ddb45983.

*** Reason for rollback ***

Rolling forward

*** Original change description ***

Automated [] rollback of commit fa7e34979b1a10794321b1233e8d6f44a62431fa.

--
PiperOrigin-RevId: 144346260
MOS_MIGRATED_REVID=144346260
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/proto/GeneratedExtensionRegistryProvider.java b/src/main/java/com/google/devtools/build/lib/rules/java/proto/GeneratedExtensionRegistryProvider.java
index 1c1e04e..9d7fac6 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/proto/GeneratedExtensionRegistryProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/proto/GeneratedExtensionRegistryProvider.java
@@ -18,6 +18,7 @@
 import com.google.common.base.Verify;
 import com.google.devtools.build.lib.actions.Artifact;
 import com.google.devtools.build.lib.analysis.TransitiveInfoProvider;
+import com.google.devtools.build.lib.cmdline.Label;
 import com.google.devtools.build.lib.collect.nestedset.NestedSet;
 import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
 
@@ -31,6 +32,9 @@
 @Immutable
 public abstract class GeneratedExtensionRegistryProvider implements TransitiveInfoProvider {
 
+  /** @return the rule label for which this registry was built. */
+  public abstract Label getGeneratingRuleLabel();
+
   /** @return if this registry was generated for lite or full runtime. */
   public abstract boolean isLite();
 
@@ -50,6 +54,10 @@
   /** A builder for {@link GeneratedExtensionRegistryProvider}. */
   @AutoValue.Builder
   public abstract static class Builder {
+
+    /** Sets the rule label for which this registry was built. */
+    public abstract Builder setGeneratingRuleLabel(Label label);
+
     /** Indicates this registry was built for lite runtime if <tt>true</tt>, full otherwise. */
     public abstract Builder setLite(boolean lite);