Make things easier to serialize: make constants constant, tag some lambdas. Get rid of a useless tag, because the Function being tagged is a concrete class, so won't be serializable. Will deal with it in a follow-up. Implement equality for BazelInfo.

PiperOrigin-RevId: 201199255
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java
index b22a3d6..91a26c2 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java
@@ -1061,9 +1061,12 @@
      * dependencies through this attribute.
      */
     public Builder<TYPE> aspect(NativeAspectClass aspect) {
-      return this.aspect(aspect, input -> AspectParameters.EMPTY);
+      return this.aspect(aspect, EMPTY_FUNCTION);
     }
 
+    @AutoCodec @AutoCodec.VisibleForSerialization
+    static final Function<Rule, AspectParameters> EMPTY_FUNCTION = input -> AspectParameters.EMPTY;
+
     public Builder<TYPE> aspect(SkylarkDefinedAspect skylarkAspect, Location location)
         throws EvalException {
       SkylarkRuleAspect skylarkRuleAspect = new SkylarkRuleAspect(skylarkAspect);