Register `PackageSpecification.PackageGroupContents` for Skycache value-sharing
During Skycache frontier serialization, `PackageSpecification.PackageGroupContents` (and its generated `@AutoValue` subclass `AutoValue_PackageSpecification_PackageGroupContents`) was previously serialized inline via `DynamicCodec` whenever referenced by package visibility specifications or `NestedSet<PackageGroupContents>` nodes. Across a single build graph, 30,798 `PackageGroupContents` instances were serialized inline (despite only 2,861 unique instances), accounting for 3.14 MB (205,770 cumulative objects) of wire data.
This change:
- Annotates `PackageSpecification.PackageGroupContents` with `@AutoCodec` and adds a `@VisibleForSerialization @AutoCodec.Instantiator` factory method (`createForSerialization`) returning `AutoValue_PackageSpecification_PackageGroupContents`.
- Registers `PackageGroupContents.class` in `SerializationRegistrySetupHelpers.AUTOCODEC_CLASSES_FOR_VALUE_SHARING` so `PackageGroupContents` instances are deduplicated across Skyframe nodes via `ValueSharingAdapter`.
- Adds `PackageGroupTest.testPackageGroupContentsCodec` to verify round-trip serialization and reference-identity deduplication (`isSameInstanceAs`) with `SerializationRegistrySetupHelpers.analysisCachingCodecs()`.
Before:
```java
@AutoValue
public abstract static class PackageGroupContents
implements NestedSetsShouldBeInternedByEquality {
// Serialized inline via DynamicCodec without value-sharing across Skyframe nodes.
}
```
After:
```java
@AutoCodec
@AutoValue
public abstract static class PackageGroupContents
implements NestedSetsShouldBeInternedByEquality {
@VisibleForSerialization
@AutoCodec.Instantiator
static PackageGroupContents createForSerialization(...) {
return new AutoValue_PackageSpecification_PackageGroupContents(...);
}
}
```
PiperOrigin-RevId: 1008249881
Change-Id: I07a674af764898a5d48ce1ab98dc9fafca7ea709
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md