Bug 1447475 - Rip out support code for setting MOZ_ICU_DATA_ARCHIVE and shipping ICU data in a file outside the binary. r=ted
authorJeff Walden <jwalden@mit.edu>
Tue, 20 Mar 2018 18:30:16 -0700
changeset 773639 10e682fef4a64676dad1dc922e8e6b22ccb9171e
parent 773638 6af40fb76692ad647645194c7458c1be228378aa
child 773640 64eaee27492a1a37905780f7cac1bbe83a305021
push id104266
push userbmo:hsivonen@hsivonen.fi
push dateWed, 28 Mar 2018 07:33:03 +0000
reviewersted
bugs1447475
milestone61.0a1
Bug 1447475 - Rip out support code for setting MOZ_ICU_DATA_ARCHIVE and shipping ICU data in a file outside the binary. r=ted
CLOBBER
browser/installer/Makefile.in
browser/installer/package-manifest.in
build/autoconf/icu.m4
config/external/icu/data/moz.build
config/external/icu/moz.build
config/external/icu/stubdata/moz.build
js/src/build/moz.build
js/src/fuzz-tests/moz.build
js/src/gdb/moz.build
js/src/jsapi-tests/moz.build
js/src/shell/moz.build
xpcom/build/XPCOMInit.cpp
xpcom/build/moz.build
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Historically updating ICU has required a CLOBBER.  Bug 1445524 is a fairly notable ICU-related change, so play it safe and force a full rebuild, even if no problem along these lines has actually been observed.
+More ICU-build-related touching for bug 1447475, trying a CLOBBER after a previous build failure just in case.
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -127,25 +127,19 @@ DEFINES += -DRESPATH='$(RESPATH)'
 LPROJ_ROOT = $(firstword $(subst -, ,$(AB_CD)))
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 ifeq (zh-TW,$(AB_CD))
 LPROJ_ROOT := $(subst -,_,$(AB_CD))
 endif
 endif
 DEFINES += -DLPROJ_ROOT=$(LPROJ_ROOT)
 
-DEFINES += -DMOZ_ICU_VERSION=$(MOZ_ICU_VERSION)
 ifdef MOZ_SYSTEM_ICU
 DEFINES += -DMOZ_SYSTEM_ICU
 endif
-ifdef MOZ_ICU_DATA_ARCHIVE
-DEFINES += -DMOZ_ICU_DATA_ARCHIVE
-endif
-DEFINES += -DMOZ_ICU_DBG_SUFFIX=$(MOZ_ICU_DBG_SUFFIX)
-DEFINES += -DICU_DATA_FILE=$(ICU_DATA_FILE)
 ifdef CLANG_CXX
 DEFINES += -DCLANG_CXX
 endif
 ifdef CLANG_CL
 DEFINES += -DCLANG_CL
 endif
 
 ifdef LLVM_SYMBOLIZER
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -92,19 +92,16 @@
 @BINPATH@/@MSVC_C_RUNTIME_DLL@
 @BINPATH@/@MSVC_CXX_RUNTIME_DLL@
 #endif
 #if MOZ_PACKAGE_WIN_UCRT_DLLS
 @BINPATH@/api-ms-win-*.dll
 @BINPATH@/ucrtbase.dll
 #endif
 #endif
-#ifdef MOZ_ICU_DATA_ARCHIVE
-@RESPATH@/@ICU_DATA_FILE@
-#endif
 #ifdef MOZ_GTK3
 @BINPATH@/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
 @BINPATH@/gtk2/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
 #ifdef MOZ_WAYLAND
 @BINPATH@/@DLL_PREFIX@mozwayland@DLL_SUFFIX@
 #endif
 #endif
 
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -2,17 +2,16 @@ dnl This Source Code Form is subject to 
 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 dnl Set the MOZ_ICU_VERSION variable to denote the current version of the
 dnl ICU library, as well as a few other things.
 
 AC_DEFUN([MOZ_CONFIG_ICU], [
 
-ICU_LIB_NAMES=
 MOZ_SYSTEM_ICU=
 MOZ_ARG_WITH_BOOL(system-icu,
 [  --with-system-icu
                           Use system ICU (located with pkgconfig)],
     MOZ_SYSTEM_ICU=1)
 
 if test -n "$MOZ_SYSTEM_ICU"; then
     PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 59.1)
@@ -74,25 +73,22 @@ if test -n "$USE_ICU"; then
        AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno])
     fi
     MOZ_ICU_VERSION="$version"
 
     # TODO: the l is actually endian-dependent
     # We could make this set as 'l' or 'b' for little or big, respectively,
     # but we'd need to check in a big-endian version of the file.
     ICU_DATA_FILE="icudt${version}l.dat"
