Addressables local bundles accumulate when doing successive builds

For a long time, I’ve been doing successive Unity builds using the same output path, expecting Unity to essentially overwrite the previous build. This has worked well, which was also confirmed with some testing (removing a scene or removing an asset from StreamingAssets also removes it in the build).

However, I’ve seen local addressables bundles accumulate in builds. Old bundles from previous builds remain in the StreamingAssets build folder and bloat up the build size over successive builds.

Since otherwise Unity prevents files in successive builds from accumulating and BuildOptions.AcceptExternalModificationsToPlayer is not set (even if it doesn’t apply to most platforms, as per the documentation), I assume this is a bug?

Maybe it was introduced with Addressables using the BuildPlayerContext.AddAdditionalPathToStreamingAssets API instead of copying assets into Assets/StreamingAssets and this somehow doesn’t track assets and clean them up if they’re removed?

I guess you could just delete the output directory for every build but this hasn’t been necessary and is really something that Unity should do automatically, if it’s required.