Incremental unified builds on macOS

# Ken Russell (2 days ago)

Building WebKit on macOS, if I modify just one .cpp file, many files are rebuilt in response - far more than just the single unified source file which includes that .cpp file. Because of this, incremental rebuilds are on the order of 5 minutes, which is painful when trying to add logging to narrow down a bug.

As one example, I added a printf to Source/WebCore/platform/graphics/cocoa/GraphicsContext3DCocoa.mm and ran:

./Tools/Scripts/build-webkit --debug > build-log.txt

The resulting build log is here:

drive.google.com/file/d/1dsFB_Vp731TlfuUOxpRhKpLHfOlxBKvu/view?usp=sharing

There are no files in the repo with modification times in the future.

Does anyone have an idea why this might be happening?

Thanks,

Contact us to advertise here
# Darin Adler (2 days ago)

It’s unlikely the problem is due to unified builds, since those are just source files with includes in them.

But I have encountered problems like this before; sometimes they are things affecting lots of people and I’ve been able to fix them. When trying to understand causes of this kind of problem in the past, an Xcode build system feature that Dan Bernstein told me about was really useful. To use it you can type this command:

% defaults write com.apple.dt.Xcode ExplainWhyBuildCommandsAreRun -bool YES

Then rebuild and the log will contain additional information about each build step.

Good luck and please let us know what you find!

— Darin

PS: That should work for now since WebKit still uses the “legacy Xcode build system” but I hear it won’t work once we move to the modern build system.

# Ken Russell (2 days ago)

Thanks Darin for the tip. The extra logging contained exactly what I needed and I'm embarrassed to say this is something I broke recently. Filed bugs.webkit.org/show_bug.cgi?id=199212 and working on fixing it now.

Want more features?

Request early access to our private beta of readable email premium.