-
-    MOZ_ICU_DATA_ARCHIVE=
 fi
 
 AC_SUBST(MOZ_ICU_VERSION)
 AC_SUBST(ENABLE_INTL_API)
 AC_SUBST(USE_ICU)
 AC_SUBST(ICU_DATA_FILE)
-AC_SUBST(MOZ_ICU_DATA_ARCHIVE)
 
 if test -n "$USE_ICU"; then
     dnl Source files that use ICU should have control over which parts of the ICU
     dnl namespace they want to use.
     AC_DEFINE(U_USING_ICU_NAMESPACE,0)
 
     if test -z "$MOZ_SYSTEM_ICU"; then
         if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then
--- a/config/external/icu/data/moz.build
+++ b/config/external/icu/data/moz.build
@@ -1,18 +1,14 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
-if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-    # Copy the pre-built ICU data file to dist/bin.
-    FINAL_TARGET_FILES += [CONFIG['ICU_DATA_FILE']]
-
 # Build a library containing the ICU data for use in the JS shell, so that
 # JSAPI consumers don't have to deal with setting ICU's data path.
 Library('icudata')
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     if CONFIG['CPU_ARCH'] == 'x86':
         ASFLAGS += ['-DPREFIX']
 elif CONFIG['OS_ARCH'] == 'Darwin':
--- a/config/external/icu/moz.build
+++ b/config/external/icu/moz.build
@@ -9,13 +9,9 @@ Library('icu')
 if CONFIG['MOZ_SYSTEM_ICU']:
     OS_LIBS += CONFIG['MOZ_ICU_LIBS']
 else:
     DIRS += [
         'common',
         'data',
         'i18n',
     ]
-    if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-        DIRS += ['stubdata']
-        USE_LIBS += ['icustubdata']
-    else:
-        USE_LIBS += ['icudata']
+    USE_LIBS += ['icudata']
deleted file mode 100644
--- a/config/external/icu/stubdata/moz.build
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-# This builds the ICU stubdata library, since we are shipping ICU
-# data in a separate data file. ICU needs a data symbol to link against
-# even if you're loading its data from a file.
-
-Library('icustubdata')
-
-SOURCES += ['/intl/icu/source/stubdata/stubdata.cpp']
--- a/js/src/build/moz.build
+++ b/js/src/build/moz.build
@@ -25,27 +25,19 @@ if CONFIG['JS_SHARED_LIBRARY']:
     SHARED_LIBRARY_NAME = CONFIG['JS_LIBRARY_NAME']
 else:
     Library('js')
 
 FORCE_STATIC_LIB = True
 STATIC_LIBRARY_NAME = 'js_static'
 
 if CONFIG['ENABLE_INTL_API']:
