Backed out 3 changesets (bug 1344038) for bustage
authorIris Hsiao <ihsiao@mozilla.com>
Thu, 06 Apr 2017 10:35:56 +0800
changeset 399542 7fbe40fa54dfcd23ec8cac8b0f06fe82c9772d9b
parent 399541 5eecc08a74e311107336e3b470630fe0ce3b7df9
child 399543 173691d9857c850026a17d38a29c8e38022999f1
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1344038
milestone55.0a1
backs out4befea89d81b80ee052074f0e74d5fd57dfa14e3
c859506b2e4eda3da6c4866f8dc5ab10dff200bc
5d28a63822854d7434b528af5d1163a18d1310d4
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 3 changesets (bug 1344038) for bustage Backed out changeset 4befea89d81b (bug 1344038) Backed out changeset c859506b2e4e (bug 1344038) Backed out changeset 5d28a6382285 (bug 1344038)
browser/confvars.sh
build/moz.configure/old.configure
config/system-headers
embedding/ios/confvars.sh
extensions/gio/moz.build
extensions/gio/nsGIOProtocolHandler.cpp
image/decoders/icon/gtk/moz.build
image/decoders/icon/gtk/nsIconChannel.cpp
netwerk/base/nsIOService.cpp
netwerk/protocol/gio/moz.build
netwerk/protocol/gio/nsGIOProtocolHandler.cpp
old-configure.in
toolkit/components/downloads/nsDownloadManager.cpp
toolkit/components/jsdownloads/src/DownloadPlatform.cpp
toolkit/system/gnome/moz.build
toolkit/system/gnome/nsGnomeModule.cpp
toolkit/toolkit.mozbuild
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -33,16 +33,17 @@ if test "$NIGHTLY_BUILD"; then
   MOZ_RUST_URLPARSE=1
 fi
 
 # Enable building ./signmar and running libmar signature tests
 MOZ_ENABLE_SIGNMAR=1
 
 MOZ_APP_VERSION=$FIREFOX_VERSION
 MOZ_APP_VERSION_DISPLAY=$FIREFOX_VERSION_DISPLAY
+MOZ_EXTENSIONS_DEFAULT=" gio"
 # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
 # MOZ_BRANDING_DIRECTORY is the default branding directory used when none is
 # specified. It should never point to the "official" branding directory.
 # For mozilla-beta, mozilla-release, or mozilla-central repositories, use
 # "unofficial" branding.
 # For the mozilla-aurora repository, use "aurora".
 MOZ_BRANDING_DIRECTORY=browser/branding/unofficial
 MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -174,16 +174,18 @@ def old_configure_options(*options):
     '--enable-dump-painting',
     '--enable-elf-hack',
     '--enable-extensions',
     '--enable-faststripe',
     '--enable-feeds',
     '--enable-gamepad',
     '--enable-gconf',
     '--enable-gczeal',
+    '--enable-gio',
+    '--enable-gnomeui',
     '--enable-gold',
     '--enable-hardware-aec-ns',
     '--enable-icf',
     '--enable-install-strip',
     '--enable-ion',
     '--enable-ios-target',
     '--enable-jitspew',
     '--enable-libjpeg-turbo',
--- a/config/system-headers
+++ b/config/system-headers
@@ -1266,17 +1266,19 @@ libsn/sn-monitor.h
 libsn/sn-util.h
 #endif
 #if MOZ_SYSTEM_HUNSPELL==1
 hunspell.hxx
 #endif
 #if MOZ_SYSTEM_BZ2==1
 bzlib.h
 #endif
+#ifdef MOZ_ENABLE_GIO
 gio/gio.h
+#endif
 #if MOZ_SYSTEM_LIBEVENT==1
 event.h
 #else
 sys/event.h
 #endif
 #ifdef MOZ_ENABLE_LIBPROXY
 proxy.h
 #endif
--- a/embedding/ios/confvars.sh
+++ b/embedding/ios/confvars.sh
@@ -2,8 +2,9 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MOZ_APP_NAME=geckoembed
 MOZ_APP_DISPLAYNAME=GeckoEmbed
 MOZ_UPDATER=
 MOZ_APP_VERSION=$MOZILLA_VERSION
