Search Unity

Library cache being rebuilt every single time.

Discussion in 'Unity Cloud Build' started by Deozaan, Sep 30, 2015.

  1. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    I've got a few builds set up on the beta cloud build site and I've noticed that my builds are all taking about 50-90 minutes each time.

    I've noticed that every single build gives this message in the log:

    I suspect this is why it's taking so long. I can manually make builds myself (in the Editor on my PC) in a matter of just a few minutes, but having to rebuild the library (due to switching platforms, for example) can take a very long time.

    Am I doing something wrong that's causing the library cache to be erased every time?

    More info: This is a mercurial repository building from a non-default branch.
     
    tigerleapgorge likes this.
  2. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    Log into your project's page and make sure that the "Cache" setting is set to "Cache Library Directory".

    This setting isn't exposed on the build-beta website yet, so visit the base Cloud Build site: https://build.cloud.unity3d.com/ - find your project, go to the settings tab, click on "Edit Project Data".

    It should look like this: https://www.dropbox.com/s/zycxaivcipjtkle/Screenshot 2015-09-30 09.43.39.png?dl=0

    If that doesn't help, send me a direct message with a link to your project.

    Cheers,
    Patrick
     
  3. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    It's already configured that way. I've just sent you a PM with a link. Thanks!

    As an aside, it seems that on the beta site the cache library setting is visible in the individual Target "Basic Info" section. But as you said the ability to change the setting isn't exposed on the beta site.
     
  4. canexplode

    canexplode

    Joined:
    Sep 4, 2014
    Posts:
    2
    We have the same problem as described above. I've just sent you a PM as well.
     
    tigerleapgorge likes this.
  5. patrickc

    patrickc

    Unity Technologies

    Joined:
    Jan 23, 2015
    Posts:
    67
    Thanks, y'all. We're investigating.

    Cheers,
    Patrick
     
    tigerleapgorge likes this.
  6. unitychrism

    unitychrism

    Unity Technologies

    Joined:
    Sep 16, 2015
    Posts:
    122
    Deozaan/canexplode,

    Library cache retrieval/storage should work for these projects on the beta site now. You will need to successfully build a target for the library to be cached appropriately, from which point that cache will be retrieved/used for subsequent builds. You will note messages in your build log similar to the ones below when the cache has been successfully retrieved:

    21: Download of cache file library_latest5 finished, size is 45846939 bytes
    22: Library successfully restored from remote cache​

    Please let me know if you run into any issues.

    Regards,
    -Chris
     
    tigerleapgorge likes this.
  7. Deozaan

    Deozaan

    Joined:
    Oct 27, 2010
    Posts:
    707
    It seems to be working. Thanks!
     
  8. mmoczkowski

    mmoczkowski

    Joined:
    Oct 25, 2012
    Posts:
    6
    I have just encountered this issue. All my build logs say:

    > No Library cache found - ALL assets will be re-imported.

    They also restart frequently. It takes average of 2 hours!!!! to complete the build. This is killing my productivity and it's another time when Unity turned out to be very unreliable
     

    Attached Files:

    tigerleapgorge likes this.
  9. jacobgmartin

    jacobgmartin

    Joined:
    Sep 10, 2015
    Posts:
    37
    I have the same problem. The builds are set to use the Library Cache.

    Yet, three successive builds and the library cache is not found each time.


    I'm building against Unity 5.2.2f1.

    Here's some log stuff:

    4: BUILDJOB_CACHE=library
    15: BUILD_PLATFORM=standalonelinux64
    16: CLEANUP_WORKSPACE=true
    17: SANDBOX_BUILD_USER=true
    18: Calculated Workspace Size: 106.71 MiB
    19: PATH | SIZE
    20: /.vscode | 1.14 kiB
    21: /AssetBundles | 25.53 MiB
    22: /Assets | 81.08 MiB
    23: /ProjectSettings | 100.30 kiB
    24: postcheckoutstatus finished successfully.
    25: Added new build target 'default-linux-desktop-64-bit'
    26: Saved /BUILD_PATH/XXXX.languagersvp.default-linux-desktop-64-bit/build.json
    27: No Library cache found - ALL assets will be re-imported.
    28: * detecting buildpack... done
    29: = name: unity
    30: = display: Unity
    31: * compiling...
    32: + Environment config:
    33: LOG_VERBOSE=1
    34: BUILDCFG_TARGET=default-linux-desktop-64-bit
    35: ENABLE_LIBRARY_CACHE=1
    36: + Detecting Unity installation ...
    37: + Building with Unity installed at /UNITY_PATH/Unity/Unity-5_2_2f1/Unity.app/Contents/MacOS/Unity
    38: + Installing UnityCloud build tools
    39: Injecting custom Scripting Define Symbols 'UNITY_CLOUD_BUILD'
    40: + Switching Unity to target platform
    41: [Unity] Initialize mono
    42: [Unity] Mono path[0] = '/UNITY_PATH/Unity/Unity-5_2_2f1/Unity.app/Contents/Frameworks/Managed'
    43: [Unity] Mono path[1] = '/UNITY_PATH/Unity/Unity-5_2_2f1/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0'
    44: [Unity] Mono config path = '/UNITY_PATH/Unity/Unity-5_2_2f1/Unity.app/Contents/Frameworks/Mono/etc'
    45: [Unity] Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56343
    46: [Unity] BATCHMODE ARGUMENTS:
    47: [Unity] /UNITY_PATH/Unity/Unity-5_2_2f1/Unity.app/Contents/MacOS/Unity
    48: [Unity] -batchmode
    49: [Unity] -skipMissingProjectID
    50: [Unity] -skipMissingUPID
    51: [Unity] -projectPath
    52: [Unity] /BUILD_PATH/XXXX.languagersvp.default-linux-desktop-64-bit
    53: [Unity] -logFile
    54: [Unity] -buildconfig
    55: [Unity] -bvrbuildtarget
    56: [Unity] default-linux-desktop-64-bit
    57: [Unity] -buildTarget
    58: [Unity] standalonelinux64
    59: [Unity] -quit
    60: [Unity] Successfully changed project path to: /BUILD_PATH/XXXX.languagersvp.default-linux-desktop-64-bit
    61: [Unity] /BUILD_PATH/XXXX.languagersvp.default-linux-desktop-64-bit
    62: [Unity] Rebuilding Library because the asset database could not be found!
    63: [Unity] Audio: FMOD Profiler initialized on port 54900
    64: [Unity] Loading GUID <-> Path mappings...0.000057 seconds
    65: [Unity] Loading Asset Database...0.000009 seconds
    66: [Unity] AssetDatabase consistency checks...0.000118 seconds
    67: [Unity] Initialize engine version: 5.2.2f1 (3757309da7e7)

    Interestingly, at the end of each build the "Library" directory does not seem to be accessible from an "ls" command. Perhaps this is part the problem?

    publishing finished successfully.
    96522: postbuildstatus finished successfully.
    96523: ls: Library: Permission denied
    96524: Deleting project workspace...
    96525: Finished: SUCCESS
     
    tigerleapgorge likes this.
  10. midhapulkit28

    midhapulkit28

    Joined:
    Jan 18, 2019
    Posts:
    7
    This thread is from 2015, but I'm getting this error in 2020. Lol what?
    Wasn't this resolved?
    Also, how should I send you my project link?
     
  11. justincredibleg

    justincredibleg

    Joined:
    Jul 23, 2016
    Posts:
    12
    Did you ever get this sorted? Sorry to revive an ancient thread but I can’t seem to get this sorted either using the latest 2019 lts version of unity.
     
  12. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    459
    You can submit a support ticket for this if you have a project where it replicates. However I had a quick look through your projects and could not find any cases where this happened to you. Remember that you will not have a library cache if it is a clean build, your first build for a given build target, or if you are downgrading your Unity version from the previous build of that target.
     
  13. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    459
    I could not see any evidence that this has happened to you. Remember that this is intended behavior for a clean build or a new build target.
     
  14. gaps

    gaps

    Joined:
    Jan 1, 2014
    Posts:
    8
    @victorw Are you sure it is only when downgrading?

    This issue just happened to me after an upgrade.
    And not even an upgrade on my project, just an upgrade caused by the fact that Unity Cloud Build didn't have the most recent installation to match my ProjectVersion.txt at the moment that I made the first build.

    (I hope the issue is just due to the upgrade, since I just started using Unity Cloud Build and I have only made 2 builds so far. I will post an update once I make the third build.)

    My first successful build had this relevant logs:
    Code (csharp):
    1. 36: GIT: Current revision is 7ca2e2534c6c7e0c497579a04ba0796a0aa4be60
    2. 37: Detected last used Unity version from ProjectVersion.txt: 2020.3.1f1
    3. (...)
    4. 46: No Library cache found - ALL assets will be re-imported.
    5. 47:  + Building with Unity installed at /Volumes/2020_3_0f1/Unity.app/Contents/MacOS/Unity
    6. (...)
    7. 13258: Zipping cache files from Library
    8. 13259: done.
    9. 13260: publishing finished successfully.
    Notice how the it used the 2020_3_0f1 despite having 2020.3.1f1 defined in the ProjectVersion.txt, presumably because Unity Cloud Build still did not have the 2020.3.1f1 installed yet.

    And then the second build had this relevant logs:
    Code (csharp):
    1. 36: GIT: Current revision is a53ed698c543dc346f790264050309217d55d2a7
    2. 37: GIT: Get changeset between 7ca2e2534c6c7e0c497579a04ba0796a0aa4be60 and a53ed698c543dc346f790264050309217d55d2a7 (max 30)
    3. 38: Detected last used Unity version from ProjectVersion.txt: 2020.3.1f1
    4. (...)
    5. 47: No Library cache found - ALL assets will be re-imported.
    6. 48:  + Building with Unity installed at /Volumes/2020_3_1f1/Unity.app/Contents/MacOS/Unity
    7. (...)
    8. 15882: Zipping cache files from Library
    9. 15883: done.
    10. 15884: WARNING: Unity Version is different from previous build.
    11. 15885: publishing finished successfully.
    Notice how this time it used the 2020_3_1f1 which now matches the version defined in the ProjectVersion.txt.
    It still says no Library cache found.
    In the end issues a warning about the version being different from previous build.
     
  15. LUCID-Rob

    LUCID-Rob

    Joined:
    Jan 7, 2015
    Posts:
    29
    Are you sure you're not Mark Hamill ;)
     
unityunity