Open jacattrongnlh opened 1 year ago
Excellent suggestion. We really need to look into this!
I've tried implementing the cache of the Build folder to see if it was sufficient, but in my experiment, Unity still did a full build instead of incremental build. I've checked the runner's storage with ls
and the Build folder did get cached and extracted properly. I don't know if I'm missing something.
.library-cache: &library-cache
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME"
paths:
- $UNITY_DIR/Library/
.builds-cache: &builds-cache
key: "$CI_PROJECT_NAMESPACE-$CI_PROJECT_NAME-builds"
paths:
- $UNITY_DIR/Builds/
.cache: &cache
cache:
- <<: *builds-cache
- <<: *library-cache
This is for .gitlab-ci.yml, I'm running this on a runner for a repo on gitlab
Any updates on this?
Context
Unity has this incremental building for IL2CPP that allow faster build:
So in Unity 2021, after an APK finished building, it generates some additional folders in the build target directory:
(file name)_BackUpThisFolder_ButDontShipItWithYourGame
and(file name)_BurstDebugInformation_DoNotShip
. In subsequent build, if Unity builds to the same directory that contains files from the previous build (the APK and the 2 ...DoNotShip folders), the incremental build will only recompile files that have changed, resulting in much faster build.Suggested solution
Please add the features that cache build directory in addition to caching the Library folder.
Considered alternatives
I don't have enough knowledge about CI to make my own solution yet.
Additional details
https://docs.unity3d.com/2020.1/Documentation/Manual/IL2CPP-OptimizingBuildTimes.html