+MOZ_EXTENSIONS_DEFAULT=" gio"
rename from netwerk/protocol/gio/moz.build
rename to extensions/gio/moz.build
--- a/netwerk/protocol/gio/moz.build
+++ b/extensions/gio/moz.build
@@ -5,13 +5,13 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 SOURCES += [
     'nsGIOProtocolHandler.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
-CXXFLAGS += CONFIG['TK_CFLAGS']
+CXXFLAGS += CONFIG['MOZ_GIO_CFLAGS']
 
 with Files('**'):
     BUG_COMPONENT = ('Core', 'Widget: Gtk')
 
rename from netwerk/protocol/gio/nsGIOProtocolHandler.cpp
rename to extensions/gio/nsGIOProtocolHandler.cpp
--- a/image/decoders/icon/gtk/moz.build
+++ b/image/decoders/icon/gtk/moz.build
@@ -5,9 +5,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 SOURCES += [
     'nsIconChannel.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
-CXXFLAGS += CONFIG['TK_CFLAGS']
+if CONFIG['MOZ_ENABLE_GNOMEUI']:
+    CXXFLAGS += CONFIG['MOZ_GNOMEUI_CFLAGS']
+else:
+    CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/image/decoders/icon/gtk/nsIconChannel.cpp
+++ b/image/decoders/icon/gtk/nsIconChannel.cpp
@@ -7,17 +7,19 @@
 
 #include <stdlib.h>
 #include <unistd.h>
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/EndianUtils.h"
 #include <algorithm>
 
+#ifdef MOZ_ENABLE_GIO
 #include <gio/gio.h>
+#endif
 
 #include <gtk/gtk.h>
 
 #include "nsMimeTypes.h"
 #include "nsIMIMEService.h"
 
 #include "nsServiceManagerUtils.h"
 
@@ -161,16 +163,17 @@ moz_gtk_icon_size(const char* name)
 
   if (strcmp(name, "dialog") == 0) {
     return GTK_ICON_SIZE_DIALOG;
   }
 
   return GTK_ICON_SIZE_MENU;
 }
 
+#ifdef MOZ_ENABLE_GIO
 static int32_t
 GetIconSize(nsIMozIconURI* aIconURI)
 {
   nsAutoCString iconSizeString;
 
   aIconURI->GetIconSize(iconSizeString);
   if (iconSizeString.IsEmpty()) {
     uint32_t size;
@@ -293,31 +296,36 @@ nsIconChannel::InitWithGIO(nsIMozIconURI
   nsresult rv = ScaleIconBuf(&buf, iconSize);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = moz_gdk_pixbuf_to_channel(buf, aIconURI,
                                  getter_AddRefs(mRealChannel));
   g_object_unref(buf);
   return rv;
 }
+#endif // MOZ_ENABLE_GIO
 
 nsresult
 nsIconChannel::Init(nsIURI* aURI)
 {
   nsCOMPtr<nsIMozIconURI> iconURI = do_QueryInterface(aURI);
   NS_ASSERTION(iconURI, "URI is not an nsIMozIconURI");
 
   if (gfxPlatform::IsHeadless()) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsAutoCString stockIcon;
   iconURI->GetStockIcon(stockIcon);
   if (stockIcon.IsEmpty()) {
+#ifdef MOZ_ENABLE_GIO
     return InitWithGIO(iconURI);
+#else
+    return NS_ERROR_NOT_AVAILABLE;
+#endif
   }
 
   // Search for stockIcon
   nsAutoCString iconSizeString;
   iconURI->GetIconSize(iconSizeString);
 
   nsAutoCString iconStateString;
   iconURI->GetIconState(iconStateString);
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -537,17 +537,17 @@ nsIOService::GetProtocolHandler(const ch
         ToLowerCase(contractID);
 
         rv = CallGetService(contractID.get(), result);
         if (NS_SUCCEEDED(rv)) {
             CacheProtocolHandler(scheme, *result);
             return rv;
         }
 
-#ifdef MOZ_WIDGET_GTK
+#ifdef MOZ_ENABLE_GIO
         // check to see whether GVFS can handle this URI scheme.  if it can
         // create a nsIURI for the "scheme:", then we assume it has support for
         // the requested protocol.  otherwise, we failover to using the default
         // protocol handler.
 
         rv = CallGetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"moz-gio",
                             result);
         if (NS_SUCCEEDED(rv)) {
--- a/old-configure.in
+++ b/old-configure.in
@@ -52,22 +52,24 @@ NSPR_MINVER=4.14
 NSS_VERSION=3
 
 dnl Set the minimum version of toolkit libs used by mozilla
 dnl ========================================================
 GLIB_VERSION=2.22
 # 2_26 is the earliest version we can set GLIB_VERSION_MIN_REQUIRED.
 # The macro won't be used when compiling with earlier versions anyway.
 GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26
+GIO_VERSION=2.22
 CAIRO_VERSION=1.10
 GTK2_VERSION=2.18.0
 GTK3_VERSION=3.4.0
 GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.14
+GNOMEUI_VERSION=2.2.0
 GCONF_VERSION=1.2.1
 STARTUP_NOTIFICATION_VERSION=0.8
 DBUS_VERSION=0.60
 SQLITE_VERSION=3.18.0
 
 dnl Set various checks
 dnl ========================================================
 MISSING_X=
@@ -2530,27 +2532,60 @@ dnl values set by configure.sh above.
 dnl ========================================================
 
 MOZ_ANDROID_GOOGLE_PLAY_SERVICES
 MOZ_ANDROID_GOOGLE_CLOUD_MESSAGING
 MOZ_ANDROID_INSTALL_TRACKING
 
 
 dnl ========================================================
-dnl = GConf support module
+dnl = GIO and GConf support module
 dnl ========================================================
 
 if test "$MOZ_X11"
 then
+    dnl build the GIO extension by default only when the
+    dnl GTK2 toolkit is in use.
     if test "$MOZ_ENABLE_GTK"
     then
+        MOZ_ENABLE_GIO=1
         MOZ_ENABLE_GCONF=1
     fi
 
     dnl ========================================================
+    dnl = GIO support module
+    dnl ========================================================
+    MOZ_ARG_DISABLE_BOOL(gio,
+    [  --disable-gio           Disable GIO support],
+        MOZ_ENABLE_GIO=,
+        MOZ_ENABLE_GIO=force)
+
+    if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK"
+    then
+        if test "$MOZ_WIDGET_TOOLKIT" = gtk2
+        then
+            PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, ,
+                              [AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])])
+        fi
+        PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
+            MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
+            MOZ_ENABLE_GIO=1
+            AC_DEFINE(MOZ_ENABLE_GIO)
+        ],[
+            if test "$MOZ_ENABLE_GIO" = "force"
+            then
+                AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
+            fi
+            MOZ_ENABLE_GIO=
+        ])
+    fi
+
+    AC_SUBST(MOZ_ENABLE_GIO)
+
+    dnl ========================================================
     dnl = GConf support module
     dnl ========================================================
     MOZ_ARG_DISABLE_BOOL(gconf,
     [  --disable-gconf      Disable Gconf support ],
         MOZ_ENABLE_GCONF=,
         MOZ_ENABLE_GCONF=1)
 
     if test "$MOZ_ENABLE_GCONF"
