When starting a Unity 2020.3.15f project on Linux, both locally on my GNOME desktop, as well as in CI using GameCI’s container images on GitLab CI, all my scripts appear to always be recompiled on startup. I always see this in the Editor log:
[ScriptCompilation] Recompiling all scripts because: InitialRefresh: Cached user assemblies were invalid
- Starting script compilation
After this it proceeds to recompile all assemblies (“DLLs”), including my main Scripts assembly, which takes around 12 seconds in my small-size project every time. In CI, it eats up around 90 seconds every time (and I currently need to invoke Unity twice there to get NuGetForUnity to restore its packages properly).
I also see this behavior in GitLab CI, even in cases where a single job is invoking Unity twice, which is slowing down the pipeline.
(This behaviour may also occur on Windows and macOS, I have not tested this.)