flypig.co.uk

List items

Items from the current list are shown below.

Gecko

22 Sep 2023 : Day 37 #
It's most-decidedly Autumn. When I left the house to go to work this morning the sun was still firmly lodged below the horizon. Walking in the wet down the country lanes in the dark, the storm of the night before has left puddles of wet leaves, many started to display very clear orange and brown shades. The turning of the seasons are the most exciting points in every year for me, so this all gives me a feeling of excitement and anticipation.

But, now on the train and back in the world of Gecko, there are errors to de-error. Let's take a look. Following on from yesterday, first we have another one of those pesky string refactoring errors:
In file included from Unified_cpp_mobile_sailfishos2.cpp:29:
${PROJECT}/gecko-dev/mobile/sailfishos/utils/WebBrowserChrome.cpp:332:61: error: no matching function for call to ‘nsTLiteralString::nsTLiteralString(const char [14])’
   target->AddEventListener(nsLiteralString(MOZ_MozAfterPaint), this, PR_FALSE);
                                                             ^
The fix is simple though; we just have to change this:
#define MOZ_MozAfterPaint "MozAfterPaint"
To this:
#define MOZ_MozAfterPaint u"MozAfterPaint"
The next issue is different. Sometimes it feels like upstream have made these changes just to make this process harder!
In file included from Unified_cpp_mobile_sailfishos2.cpp:29:
${PROJECT}/gecko-dev/mobile/sailfishos/utils/WebBrowserChrome.cpp: In member function ‘virtual nsresult WebBrowserChrome::HandleEvent(mozilla::dom::Event*)’:
${PROJECT}/gecko-dev/mobile/sailfishos/utils/WebBrowserChrome.cpp:419:56: error: invalid use of incomplete type ‘class mozilla::dom::DOMRect’
       RefPtr mClientArea = new DOMRect(nullptr);
                                                        ^
The constructor has been made explicit. Could that be the problem here?
-  DOMRect(nsISupports* aParent, double aX = 0, double aY = 0,
-          double aWidth = 0, double aHeight = 0)
+  explicit DOMRect(nsISupports* aParent, double aX = 0, double aY = 0,
+                   double aWidth = 0, double aHeight = 0)
Well... no. In practice the issue here seems to be just that the header inclusion hierarchy has changed. Adding DOMRect.h directly fixes the issue. Next up:
In file included from Unified_cpp_mobile_sailfishos2.cpp:29:
${PROJECT}/gecko-dev/mobile/sailfishos/utils/WebBrowserChrome.cpp: At global scope:
${PROJECT}/gecko-dev/mobile/sailfishos/utils/WebBrowserChrome.cpp:561:15: error: no declaration matches ‘nsresult WebBrowserChrome::SetFocus()’
 NS_IMETHODIMP WebBrowserChrome::SetFocus()
               ^~~~~~~~~~~~~~~~
It seems that the SetFocus() method has changed somehow, or been removed. Checking the logs exposes the fact that this is the culprit for this error:
$ git log -1 -S "setFocus" toolkit/components/browser/nsIEmbeddingSiteWindow.idl
commit 45da1c12ad15c667e6d4f4519d82221fd3ec2018
Author: Edgar Chen 
Date:   Mon May 10 20:05:12 2021 +0000

    Bug 1706316 - Part 1: Remove nsIEmbeddingSiteWindow::setFocus; r=hsivonen
    
    Differential Revision: https://phabricator.services.mozilla.com/D112739
It really does just seem to have been removed, and we don't actually implement it in EmbedLite, so I may as well remove the entire method as well.