@@ -2592,16 +2627,48 @@ then
     then
         PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
         AC_DEFINE(MOZ_ENABLE_LIBPROXY)
     fi
 fi
 AC_SUBST(MOZ_ENABLE_LIBPROXY)
 
 dnl ========================================================
+dnl = libgnomeui support module
+dnl ========================================================
+
+if test "$MOZ_ENABLE_GTK"
+then
+    MOZ_ARG_ENABLE_BOOL(gnomeui,
+    [  --enable-gnomeui        Enable libgnomeui instead of GIO & GTK for icon theme support ],
+        MOZ_ENABLE_GNOMEUI=force,
+        MOZ_ENABLE_GNOMEUI=)
+
+    if test "$MOZ_ENABLE_GNOMEUI"
+    then
+        PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
+        [
+            MOZ_ENABLE_GNOMEUI=1
+        ],[
+            if test "$MOZ_ENABLE_GNOMEUI" = "force"
+            then
+                AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
+            fi
+            MOZ_ENABLE_GNOMEUI=
+        ])
+    fi
+
+    if test "$MOZ_ENABLE_GNOMEUI"; then
+        AC_DEFINE(MOZ_ENABLE_GNOMEUI)
+    fi
+fi
+
+AC_SUBST(MOZ_ENABLE_GNOMEUI)
+
+dnl ========================================================
 dnl = dbus support
 dnl ========================================================
 
 if test "$MOZ_ENABLE_GTK"
 then
     MOZ_ENABLE_DBUS=1
 
     MOZ_ARG_DISABLE_BOOL(dbus,
@@ -3499,16 +3566,30 @@ MOZ_ARG_ENABLE_STRING(extensions,
         option=`echo $option | sed 's/^-//'`
         MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
     else
         MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
     fi
 done],
     MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
 
+if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
+    # Suppress warning on non-X11 platforms
+    if test -n "$MOZ_X11"; then
+        AC_MSG_WARN([Removing gio from MOZ_EXTENSIONS due to --disable-gio.])
+    fi
+    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
+fi
+
+if test `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
+    MOZ_GIO_COMPONENT=1
+    MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
+fi
+AC_SUBST(MOZ_GIO_COMPONENT)
+
 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
 dnl when trying to build a nonexistent extension.
 for extension in $MOZ_EXTENSIONS; do
     if test ! -d "${srcdir}/extensions/${extension}"; then
         AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
     fi
 done
 
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -2643,17 +2643,17 @@ NS_IMETHODIMP nsDownload::SetSignatureIn
 
 NS_IMETHODIMP nsDownload::SetRedirects(nsIArray* aRedirects) {
   MOZ_ASSERT(NS_IsMainThread(), "Must call SetRedirects on main thread");
   // This will be used later to query the application reputation service.
   mRedirects = aRedirects;
   return NS_OK;
 }
 
-#ifdef MOZ_WIDGET_GTK
+#ifdef MOZ_ENABLE_GIO
 static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpointer user_data)
 {
   GError *err = nullptr;
   g_file_set_attributes_finish(G_FILE(source_obj), res, nullptr, &err);
   if (err) {
 #ifdef DEBUG
     NS_DebugBreak(NS_DEBUG_WARNING, "Set file metadata failed: ", err->message, __FILE__, __LINE__);
 #endif
@@ -2812,17 +2812,17 @@ nsDownload::SetState(DownloadState aStat
                                            nullptr, nullptr);
             if (uri) {
               gtk_recent_manager_add_item(manager, uri);
               g_free(uri);
             }
 #endif
           }
 #endif
-#ifdef MOZ_WIDGET_GTK
+#ifdef MOZ_ENABLE_GIO
           // Use GIO to store the source URI for later display in the file manager.
           GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get());
           nsCString source_uri;
           rv = mSource->GetSpec(source_uri);
           NS_ENSURE_SUCCESS(rv, rv);
           GFileInfo *file_info = g_file_info_new();
           g_file_info_set_attribute_string(file_info, "metadata::download-uri", source_uri.get());
           g_file_set_attributes_async(gio_file,
--- a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
+++ b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
@@ -54,17 +54,17 @@ DownloadPlatform* DownloadPlatform::GetD
 
 #if defined(MOZ_WIDGET_GTK)
   g_type_init();
 #endif
 
   return gDownloadPlatformService;
 }
 
-#ifdef MOZ_WIDGET_GTK
+#ifdef MOZ_ENABLE_GIO
 static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpointer user_data)
 {
   GError *err = nullptr;
   g_file_set_attributes_finish(G_FILE(source_obj), res, nullptr, &err);
   if (err) {
 #ifdef DEBUG
     NS_DebugBreak(NS_DEBUG_WARNING, "Set file metadata failed: ", err->message, __FILE__, __LINE__);
 #endif
@@ -126,17 +126,17 @@ nsresult DownloadPlatform::DownloadDone(
                                        nullptr, nullptr);
         if (uri) {
           gtk_recent_manager_add_item(manager, uri);
           g_free(uri);
         }
 #endif
       }
 #endif
-#ifdef MOZ_WIDGET_GTK
+#ifdef MOZ_ENABLE_GIO
       // Use GIO to store the source URI for later display in the file manager.
       GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get());
       nsCString source_uri;
       nsresult rv = aSource->GetSpec(source_uri);
       NS_ENSURE_SUCCESS(rv, rv);
       GFileInfo *file_info = g_file_info_new();
       g_file_info_set_attribute_string(file_info, "metadata::download-uri", source_uri.get());
       g_file_set_attributes_async(gio_file,
--- a/toolkit/system/gnome/moz.build
+++ b/toolkit/system/gnome/moz.build
@@ -10,24 +10,28 @@ SOURCES += [
     'nsSystemAlertsService.cpp',
 ]
 
 if CONFIG['MOZ_ENABLE_GCONF']:
     SOURCES += [
         'nsGConfService.cpp',
     ]
 
-SOURCES += [
-    'nsGIOService.cpp',
-    'nsGSettingsService.cpp',
-    'nsPackageKitService.cpp'
-]
+if CONFIG['MOZ_ENABLE_GIO']:
+    SOURCES += [
+        'nsGIOService.cpp',
+        'nsGSettingsService.cpp',
+        'nsPackageKitService.cpp'
+    ]
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/toolkit/components/build/',
 ]
 
 CXXFLAGS += CONFIG['MOZ_GCONF_CFLAGS']
+CXXFLAGS += CONFIG['MOZ_GIO_CFLAGS']
 CXXFLAGS += CONFIG['GLIB_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
-CXXFLAGS += CONFIG['TK_CFLAGS']
+
+if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+    CXXFLAGS += CONFIG['TK_CFLAGS']
--- a/toolkit/system/gnome/nsGnomeModule.cpp
+++ b/toolkit/system/gnome/nsGnomeModule.cpp
@@ -7,51 +7,59 @@
 #include "mozilla/ModuleUtils.h"
 
 #include <glib-object.h>
 
 #ifdef MOZ_ENABLE_GCONF
 #include "nsGConfService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGConfService, Init)
 #endif
+#ifdef MOZ_ENABLE_GIO
 #include "nsGIOService.h"
 #include "nsGSettingsService.h"
 #include "nsPackageKitService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPackageKitService, Init)
+#endif
 #include "nsSystemAlertsService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemAlertsService, Init)
 
 #ifdef MOZ_ENABLE_GCONF
 NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
 #endif
+#ifdef MOZ_ENABLE_GIO
 NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_PACKAGEKITSERVICE_CID);
+#endif
 NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
 
 static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
 #ifdef MOZ_ENABLE_GCONF
   { &kNS_GCONFSERVICE_CID, false, nullptr, nsGConfServiceConstructor },
 #endif
+#ifdef MOZ_ENABLE_GIO
   { &kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor },
   { &kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor },
   { &kNS_PACKAGEKITSERVICE_CID, false, nullptr, nsPackageKitServiceConstructor },
+#endif
   { &kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, nsSystemAlertsServiceConstructor },
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
 #ifdef MOZ_ENABLE_GCONF
   { NS_GCONFSERVICE_CONTRACTID, &kNS_GCONFSERVICE_CID },
 #endif
+#ifdef MOZ_ENABLE_GIO
   { NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
   { NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID },
   { NS_PACKAGEKITSERVICE_CONTRACTID, &kNS_PACKAGEKITSERVICE_CID },
+#endif
   { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
   { nullptr }
 };
 
 static nsresult
 InitGType ()
 {
   g_type_init();
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -134,16 +134,19 @@ if CONFIG['MOZ_PREF_EXTENSIONS']:
 DIRS += [
     '/devtools',
     '/services',
     '/startupcache',
     '/js/ductwork/debugger',
     '/other-licenses/snappy',
 ]
 
+if CONFIG['MOZ_GIO_COMPONENT']:
+    DIRS += ['/extensions/gio']
+
 if CONFIG['MOZ_RUST']:
     DIRS += [
         '/toolkit/library/gtest/rust',
         '/toolkit/library/rust',
     ]
 
 DIRS += [
     '/toolkit/library/StaticXULComponentsEnd',