List items

Items from the current list are shown below.


25 Aug 2023 : Day 9 #
In yesterday's post we talked about a range of different issues, from checksums to defines, ultimately finishing off with a discussion about software archaeology. We'll need to dig through more software detritus in the future too.

A few errors follow in the build this time.
15:26.27 ${PROJECT}/gfx/cairo/cairo/src/cairo-qt-surface.cpp:65:10: fatal error:
         QWidget: No such file or directory
15:26.27  #include 
15:26.27           ^~~~~~~~~
15:26.27 compilation terminated.
Since QWidget is definitely a thing, this should be straightforward to fix. But there are more errors later in the output.
17:14.68 In file included from ${PROJECT}/../obj-build-mer-qt-xr/dist/include/cairo/cairo-ft.h:46,
17:14.68                  from ${PROJECT}/../obj-build-mer-qt-xr/dist/system_wrappers/cairo-ft.h:3,
17:14.68                  from ${PROJECT}/../obj-build-mer-qt-xr/dist/include/mozilla/gfx/UnscaledFontFreeType.h:10,
17:14.68                  from ${PROJECT}/gfx/thebes/gfxFT2FontBase.h:13,
17:14.69                  from ${PROJECT}/gfx/thebes/gfxFT2FontBase.cpp:6:
17:14.69 ${PROJECT}/../obj-build-mer-qt-xr/dist/system_wrappers/ft2build.h:3:15: fatal error:
         ft2build.h: No such file or directory
17:14.69  #include_next 
17:14.69                ^~~~~~~~~~~~
17:14.69 compilation terminated.
Another apparently missing header file. It's worth noting that with my configuration the build is running with 16 threads at a time. If these errors came from the same thread then they could be related (meaning that one error is a consequence of the other). But equally they may have come from different threads, in which case they're likely to be totally unrelated. I'm using 16 threads because it makes the build faster, but it does also add some additional uncertainty to the debugging. There's a third error as well.
 2:26.53 ${PROJECT}/image/decoders/icon/qt/nsIconChannel.cpp: In function
         ‘nsresult moz_qicon_to_channel(QImage*, nsIURI*, nsIChannel**)’:
 2:26.54 ${PROJECT}/image/decoders/icon/qt/nsIconChannel.cpp:101:35: error:
         ‘NS_LITERAL_CSTRING’ was not declared in this scope
 2:26.54                                    NS_LITERAL_CSTRING(IMAGE_ICON_MS));
 2:26.54                                    ^~~~~~~~~~~~~~~~~~
Not directly header related, but it could be if, for example, this is a define that's coming from one of the missing headers. This will need investigation.

Since it's not immediately clear whether they're related, I figure it's probably best to look at them separately, starting with the first of them as they appeared in the logs.

To reiterate, the error suggests that the QWidget header file can't be found. Looking at the Qt5 include structures, the header is contained in the QtWidgets folder, and indeed by changing the include to use QtWidgets/QWidget instead of just QWidget does seem to address this particular issue.

It doesn't fix the ft2build.h error though; the compiler still can't find this header. A quick search of the Web shows this header comes from freetype2. Somewhere in the code we should be seeing a freetype2 include folder, something like /usr/include/freetype2 being added to the build flags.

In the ESR 78 code this is referenced in the following file:
Oddly this isn't a file that exists in the ESR 91 codebase. It's not clear why — maybe it'll become clear later — but in the meantime we need to find another way to add this include as a build parameter.

A quick and somewhat dirty solution is to add it to the CFLAGS export in embedding/embedlite/config/mozconfig.merqtxulrunner. Adding that in seems to have a positive effect. There is almost certainly a better place to put this, but that'll do for now, it can all be finessed later.
export CFLAGS="-O3 -I/usr/include/freetype2"
export CXXFLAGS="-O3 -I/usr/include/freetype2"
After building with these changes the errors now also change slightly, so that the next failure is the following:
18:06.85 In file included from ${PROJECT}/gfx/thebes/gfxFcPlatformFontList.cpp:44:
18:06.85 ${PROJECT}/gfx/thebes/gfxQtPlatform.h:11:10: fatal error:
         nsDataHashtable.h: No such file or directory
18:06.85  #include "nsDataHashtable.h"
18:06.85           ^~~~~~~~~~~~~~~~~~~
18:06.85 compilation terminated.
In the ESR 78 codebase the nsDataHashtable.h header used to be found at gecko-dev/xpcom/ds/nsDataHashtable.h This no longer seems to be the case for ESR 91: the file doesn't exist anywhere. Is the problem that the file should exist, or that it should no longer be being included?

Well, the file is included from gecko-dev/gfx/thebes/gfxQtPlatform.h, a file which was entirely added by our "bring back Qt" patch. So probably its referencing something that it shouldn't; viz this include that no longer exists. We could just remove it and see what happens, but it may be worthwhile digging through the history a bit to see why it was removed. That should be our first port of call for tomorrow.

That's it for today. As usual, the rest of these posts can be found on my Gecko Dev Diary page.


Uncover Disqus comments