Unified source builds and adding or removing files...

# Said Abou-Hallawa (a day ago)

I have been working on patches that require adding and removing cpp files from WebCore/Sources.txt. Almost every time I add or remove a file, I hit undefined symbol compilation error in some unrelated source or header file. Because a group of source files are compiled in one unified source file, some dependencies get hidden. The same symbol is defined in another source or header file. Once sources are moved to different unified sources, the problem gets uncovered.

For example the file svg/graphics/filters/filters/SVGFEImage.h uses the class TreeScope without forward declaring it or including its header file. Oddly the source file svg/graphics/filters/filters/SVGFEImage.cpp compiles in the trunk right now. If a file is added to or removed from WebCore/Sources.txt such that this source is moved to another unified source, the compiler will give an error that TreeScope is not defined.

Another example is trac.webkit.org/changeset/243137 which fixes a compilation error on GTK port. The same file was compiling fine on macOS but it failed on GTK.

Can we fix this issue? The fixes for such errors look very mysterious in the patches. It can also cause build breaks because the ports do not compile the same files.

One naive solution is to have the EWS bots compile without the unified source builds. In this case, all the header and source files must have the required forward declaration and/or the header file inclusion. So adding or removing files should not affect the ability to compile any other source file.

Thanks, Said

Contact us to advertise here
# Tim Horton (a day ago)

We already had this discussion; see the thread titled "Unified sources have broken our #include hygiene"

# Don.Olmstead at sony.com (12 hours ago)

The ability to toggle unified builds on and off was enabled in trac.webkit.org/changeset/239561/webkit . Immediately afterwards this bug was opened bugs.webkit.org/show_bug.cgi?id=193073 which needs to get resolved. We're open to adding a bot with ENABLE_UNIFIED_BUILDS=OFF if things compile.

From: webkit-dev <webkit-dev-bounces at lists.webkit.org> On Behalf Of Tim Horton

Sent: Tuesday, March 19, 2019 4:02 PM To: Said Abou-Hallawa <sabouhallawa at apple.com>

Cc: WebKit Development Mailing List <webkit-dev at lists.webkit.org>

Subject: Re: [webkit-dev] Unified source builds and adding or removing files...

We already had this discussion; see the thread titled "Unified sources have broken our #include hygiene"

On Mar 19, 2019, at 3:48 PM, Said Abou-Hallawa <sabouhallawa at apple.com<mailto:sabouhallawa at apple.com>> wrote:

I have been working on patches that require adding and removing cpp files from WebCore/Sources.txt. Almost every time I add or remove a file, I hit undefined symbol compilation error in some unrelated source or header file. Because a group of source files are compiled in one unified source file, some dependencies get hidden. The same symbol is defined in another source or header file. Once sources are moved to different unified sources, the problem gets uncovered.

For example the file svg/graphics/filters/filters/SVGFEImage.h uses the class TreeScope without forward declaring it or including its header file. Oddly the source file svg/graphics/filters/filters/SVGFEImage.cpp compiles in the trunk right now. If a file is added to or removed from WebCore/Sources.txt such that this source is moved to another unified source, the compiler will give an error that TreeScope is not defined.

Another example is trac.webkit.org/changeset/243137 which fixes a compilation error on GTK port. The same file was compiling fine on macOS but it failed on GTK.

Can we fix this issue? The fixes for such errors look very mysterious in the patches. It can also cause build breaks because the ports do not compile the same files.

One naive solution is to have the EWS bots compile without the unified source builds. In this case, all the header and source files must have the required forward declaration and/or the header file inclusion. So adding or removing files should not affect the ability to compile any other source file.

Thanks, Said

Want more features?

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