-    if not CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-        USE_LIBS += [
-            'icu',
-        ]
-    else:
-        # Linking 'icu' will pull in the stubdata library,
-        # which the shell doesn't want, so link the other bits.
-        USE_LIBS += [
-            'icui18n',
-            'icuuc',
-        ]
+    USE_LIBS += [
+        'icu',
+    ]
 
 USE_LIBS += [
     'nspr',
     'zlib',
 ]
 
 if CONFIG['OS_ARCH'] not in ('WINNT', 'HP-UX'):
     OS_LIBS += [
--- a/js/src/fuzz-tests/moz.build
+++ b/js/src/fuzz-tests/moz.build
@@ -18,21 +18,16 @@ if CONFIG['JS_BUILD_BINAST']:
 
 DEFINES['EXPORT_JS_API'] = True
 
 LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
-if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-    # The ICU libraries linked into libmozjs will not include the ICU data,
-    # so link it directly.
-    USE_LIBS += ['icudata']
-
 if CONFIG['FUZZING']:
     USE_LIBS += [
         'static:fuzzer-registry',
     ]
 
 if CONFIG['LIBFUZZER']:
     USE_LIBS += [
         'static:fuzzer',
--- a/js/src/gdb/moz.build
+++ b/js/src/gdb/moz.build
@@ -34,21 +34,16 @@ LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
 USE_LIBS += [
     'static:js',
 ]
 
-if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-    # The ICU libraries linked into libmozjs will not include the ICU data,
-    # so link it directly.
-    USE_LIBS += ['icudata']
-
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-shadow', '-fno-strict-aliasing']
 
 # This is intended as a temporary workaround to enable VS2015.
 if CONFIG['CC_TYPE'] in ('msvc', 'clang-cl'):
     CXXFLAGS += ['-wd4312']
--- a/js/src/jsapi-tests/moz.build
+++ b/js/src/jsapi-tests/moz.build
@@ -158,21 +158,16 @@ if CONFIG['JS_BUILD_BINAST'] and CONFIG[
 DEFINES['EXPORT_JS_API'] = True
 DEFINES['ENABLE_WASM_GLOBAL'] = True
 
 LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
-if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-    # The ICU libraries linked into libmozjs will not include the ICU data,
-    # so link it directly.
-    USE_LIBS += ['icudata']
-
 USE_LIBS += [
     'static:js',
 ]
 
 if CONFIG['MOZ_NEEDS_LIBATOMIC']:
     OS_LIBS += ['atomic']
 
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
--- a/js/src/shell/moz.build
+++ b/js/src/shell/moz.build
@@ -32,21 +32,16 @@ if CONFIG['CC_TYPE'] in ('msvc', 'clang-
 LOCAL_INCLUDES += [
     '!..',
     '..',
 ]
 
 OS_LIBS += CONFIG['EDITLINE_LIBS']
 OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
-if CONFIG['ENABLE_INTL_API'] and CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-    # The ICU libraries linked into libmozjs will not include the ICU data,
-    # so link it directly.
-    USE_LIBS += ['icudata']
-
 # Prepare module loader JS code for embedding
 GENERATED_FILES += [('shellmoduleloader.out.h', 'shellmoduleloader.js')]
 shellmoduleloader = GENERATED_FILES[('shellmoduleloader.out.h', 'shellmoduleloader.js')]
 shellmoduleloader.script = '../builtin/embedjs.py:generate_shellmoduleloader'
 shellmoduleloader.inputs = [
     '../js.msg',
     'ModuleLoader.js',
 ]
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -150,20 +150,16 @@ extern nsresult nsStringInputStreamConst
 
 #include "GeckoProfiler.h"
 
 #include "jsapi.h"
 #include "js/Initialization.h"
 
 #include "gfxPlatform.h"
 
-#if EXPOSE_INTL_API
-#include "unicode/putil.h"
-#endif
-
 using namespace mozilla;
 using base::AtExitManager;
 using mozilla::ipc::BrowserProcessSubThread;
 
 namespace {
 
 static AtExitManager* sExitManager;
 static MessageLoop* sMessageLoop;
@@ -650,27 +646,16 @@ NS_InitXPCOM2(nsIServiceManager** aResul
                         VPXReporter::CountingCalloc,
                         VPXReporter::CountingRealloc,
                         VPXReporter::CountingFree,
                         memcpy,
                         memset,
                         memmove);
 #endif
 
-#if EXPOSE_INTL_API && defined(MOZ_ICU_DATA_ARCHIVE)
-  nsCOMPtr<nsIFile> greDir;
-  nsDirectoryService::gService->Get(NS_GRE_DIR,
-                                    NS_GET_IID(nsIFile),
-                                    getter_AddRefs(greDir));
-  MOZ_ASSERT(greDir);
-  nsAutoCString nativeGREPath;
-  greDir->GetNativePath(nativeGREPath);
-  u_setDataDirectory(nativeGREPath.get());
-#endif
-
   // Initialize the JS engine.
   const char* jsInitFailureReason = JS_InitWithFailureDiagnostic();
   if (jsInitFailureReason) {
     MOZ_CRASH_UNSAFE_OOL(jsInitFailureReason);
   }
   sInitializedJS = true;
 
   rv = nsComponentManagerImpl::gComponentManager->Init();
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -78,18 +78,16 @@ GENERATED_FILES['Services.h'].script = '
 GENERATED_FILES['services.rs'].script = 'Services.py:services_rs'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['_IMPL_NS_STRINGAPI'] = True
 DEFINES['OMNIJAR_NAME'] = CONFIG['OMNIJAR_NAME']
-if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
-    DEFINES['MOZ_ICU_DATA_ARCHIVE'] = True
 
 LOCAL_INCLUDES += [
     '!..',
     '../base',
     '../components',
     '../ds',
     '../glue',
     '../io',