Search Unity

Expose option to configure BundleBuildParameters.UseCache?

Discussion in 'Addressables' started by jonagill_rr, Feb 4, 2020.

  1. jonagill_rr

    jonagill_rr

    Joined:
    Jun 21, 2017
    Posts:
    54
    It appears there is an issue in Scriptable Build Pipeline where using the cache can actually take longer than building from scratch each time, causing subsequent builds to be multiple times longer than the first, un-cached build.

    This is documented in this bug: https://issuetracker.unity3d.com/is...680.990456455.1580785764-950652157.1564454244

    And reported in this thread: https://forum.unity.com/threads/ver...building-assetbundles-without-changes.762368/


    This is not an Addressables issue, but we are running into it with our Addressables builds. We'd love to just disable caching for now and build all our bundles from scratch, but AddressableAssetsBundleBuildParameters.cs hard-codes UseCache to true. Could this be set up to read from the AddressableAssetsSettings config file or some other publicly modifiable place?
     
  2. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    We'll check into that. In the meantime you might can just copy our BuildScriptPackedMode into a new script (called whatever you like) and then at the top of BuildDataImplementation add the lines

    Code (CSharp):
    1. AddressableAssetSettings.CleanPlayerContent(null);
    2. BuildCache.PurgeCache(false);
    I know this isn't exactly what you're asking for but maybe having a script that clears the cache before doing the build will still be faster than hitting that build cache bug.