0 votes

The scons incremental compilation does not appear to be working. (building main development trunk)

When I run:

scons platform=x11

and then run the same line again it appears to rebuild everything again.

Doesn't scons support incremental compilation? I would expect the second build to run very very fast. Is my build maybe broken?

Any suggestions would be greatly appreciated.

Thank you,


asked Nov 1, 2018 in Engine by StewartNJohnston (19 points)

On Windows, if I run SCons from scratch, it takes about 10 minutes to build. But the second time is a lot faster if nothing changed (about 10-20 seconds at most).
I don't know about X11 though.

2 Answers

0 votes

Incremental builds in Godot are likely less efficient than they could be, possibly because some files are including unnecessary headers (include-what-you-use could be used to optimize this).

There's still a few other ways to speed up incremental builds: installing ccache and using gold for linking, which can be done by adding LINKFLAGS="-fuse-ld=gold" at the end of the SCons command line.

Also, since this is related to engine development, I would advise opening an issue on Godot's GitHub repository.

answered Nov 2, 2018 by Calinou (6,336 points)
0 votes

I had the same problem, and found that there were a couple of environment variables that needed to be set.

One is SCONS_CACHE, which is a directory to store the cache in. e.g.

set SCONS_CACHE=c:\dev\godot\.scons_cache

That sort of works, but there's also a default 1GB cache size limit, which wasn't big enough. Fix that with:


(Obviously you can set these in the environment variables in the Windows advanced system settings window instead).

Having done that, mine now builds entirely from the cache if there's no changes.

answered Jan 13, 2019 by RobD6 (14 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.