Next up some more unicode changes, all of which are straightforward:
#define MOZ_scroll u"scroll"
#define MOZ_pagehide u"pagehide"
#define MOZ_MozScrolledAreaChanged u"MozScrolledAreaChanged"
And then we have this. This one is initially more perplexing, but turns out to be similar.
In file included from Unified_cpp_mobile_sailfishos2.cpp:29:
${PROJECT}/gecko-dev/mobile/sailfishos/utils/WebBrowserChrome.cpp: In member function ‘nsresult WebBrowserChrome::GetHttpUserAgent(nsIRequest*, nsAString&)’:
${PROJECT}/gecko-dev/mobile/sailfishos/utils/WebBrowserChrome.cpp:699:26: error: invalid use of incomplete type ‘class nsIHttpChannel’
     Unused << httpChannel->GetRequestHeader(
                          ^~
I check that the method is definitely still being generated. Yes. It can be found in the generated file nsIHttpChannel.h. And it's definitely accessible.
  /* [must_use] ACString getRequestHeader (in ACString aHeader); */
  [[nodiscard]] NS_IMETHOD GetRequestHeader(const nsACString& aHeader, nsACString& _retval) = 0;
Let's include the header directly again and see what happens. Yes! That does it.

It looks like this might actually be the last error for the ./obj-build-mer-qt-xr/mobile/sailfishos directory. Time for a full (incremental, but not partial) build to see what happens.

The result of the build is something new; not something I was expecting:
360:48.17 netwerk/protocol/gio
360:50.23 In file included from ${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp:36,
360:50.23                  from Unified_cpp_netwerk_protocol_gio0.cpp:20:
360:50.23 ${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers/gio/gio.h:3:15: fatal error: gio/gio.h: No such file or directory
360:50.23  #include_next 
360:50.23                ^~~~~~~~~~~
360:50.23 compilation terminated.
360:50.23 make[4]: *** [${PROJECT}/gecko-dev/config/rules.mk:676: Unified_cpp_netwerk_protocol_gio0.o] Error 1
The nsGIOProtocolHandler.cpp source file is requesting the gio.h header file, which can't be found anywhere. Gio is a Gtk library that provides general input/output functionalities including functionality related to networking and IPC. This isn't the only place it's used; I can count at least six other places. But the Gecko build pipeline isn't one homogeneous sequence, it's quite normal for it to apply different build operations to different files.

A good thing to check would be whether the file is actually available in the build engine. That's easy to check:
$ sfdk
$ sb2 -t SailfishOS-devel-aarch64.default
$ pkg-config --cflags gio-2.0
-pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
$ ls -l /usr/include/glib-2.0/gio/gio.h 
-rw-r--r-- 1 1001 100000 5755 Sep 22  2022 /usr/include/glib-2.0/gio/gio.h
All present and correct. All of this points towards the problem being with the build system rather than the code. So the next thing to check is whether any of this is being included in the compile command being issued.

Actually finding the command in this case isn't entirely obvious. However, there is a clue, in that make is highlighting the error being generated during the build of Unified_cpp_netwerk_protocol_gio0.o. There is a file that it certainly looks like is being used to build this:
$ find . -iname "Unified_cpp_netwerk_protocol_gio0.cpp"
./obj-build-mer-qt-xr/netwerk/protocol/gio/Unified_cpp_netwerk_protocol_gio0.cpp
$ ls ./obj-build-mer-qt-xr/netwerk/protocol/gio/
backend.mk  Makefile  Unified_cpp_netwerk_protocol_gio0.cpp
So we can try running the partial build step on this.
$ sfdk engine exec
$ sb2 -t SailfishOS-devel-aarch64.default
$ source ./obj-build-mer-qt-xr/rpm-shared.env
$ make -j1 -C ./obj-build-mer-qt-xr/netwerk/protocol/gio/
And as if by magic, now we get to see the full command. It's a ferociously long command, so I've reformatted it to make it easier to read, but you should brace yourself all the same.
$ /usr/bin/g++ -std=gnu++17 -o Unified_cpp_netwerk_protocol_gio0.o -c  \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/stl_wrappers \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers -include \
  ${PROJECT}/gecko-dev/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \
  -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DOS_POSIX=1 -DOS_LINUX=1 \
  -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API \
  -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API \
  -I${PROJECT}/gecko-dev/netwerk/protocol/gio \
  -I${PROJECT}/obj-build-mer-qt-xr/netwerk/protocol/gio \
  -I${PROJECT}/obj-build-mer-qt-xr/ipc/ipdl/_ipdlheaders \
  -I${PROJECT}/gecko-dev/ipc/chromium/src -I${PROJECT}/gecko-dev/netwerk/base \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/include -I/usr/include/nspr4 \
  -I/usr/include/nss3 -I/usr/include/nspr4 \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/include/nss -I/usr/include/pixman-1 \
  -DMOZILLA_CLIENT -include ${PROJECT}/obj-build-mer-qt-xr/mozilla-config.h \
  -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare \
  -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wduplicated-cond \
  -Wimplicit-fallthrough -Wno-error=maybe-uninitialized \
  -Wno-error=deprecated-declarations -Wno-error=array-bounds \
  -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object \
  -Wno-multistatement-macros -Wno-error=class-memaccess \
  -Wno-error=unused-but-set-variable -Wformat -Wformat-overflow=2 -Wno-psabi \
  -fno-sized-deallocation -fno-aligned-new -O3 -I/usr/include/freetype2 \
  -DUSE_ANDROID_OMTC_HACKS=1 -DUSE_OZONE=1 -DMOZ_UA_OS_AGNOSTIC=1 -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -fno-exceptions -fno-strict-aliasing -fPIC \
  -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread \
  -pipe -gdwarf-4 -O1 -fno-omit-frame-pointer -funwind-tables \
  -I/usr/include/qt5/QtQuick -I/usr/include/qt5 -I/usr/include/qt5/QtGui \
  -I/usr/include/qt5 -I/usr/include/qt5/QtQml -I/usr/include/qt5 \
  -I/usr/include/qt5/QtNetwork -I/usr/include/qt5 -I/usr/include/qt5/QtCore \
  -I/usr/include/qt5 -I/usr/include/qt5/QtGui/5.6.3/QtGui \
  -I/usr/include/qt5/QtFeedback -I/usr/include/qt5 -I/usr/include/qt5/QtCore \
  -I/usr/include/qt5 -I/usr/include/qt5/QtPositioning \
  -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5 -MD -MP -MF \
  .deps/Unified_cpp_netwerk_protocol_gio0.o.pp \
  Unified_cpp_netwerk_protocol_gio0.cpp
In file included from ${PROJECT}/gecko-dev/netwerk/protocol/gio/
                      nsGIOProtocolHandler.cpp:36,
                 from Unified_cpp_netwerk_protocol_gio0.cpp:20:
${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers/gio/gio.h:3:15: fatal error:
  gio/gio.h: No such file or directory
 #include_next 
               ^~~~~~~~~~~
compilation terminated.
It's a little fascinating that there's so much duplication with the build parameters. That's the nature of auto-generated build commands, but it does feel like something is not quite right with that. Thankfully that's not my problem to worry about right now (they're ugly but won't cause any harm).

My concern is that there's no mention of the glib-2.0 include locations in this command. I wonder what happens if we add them in? If we do, it builds, with plenty of warnings, but no errors. Here's the output. It's a little hard to tell, but I've added -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include in to the middle of this command:
$ pushd ${PROJECT}/obj-build-mer-qt-xr/netwerk/protocol/gio
$ /usr/bin/g++ -std=gnu++17 -o Unified_cpp_netwerk_protocol_gio0.o -c  \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/stl_wrappers \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers -include \
  ${PROJECT}/gecko-dev/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \
  -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DOS_POSIX=1 -DOS_LINUX=1 \
  -DWINAPI_NO_BUNDLED_LIBRARIES -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API \
  -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API \
  -I${PROJECT}/gecko-dev/netwerk/protocol/gio \
  -I${PROJECT}/obj-build-mer-qt-xr/netwerk/protocol/gio \
  -I${PROJECT}/obj-build-mer-qt-xr/ipc/ipdl/_ipdlheaders \
  -I${PROJECT}/gecko-dev/ipc/chromium/src -I${PROJECT}/gecko-dev/netwerk/base \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/include -I/usr/include/nspr4 \
  -I/usr/include/nss3 -I/usr/include/nspr4 \
  -I${PROJECT}/obj-build-mer-qt-xr/dist/include/nss -I/usr/include/pixman-1 \
  -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include \
  -DMOZILLA_CLIENT -include ${PROJECT}/obj-build-mer-qt-xr/mozilla-config.h \
  -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare \
  -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wduplicated-cond \
  -Wimplicit-fallthrough -Wno-error=maybe-uninitialized \
  -Wno-error=deprecated-declarations -Wno-error=array-bounds \
  -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object \
  -Wno-multistatement-macros -Wno-error=class-memaccess \
  -Wno-error=unused-but-set-variable -Wformat -Wformat-overflow=2 -Wno-psabi \
  -fno-sized-deallocation -fno-aligned-new -O3 -I/usr/include/freetype2 \
  -DUSE_ANDROID_OMTC_HACKS=1 -DUSE_OZONE=1 -DMOZ_UA_OS_AGNOSTIC=1 -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi \
  -Wno-attributes -Wno-psabi -Wno-attributes -Wno-psabi -Wno-attributes \
  -Wno-psabi -Wno-attributes -fno-exceptions -fno-strict-aliasing -fPIC \
  -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread \
  -pipe -gdwarf-4 -O1 -fno-omit-frame-pointer -funwind-tables \
  -I/usr/include/qt5/QtQuick -I/usr/include/qt5 -I/usr/include/qt5/QtGui \
  -I/usr/include/qt5 -I/usr/include/qt5/QtQml -I/usr/include/qt5 \
  -I/usr/include/qt5/QtNetwork -I/usr/include/qt5 -I/usr/include/qt5/QtCore \
  -I/usr/include/qt5 -I/usr/include/qt5/QtGui/5.6.3/QtGui \
  -I/usr/include/qt5/QtFeedback -I/usr/include/qt5 -I/usr/include/qt5/QtCore \
  -I/usr/include/qt5 -I/usr/include/qt5/QtPositioning \
  -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5 -MD -MP -MF \
  .deps/Unified_cpp_netwerk_protocol_gio0.o.pp \
  Unified_cpp_netwerk_protocol_gio0.cpp
In file included from Unified_cpp_netwerk_protocol_gio0.cpp:20:
${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp: In member
  function ‘nsresult nsGIOInputStream::DoRead(char*, uint32_t, uint32_t*)’:
${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp:498:18: warning:
  ‘GTimeVal’ is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations]
         GTimeVal gtime;
                  ^~~~~
In file included from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from ${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers/glib.h:3,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from ${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers/glib-object.h:3,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from ${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers/gio/gio.h:3,
                 from ${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp:36,
                 from Unified_cpp_netwerk_protocol_gio0.cpp:20:
/usr/include/glib-2.0/glib/gtypes.h:551:26: note: declared here
 typedef struct _GTimeVal GTimeVal GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
                          ^~~~~~~~
In file included from Unified_cpp_netwerk_protocol_gio0.cpp:20:
${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp:499:55: warning:
  ‘void g_file_info_get_modification_time(GFileInfo*, GTimeVal*)’ is deprecated:
  Use 'g_file_info_get_modification_date_time' instead [-Wdeprecated-declarations]
         g_file_info_get_modification_time(info, >ime);
                                                       ^
In file included from /usr/include/glib-2.0/gio/gio.h:83,
                 from ${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers/gio/gio.h:3,
                 from ${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp:36,
                 from Unified_cpp_netwerk_protocol_gio0.cpp:20:
/usr/include/glib-2.0/gio/gfileinfo.h:1210:19: note: declared here
 void              g_file_info_get_modification_time  (GFileInfo         *info,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from Unified_cpp_netwerk_protocol_gio0.cpp:20:
${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp:499:55: warning:
  ‘void g_file_info_get_modification_time(GFileInfo*, GTimeVal*)’ is deprecated:
  Use 'g_file_info_get_modification_date_time' instead [-Wdeprecated-declarations]
         g_file_info_get_modification_time(info, >ime);
                                                       ^
In file included from /usr/include/glib-2.0/gio/gio.h:83,
                 from ${PROJECT}/obj-build-mer-qt-xr/dist/system_wrappers/gio/gio.h:3,
                 from ${PROJECT}/gecko-dev/netwerk/protocol/gio/nsGIOProtocolHandler.cpp:36,
                 from Unified_cpp_netwerk_protocol_gio0.cpp:20:
/usr/include/glib-2.0/gio/gfileinfo.h:1210:19: note: declared here
 void              g_file_info_get_modification_time  (GFileInfo         *info,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ rm Unified_cpp_netwerk_protocol_gio0.o 
$ popd
Getting this many warnings is quite normal for Gecko code. The key thing is that there are no errors.

So at the risk of stating the obvious, it looks like something is missing from somewhere in the build system related to glib-2.0. I have to find out what it is and where to add it.

In the gecko-dev/netwerk/protocol/moz.build file it looks like there may be a clue:
DIRS += ["about", "data", "file"]
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk', 'qt'):
    DIRS += ["gio"]
DIRS += ["http", "res", "viewsource", "websocket"]
Plus, in the patch 0006, which I've not yet applied, I see this:
diff --git a/netwerk/protocol/gio/moz.build b/netwerk/protocol/gio/moz.build
index b9d7e461b314..722c3fc4af78 100644
--- a/netwerk/protocol/gio/moz.build
+++ b/netwerk/protocol/gio/moz.build
@@ -20,6 +20,13 @@ FINAL_LIBRARY = 'xul'
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
+CFLAGS += CONFIG['GLIB_CFLAGS']
+CXXFLAGS += CONFIG['GLIB_CFLAGS']
+OS_LIBS += CONFIG['GLIB_LIBS']
+OS_LIBS += [
+    '-lgio-2.0',
+]
+
 with Files('**'):
     BUG_COMPONENT = ('Core', 'Widget: Gtk') 
That looks very promising! But attempting to apply this patch, even using a three-way merge, fails. It's not a huge diff though, so should be easy to patch-up manually.

These changes are intrusive enough that a partial build will no longer cut it. In fact, when I try, the build process protests and refuses to play:
$ make -j1 -C ./obj-build-mer-qt-xr/netwerk/protocol/gio/
make: Entering directory '${PROJECT}/obj-build-mer-qt-xr/netwerk/protocol/gio'
${PROJECT}/gecko-dev/config/rules.mk:335: *** Build configuration changed. Build with |mach build| or run |mach build-backend| to regenerate build config.  Stop.
make: Leaving directory '${PROJECT}/obj-build-mer-qt-xr/netwerk/protocol/gio'
So I guess it's time for a longer build again.

[...]

The build ran for a long time (237:01.57 or nearly four hours) and eventually stopped with a flume of new errors. I'm not sure what I feel about this. I was hoping that the previous changes might have brought us close to a successful build, but it seems, in the inimitable of words of Juba from Gladiator, it will build, but not yet. On the other hand, progress is progress. And this is progress.

Here's where things are at:
236:34.07 storage
236:54.42 In file included from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                nsISupportsUtils.h:16,
236:54.42                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                nsISupports.h:82,
236:54.42                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozIStorageValueArray.h:10,
236:54.42                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozIStorageRow.h:10,
236:54.42                  from ${PROJECT}/gecko-dev/storage/mozStorageRow.h:10,
236:54.43                  from ${PROJECT}/gecko-dev/storage/mozStorageRow.cpp:7,
236:54.43                  from Unified_cpp_storage1.cpp:2:
236:54.43 ${PROJECT}/gecko-dev/storage/mozStorageService.cpp: In member function
          ‘virtual MozExternalRefCountType mozilla::storage::Service::AddRef()’:
236:54.43 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:33:27:
          error: ‘IsDestructible’ is not a member of ‘mozilla::storage::mozilla’
236:54.43    static_assert(!mozilla::IsDestructible::value,      \
236:54.43                            ^~~~~~~~~~~~~~
236:54.43 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:814:5:
          note: in expansion of macro ‘MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING’
236:54.43      MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                   \
236:54.43      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
236:54.43 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:827:32:
          note: in expansion of macro ‘NS_IMPL_NAMED_ADDREF’
236:54.44  #define NS_IMPL_ADDREF(_class) NS_IMPL_NAMED_ADDREF(_class, #_class)
236:54.44                                 ^~~~~~~~~~~~~~~~~~~~
236:54.44 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:1427:3:
          note: in expansion of macro ‘NS_IMPL_ADDREF’
236:54.44    NS_IMPL_ADDREF(aClass)               \
236:54.44    ^~~~~~~~~~~~~~
236:54.44 ${PROJECT}/gecko-dev/storage/mozStorageService.cpp:160:1: note: in
          expansion of macro ‘NS_IMPL_ISUPPORTS’
236:54.44  NS_IMPL_ISUPPORTS(Service, mozIStorageService, nsIObserver, nsIMemoryReporter)
236:54.44  ^~~~~~~~~~~~~~~~~
236:54.44 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:33:27:
          note: suggested alternative:
236:54.44    static_assert(!mozilla::IsDestructible::value,      \
236:54.44                            ^~~~~~~~~~~~~~
236:54.44 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:814:5:
          note: in expansion of macro ‘MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING’
236:54.44      MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                   \
236:54.44      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
236:54.45 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:827:32:
          note: in expansion of macro ‘NS_IMPL_NAMED_ADDREF’
236:54.45  #define NS_IMPL_ADDREF(_class) NS_IMPL_NAMED_ADDREF(_class, #_class)
236:54.45                                 ^~~~~~~~~~~~~~~~~~~~
236:54.45 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:1427:3:
          note: in expansion of macro ‘NS_IMPL_ADDREF’
236:54.45    NS_IMPL_ADDREF(aClass)               \
236:54.45    ^~~~~~~~~~~~~~
236:54.45 ${PROJECT}/gecko-dev/storage/mozStorageService.cpp:160:1: note: in
          expansion of macro ‘NS_IMPL_ISUPPORTS’
236:54.45  NS_IMPL_ISUPPORTS(Service, mozIStorageService, nsIObserver, nsIMemoryReporter)
236:54.45  ^~~~~~~~~~~~~~~~~
236:54.45 In file included from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                nsISupportsImpl.h:30,
236:54.45                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                nsISupportsUtils.h:16,
236:54.45                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                nsISupports.h:82,
236:54.45                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozIStorageValueArray.h:10,
236:54.45                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozIStorageRow.h:10,
236:54.45                  from ${PROJECT}/gecko-dev/storage/mozStorageRow.h:10,
236:54.45                  from ${PROJECT}/gecko-dev/storage/mozStorageRow.cpp:7,
236:54.45                  from Unified_cpp_storage1.cpp:2:
236:54.45 ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/TypeTraits.h:103:8:
          note:   ‘mozilla::IsDestructible’
236:54.45  struct IsDestructible : public detail::IsDestructibleImpl::Type {};
236:54.45         ^~~~~~~~~~~~~~
236:54.45 In file included from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                nsISupportsUtils.h:16,
236:54.45                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                nsISupports.h:82,
236:54.45                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozIStorageValueArray.h:10,
236:54.46                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozIStorageRow.h:10,
236:54.46                  from ${PROJECT}/gecko-dev/storage/mozStorageRow.h:10,
236:54.46                  from ${PROJECT}/gecko-dev/storage/mozStorageRow.cpp:7,
236:54.46                  from Unified_cpp_storage1.cpp:2:
236:54.46 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:33:43:
          error: expected primary-expression before ‘>’ token
236:54.46    static_assert(!mozilla::IsDestructible::value,      \
236:54.46                                            ^
236:54.46 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:814:5:
          note: in expansion of macro ‘MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING’
236:54.46      MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                   \
236:54.46      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
236:54.46 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:827:32:
          note: in expansion of macro ‘NS_IMPL_NAMED_ADDREF’
236:54.46  #define NS_IMPL_ADDREF(_class) NS_IMPL_NAMED_ADDREF(_class, #_class)
236:54.46                                 ^~~~~~~~~~~~~~~~~~~~
236:54.46 ${PROJECT}/obj-build-mer-qt-xr/dist/include/nsISupportsImpl.h:1427:3:
          note: in expansion of macro ‘NS_IMPL_ADDREF’
236:54.46    NS_IMPL_ADDREF(aClass)               \
236:54.46    ^~~~~~~~~~~~~~
[...]
It goes on like that for some time.

These errors are all a bit strange. They're all from the same neighbourhood (inside the gecko-dev/storage directory) and seem mostly to relate to incorrect namespace usage. Mostly it looks like there's a mozilla:: namespace prefix which is causing confusion for the compiler.

While fixing this there was a lot of trial-and-error on my part, and making use of partial builds was of huge benefit. I spent a long time fixing each of the namespace prefixes manually. The result is that I was able to get the contents of the storage directory building in the time it took me to travel from London to Cambridge by train.

That's not quite the end of it though. First, it now builds using the partial build commands, but I'll have to test a proper build overnight. Second, it would be good to know why these files, which are part of the Gecko source, not our added EmbedLite source, aren't compiling properly. That would seem to imply they're not being used upstream, otherwise it would surely have been noticed? Or maybe there's something else going on here?

So when I get back to this tomorrow, even if this part of the build now succeeds, I'm going to have to find out the underlying reason for these errors and why they're causing problems for me but (presumably) not for others.

But that's for tomorrow. Right now it's late and time for me to get some sleep while my laptop continues working overnight.

As always, if you want to read my other posts they're available in my full Gecko Dev Diary.

Comments

Uncover Disqus comments