All script assemblies are always recompiled on project start-up (Desktop and CI)

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.)

1 Like

Unity2020.3.1
I’m having the same problem with my project.
When I start Unity, it recompiles all assemblies.
Do I need to do this every time?
Is there any way to avoid this?

1 Like

I’m having the same issue with my project. it imports everything everytime i load the editor - even when nothing was changed.

3 Likes

I seem to have the same issue as well, any news?