diff --git a/Makefile.in b/Makefile.in index 805064d6f1..e95c18cf93 100644 --- a/Makefile.in +++ b/Makefile.in @@ -15,9 +15,11 @@ export TOPLEVEL_BUILD := 1 default:: +ifndef TEST_MOZBUILD ifdef MOZ_BUILD_APP include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk endif +endif include $(topsrcdir)/config/config.mk @@ -28,6 +30,10 @@ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \ netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \ .mozconfig.mk +ifndef MOZ_PROFILE_USE +buildid.h: FORCE +endif + ifdef JS_STANDALONE configure_dir = $(topsrcdir)/js/src else @@ -154,10 +160,12 @@ install-manifests: $(addprefix install-,$(install_manifests)) # If we're using the hybrid FasterMake/RecursiveMake backend, we want # to recurse in the faster/ directory in parallel of install manifests. +# But dist/idl needs to happen before (cf. dependencies in +# config/faster/rules.mk) ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS))) install-manifests: faster .PHONY: faster -faster: +faster: install-dist/idl $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1 endif @@ -203,20 +211,20 @@ endif ifdef MOZ_PROFILE_USE ifndef NO_PROFILE_GUIDED_OPTIMIZE ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_) -export:: install-manifests +recurse_pre-export:: install-manifests binaries:: @$(MAKE) install-manifests NO_REMOVE=1 install_manifests=dist/include endif endif else # !MOZ_PROFILE_USE (normal build) -export:: install-manifests +recurse_pre-export:: install-manifests binaries:: @$(MAKE) install-manifests NO_REMOVE=1 install_manifests=dist/include endif # For historical reasons that are unknown, $(DIST)/sdk is always blown away # with no regard for PGO passes. This decision could probably be revisited. -export:: install-dist/sdk +recurse_pre-export:: install-dist/sdk ifndef JS_STANDALONE ifdef ENABLE_TESTS diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index eade271605..c320d1ee82 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -81,7 +81,7 @@ LPROJ := Contents/Resources/$(LPROJ_ROOT).lproj clean clobber repackage:: $(RM) -r $(dist_dest) -MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/config/buildid) +MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/buildid.h) .PHONY: repackage tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) diff --git a/browser/app/macversion.py b/browser/app/macversion.py index 8c360368e9..839aac1ffc 100644 --- a/browser/app/macversion.py +++ b/browser/app/macversion.py @@ -28,7 +28,7 @@ if not options.version: # builds), but also so that newly-built older versions (e.g. beta build) aren't # considered "newer" than previously-built newer versions (e.g. a trunk nightly) -buildid = open(options.buildid, 'r').read() +define, MOZ_BUILDID, buildid = open(options.buildid, 'r').read().split() # extract only the major version (i.e. "14" from "14.0b1") majorVersion = re.match(r'^(\d+)[^\d].*', options.version).group(1) diff --git a/browser/extensions/pdfjs/content/PdfJs.jsm b/browser/extensions/pdfjs/content/PdfJs.jsm index 3da955ceb7..f01502c34f 100644 --- a/browser/extensions/pdfjs/content/PdfJs.jsm +++ b/browser/extensions/pdfjs/content/PdfJs.jsm @@ -41,7 +41,7 @@ const PDF_CONTENT_TYPE = 'application/pdf'; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/Services.jsm'); -let Svc = {}; +var Svc = {}; XPCOMUtils.defineLazyServiceGetter(Svc, 'mime', '@mozilla.org/mime;1', 'nsIMIMEService'); @@ -144,7 +144,7 @@ Factory.prototype = { } }; -let PdfJs = { +var PdfJs = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), _registered: false, _initialized: false, diff --git a/browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm b/browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm index 3fb6b85d27..77a02cc3ca 100644 --- a/browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm +++ b/browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm @@ -30,7 +30,7 @@ const PDF_CONTENT_TYPE = 'application/pdf'; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/Services.jsm'); -let Svc = {}; +var Svc = {}; XPCOMUtils.defineLazyServiceGetter(Svc, 'mime', '@mozilla.org/mime;1', 'nsIMIMEService'); @@ -53,7 +53,7 @@ var DEFAULT_PREFERENCES = { }; -let PdfjsChromeUtils = { +var PdfjsChromeUtils = { // For security purposes when running remote, we restrict preferences // content can access. _allowedPrefNames: Object.keys(DEFAULT_PREFERENCES), diff --git a/browser/extensions/pdfjs/content/PdfjsContentUtils.jsm b/browser/extensions/pdfjs/content/PdfjsContentUtils.jsm index fe4a6540a0..3dec5f3890 100644 --- a/browser/extensions/pdfjs/content/PdfjsContentUtils.jsm +++ b/browser/extensions/pdfjs/content/PdfjsContentUtils.jsm @@ -27,7 +27,7 @@ const Cu = Components.utils; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/Services.jsm'); -let PdfjsContentUtils = { +var PdfjsContentUtils = { _mm: null, /* diff --git a/build/Makefile.in b/build/Makefile.in index b0261635f0..7b225eb348 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -9,11 +9,6 @@ include $(topsrcdir)/config/makefiles/makeutils.mk ifdef MOZ_APP_BASENAME APP_INI_DEPS = $(topsrcdir)/config/milestone.txt -MOZ_APP_BUILDID := $(shell cat $(DEPTH)/config/buildid) -APP_INI_DEPS += $(DEPTH)/config/buildid - -DEFINES += -DMOZ_APP_BUILDID=$(MOZ_APP_BUILDID) - APP_INI_DEPS += $(DEPTH)/config/autoconf.mk MOZ_SOURCE_STAMP := $(firstword $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg parent --template='{node}\n' 2>/dev/null)) diff --git a/build/application.ini b/build/application.ini index 70b7d90e16..93607d1ea8 100644 --- a/build/application.ini +++ b/build/application.ini @@ -15,6 +15,7 @@ ; file, You can obtain one at http://mozilla.org/MPL/2.0/. #endif #filter substitution +#include @TOPOBJDIR@/buildid.h [App] #ifdef MC_OFFICIAL Vendor=Moonchild Productions @@ -30,7 +31,7 @@ Version=@MOZ_APP_VERSION@ #ifdef MOZ_APP_PROFILE Profile=@MOZ_APP_PROFILE@ #endif -BuildID=@MOZ_APP_BUILDID@ +BuildID=@MOZ_BUILDID@ #ifdef MOZ_SOURCE_REPO SourceRepository=@MOZ_SOURCE_REPO@ #endif @@ -51,5 +52,5 @@ EnableProfileMigrator=1 #if MOZ_CRASHREPORTER [Crash Reporter] Enabled=1 -ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSION@&buildid=@MOZ_APP_BUILDID@ +ServerURL=https://crash-reports.mozilla.com/submit?id=@MOZ_APP_ID@&version=@MOZ_APP_VERSION@&buildid=@MOZ_BUILDID@ #endif diff --git a/build/moz.build b/build/moz.build index 21ea098ce7..4341880b40 100644 --- a/build/moz.build +++ b/build/moz.build @@ -75,3 +75,5 @@ if CONFIG['MOZ_APP_BASENAME']: FINAL_TARGET_PP_FILES += ['application.ini'] if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']: FINAL_TARGET_PP_FILES += ['update-settings.ini'] + +DEFINES['TOPOBJDIR'] = TOPOBJDIR diff --git a/build/unix/elfhack/inject/moz.build b/build/unix/elfhack/inject/moz.build index 36b93bb637..60a8f6a7fb 100644 --- a/build/unix/elfhack/inject/moz.build +++ b/build/unix/elfhack/inject/moz.build @@ -4,6 +4,10 @@ # 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/. +# dummy library name to avoid skipping building the source here, which +# we only need the object for. +Library('elfhack_inject') + DIST_INSTALL = False if CONFIG['TARGET_CPU'].endswith('86'): diff --git a/build/variables.py b/build/variables.py new file mode 100644 index 0000000000..e22de41392 --- /dev/null +++ b/build/variables.py @@ -0,0 +1,30 @@ +# 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/. + +from __future__ import print_function, unicode_literals + +import os +import sys +from datetime import datetime + + +def buildid_header(output): + buildid = os.environ.get('MOZ_BUILD_DATE') + if buildid and len(buildid) != 14: + print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr) + buildid = None + if not buildid: + buildid = datetime.now().strftime('%Y%m%d%H%M%S') + output.write("#define MOZ_BUILDID %s\n" % buildid) + + +def main(args): + if (len(args)): + func = globals().get(args[0]) + if func: + return func(sys.stdout, *args[1:]) + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/client.mk b/client.mk index 54c0cffe7e..61ec3bcec5 100644 --- a/client.mk +++ b/client.mk @@ -238,7 +238,7 @@ profiledbuild:: ifdef MOZ_UNIFY_BDATE ifndef MOZ_BUILD_DATE ifdef MOZ_BUILD_PROJECTS -MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid) +MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/build/variables.py buildid_header | awk '{print $$3}') export MOZ_BUILD_DATE endif endif diff --git a/config/Makefile.in b/config/Makefile.in index 4f5d1430c9..c8e145cace 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -30,32 +30,8 @@ INSTALL_TARGETS += NSINSTALL endif endif -ifndef JS_STANDALONE -HEADERS_FILES = \ - $(DEPTH)/mozilla-config.h \ - $(NULL) -HEADERS_DEST := $(DIST)/include -HEADERS_TARGET := export -INSTALL_TARGETS += HEADERS -endif - include $(topsrcdir)/config/rules.mk -ifndef JS_STANDALONE -ifndef MOZ_PROFILE_USE -# Generate a new buildid every time we "export" in config... that's only -# supposed to be once per-build! -export:: buildid - -buildid: FORCE -ifdef MOZ_BUILD_DATE - printf '%s' $(MOZ_BUILD_DATE) > buildid -else - $(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid > buildid -endif -endif -endif - ifdef WRAP_SYSTEM_INCLUDES export-preqs = \ $(call mkdir_deps,system_wrappers) \ diff --git a/config/baseconfig.mk b/config/baseconfig.mk index af33be2fdc..7883d57107 100644 --- a/config/baseconfig.mk +++ b/config/baseconfig.mk @@ -122,7 +122,7 @@ _DEPRECATED_VARIABLES := \ $(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES) $(_DEPRECATED_VARIABLES),$(eval $(var)_FROZEN := '$($(var))')) -TIERS := export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools +TIERS := pre-export export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools endif # These defines are used to support the twin-topsrcdir model for comm-central. diff --git a/config/config.mk b/config/config.mk index b7765f7ad2..c5da282f1a 100644 --- a/config/config.mk +++ b/config/config.mk @@ -209,8 +209,6 @@ ifndef MOZ_DEBUG # Used for generating an optimized build with debugging symbols. # Used in the Windows nightlies to generate symbols for crash reporting. ifdef MOZ_DEBUG_SYMBOLS -OS_CXXFLAGS += -UDEBUG -DNDEBUG -OS_CFLAGS += -UDEBUG -DNDEBUG ifdef HAVE_64BIT_BUILD OS_LDFLAGS += -DEBUG -OPT:REF,ICF else @@ -220,10 +218,8 @@ endif # # Handle DMD in optimized builds. -# No opt to give sane callstacks. # ifdef MOZ_DMD -MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG ifdef HAVE_64BIT_BUILD OS_LDFLAGS = -DEBUG -OPT:REF,ICF else @@ -385,49 +381,6 @@ CXXFLAGS += $(WARNINGS_AS_ERRORS) CFLAGS += $(WARNINGS_AS_ERRORS) endif # ALLOW_COMPILER_WARNINGS -ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_) -#// Currently, unless USE_STATIC_LIBS is defined, the multithreaded -#// DLL version of the RTL is used... -#// -#//------------------------------------------------------------------------ -ifdef MOZ_ASAN -# ASAN-instrumented code tries to link against the dynamic CRT, which can't be -# used in the same link as the static CRT. -USE_STATIC_LIBS= -endif # MOZ_ASAN - -ifdef USE_STATIC_LIBS -RTL_FLAGS=-MT # Statically linked multithreaded RTL -ifdef MOZ_DEBUG -ifndef MOZ_NO_DEBUG_RTL -RTL_FLAGS=-MTd # Statically linked multithreaded MSVC4.0 debug RTL -endif -endif # MOZ_DEBUG - -else # !USE_STATIC_LIBS - -RTL_FLAGS=-MD # Dynamically linked, multithreaded RTL -ifdef MOZ_DEBUG -ifndef MOZ_NO_DEBUG_RTL -RTL_FLAGS=-MDd # Dynamically linked, multithreaded MSVC4.0 debug RTL -endif -endif # MOZ_DEBUG -endif # USE_STATIC_LIBS -endif # WINNT && !GNU_CC - -ifeq ($(OS_ARCH),Darwin) -# Compiling ObjC requires an Apple compiler anyway, so it's ok to set -# host CMFLAGS here. -HOST_CMFLAGS += -fobjc-exceptions -HOST_CMMFLAGS += -fobjc-exceptions -OS_COMPILE_CMFLAGS += -fobjc-exceptions -OS_COMPILE_CMMFLAGS += -fobjc-exceptions -ifeq ($(MOZ_WIDGET_TOOLKIT),uikit) -OS_COMPILE_CMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch -OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch -endif -endif - COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(_DEPEND_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS) COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(_DEPEND_CFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS) COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS) diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in index 1f39a698fb..0285654538 100644 --- a/config/external/nss/Makefile.in +++ b/config/external/nss/Makefile.in @@ -353,31 +353,6 @@ ifdef MOZ_FOLD_LIBS # Add all static libraries for nss, smime, ssl and nssutil STATIC_LIBS += $(addprefix $(DEPTH)/security/,$(NSS_STATIC_LIBS)) -nss_def_file := $(srcdir)/nss.def - -ifeq (WINNT,$(OS_TARGET)) -# Create a .def file based on the various .def files for nss, smime, ssl and -# nssutil. -nss3.def: $(nss_def_file) $(DEPTH)/db/sqlite3/src/sqlite-processed.def $(NSS_EXTRA_SYMBOLS_FILE) - echo LIBRARY nss3$(DLL_SUFFIX) > $@.tmp - echo EXPORTS >> $@.tmp - grep -v -h -e ^LIBRARY -e ^EXPORTS -e ^\; $^ >> $@.tmp - mv $@.tmp $@ -else -ifdef GCC_USE_GNU_LD -sqlite_def_file := $(topsrcdir)/db/sqlite3/src/sqlite.def -nspr_def_file := $(srcdir)/nspr-dummy.def - -nss3.def: $(nss_def_file) $(sqlite_def_file) $(nspr_def_file) $(NSS_EXTRA_SYMBOLS_FILE) - @$(call py_action,convert_def_file, \ - $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) -o $@ $^) - -GARBAGE += \ - nss3.def \ - $(NULL) -endif # GCC_USE_GNU_LD -endif # WINNT - IMPORT_LIB_FILES = $(IMPORT_LIBRARY) IMPORT_LIB_DEST ?= $(DIST)/lib IMPORT_LIB_TARGET = target diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build index 9af8c4ba32..771910f319 100644 --- a/config/external/nss/moz.build +++ b/config/external/nss/moz.build @@ -24,11 +24,7 @@ elif CONFIG['MOZ_FOLD_LIBS']: OS_LIBS += CONFIG['REALTIME_LIBS'] - if CONFIG['OS_TARGET'] == 'WINNT': - DEFFILE = 'nss3.def' - - if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['GCC_USE_GNU_LD']: - LD_VERSION_SCRIPT = 'nss3.def' + SYMBOLS_FILE = 'nss.symbols' else: Library('nss') USE_LIBS += [ @@ -41,3 +37,6 @@ else: # XXX: We should fix these warnings. ALLOW_COMPILER_WARNINGS = True + +if CONFIG['NSS_EXTRA_SYMBOLS_FILE']: + DEFINES['NSS_EXTRA_SYMBOLS_FILE'] = CONFIG['NSS_EXTRA_SYMBOLS_FILE'] diff --git a/config/external/nss/nspr-dummy.def b/config/external/nss/nspr-dummy.def deleted file mode 100644 index b14fcf82c8..0000000000 --- a/config/external/nss/nspr-dummy.def +++ /dev/null @@ -1,15 +0,0 @@ -; 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 is a fake .def file, to be used for generating linker scripts -; for our folded libnss when MOZ_FOLD_LIBS. NSPR, unlike NSS, exports -; symbols with symbol visibility (Unix) or __declspec (Windows). When -; using a linker script, however, we need to explicitly specify that -; NSPR's symbols should be globally visible. Otherwise, NSPR's exported -; symbols would match the |local: *| rule and be hidden. -LIBRARY libnsprdummy -EXPORTS -PR_* ; Actual .def files don't allow wildcards, of course. -_PR_* -PL_* diff --git a/config/external/nss/nss.def b/config/external/nss/nss.symbols similarity index 89% rename from config/external/nss/nss.def rename to config/external/nss/nss.symbols index 6274575184..52be66ba98 100644 --- a/config/external/nss/nss.def +++ b/config/external/nss/nss.symbols @@ -1,11 +1,19 @@ -; 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 is a fake .def file, to be used for generating linker scripts -; for our folded libnss when MOZ_FOLD_LIBS. -LIBRARY nss3 -EXPORTS +# 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/. + +#ifndef XP_WIN +# NSPR, unlike NSS, exports symbols with symbol visibility (Unix) or __declspec +# (Windows). When using a linker script, however, we need to explicitly +# specify that NSPR's symbols should be globally visible. Otherwise, NSPR's +# exported symbols would be hidden. +# .def files on Windows don't allow wildcards, of course, which is why this is +# excluded on Windows, but it doesn't matter because the symbols are already +# exported in NSPR (Windows peculiarity). +PR_* +PL_* +#endif +#include ../../../db/sqlite3/src/sqlite.symbols ATOB_AsciiToData ATOB_AsciiToData_Util ATOB_ConvertAsciiToItem @@ -21,8 +29,8 @@ __CERT_AddTempCertToPerm CERT_AsciiToName CERT_CacheOCSPResponseFromSideChannel CERT_CertChainFromCert -CERT_CertificateRequestTemplate DATA -CERT_CertificateTemplate DATA +CERT_CertificateRequestTemplate @DATA@ +CERT_CertificateTemplate @DATA@ CERT_CertListFromCert CERT_ChangeCertTrust CERT_CheckCertUsage @@ -38,7 +46,7 @@ CERT_CreateCertificate CERT_CreateCertificateRequest CERT_CreateSubjectCertList CERT_CreateValidity -CERT_CrlTemplate DATA +CERT_CrlTemplate @DATA@ CERT_DecodeAltNameExtension CERT_DecodeAuthInfoAccessExtension CERT_DecodeAuthKeyID @@ -128,7 +136,7 @@ CERT_IsCACert CERT_IsUserCert CERT_MakeCANickname CERT_MergeExtensions -CERT_NameTemplate DATA +CERT_NameTemplate @DATA@ CERT_NameToAscii CERT_NewCertList CERT_NewTempCertificate @@ -138,15 +146,15 @@ CERT_PKIXVerifyCert CERT_RemoveCertListNode CERT_RFC1485_EscapeAndQuote CERT_SaveSMimeProfile -CERT_SequenceOfCertExtensionTemplate DATA +CERT_SequenceOfCertExtensionTemplate @DATA@ CERT_SetOCSPFailureMode CERT_SetOCSPTimeout -CERT_SignedCrlTemplate DATA -CERT_SignedDataTemplate DATA +CERT_SignedCrlTemplate @DATA@ +CERT_SignedDataTemplate @DATA@ CERT_StartCertExtensions CERT_StartCertificateRequestAttributes -CERT_SubjectPublicKeyInfoTemplate DATA -CERT_TimeChoiceTemplate DATA +CERT_SubjectPublicKeyInfoTemplate @DATA@ +CERT_TimeChoiceTemplate @DATA@ CERT_VerifyCertificate CERT_VerifySignedDataWithPublicKeyInfo DER_AsciiToTime_Util @@ -469,7 +477,7 @@ PORT_ZAlloc PORT_ZAllocAlignedOffset_Util PORT_ZAlloc_Util PORT_ZFree_Util -SEC_AnyTemplate_Util DATA +SEC_AnyTemplate_Util @DATA@ SEC_ASN1Decode SEC_ASN1DecodeInteger SEC_ASN1DecodeItem @@ -480,20 +488,20 @@ SEC_ASN1EncodeItem SEC_ASN1EncodeItem_Util SEC_ASN1EncodeUnsignedInteger_Util SEC_ASN1Encode_Util -SEC_BitStringTemplate DATA -SEC_BitStringTemplate_Util DATA -SEC_BMPStringTemplate DATA -SEC_BooleanTemplate_Util DATA +SEC_BitStringTemplate @DATA@ +SEC_BitStringTemplate_Util @DATA@ +SEC_BMPStringTemplate @DATA@ +SEC_BooleanTemplate_Util @DATA@ SEC_CertNicknameConflict SEC_DeletePermCertificate SEC_DerSignData SEC_DestroyCrl -SEC_GeneralizedTimeTemplate_Util DATA +SEC_GeneralizedTimeTemplate_Util @DATA@ SEC_GetSignatureAlgorithmOidTag -SEC_IA5StringTemplate DATA -SEC_IA5StringTemplate_Util DATA -SEC_IntegerTemplate DATA -SEC_IntegerTemplate_Util DATA +SEC_IA5StringTemplate @DATA@ +SEC_IA5StringTemplate_Util @DATA@ +SEC_IntegerTemplate @DATA@ +SEC_IntegerTemplate_Util @DATA@ SECITEM_AllocArray SECITEM_AllocItem SECITEM_AllocItem_Util @@ -531,7 +539,7 @@ SECKEY_ExtractPublicKey SECKEY_GetPublicKeyType SECKEY_ImportDERPublicKey SECKEY_PublicKeyStrength -SECKEY_RSAPSSParamsTemplate DATA +SECKEY_RSAPSSParamsTemplate @DATA@ SECKEY_SignatureLen SECMIME_DecryptionAllowed SECMOD_AddNewModule @@ -562,14 +570,14 @@ SECMOD_ReleaseReadLock SECMOD_UnloadUserModule SECMOD_UpdateModule SECMOD_WaitForAnyTokenEvent -SEC_NullTemplate_Util DATA -SEC_ObjectIDTemplate_Util DATA -SEC_OctetStringTemplate DATA -SEC_OctetStringTemplate_Util DATA +SEC_NullTemplate_Util @DATA@ +SEC_ObjectIDTemplate_Util @DATA@ +SEC_OctetStringTemplate @DATA@ +SEC_OctetStringTemplate_Util @DATA@ SECOID_AddEntry SECOID_AddEntry_Util -SECOID_AlgorithmIDTemplate DATA -SECOID_AlgorithmIDTemplate_Util DATA +SECOID_AlgorithmIDTemplate @DATA@ +SECOID_AlgorithmIDTemplate_Util @DATA@ SECOID_CopyAlgorithmID_Util SECOID_DestroyAlgorithmID SECOID_DestroyAlgorithmID_Util @@ -625,10 +633,10 @@ SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util SEC_RegisterDefaultHttpClient SEC_SignData -SEC_SignedCertificateTemplate DATA +SEC_SignedCertificateTemplate @DATA@ SEC_StringToOID -SEC_UTF8StringTemplate DATA -SEC_UTF8StringTemplate_Util DATA +SEC_UTF8StringTemplate @DATA@ +SEC_UTF8StringTemplate_Util @DATA@ SGN_Begin SGN_CreateDigestInfo_Util SGN_DecodeDigestInfo @@ -657,10 +665,10 @@ SSL_GetNumImplementedCiphers SSL_GetSRTPCipher SSL_HandshakeCallback SSL_HandshakeNegotiatedExtension -SSL_ImplementedCiphers DATA +SSL_ImplementedCiphers @DATA@ SSL_ImportFD SSL_NamedGroupConfig -SSL_NumImplementedCiphers DATA +SSL_NumImplementedCiphers @DATA@ SSL_OptionSet SSL_OptionSetDefault SSL_PeerCertificate @@ -690,3 +698,6 @@ VFY_VerifyData VFY_VerifyDataWithAlgorithmID VFY_VerifyDigestDirect _SGN_VerifyPKCS1DigestInfo +#ifdef NSS_EXTRA_SYMBOLS_FILE +#include @NSS_EXTRA_SYMBOLS_FILE@ +#endif diff --git a/config/external/sqlite/Makefile.in b/config/external/sqlite/Makefile.in index 02dde0576d..55fa736189 100644 --- a/config/external/sqlite/Makefile.in +++ b/config/external/sqlite/Makefile.in @@ -3,26 +3,3 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. LIB_IS_C_ONLY = 1 - -include $(topsrcdir)/config/config.mk - -ifeq ($(OS_ARCH),WINNT) -# This needs to stay there for now -DEFFILE = $(DEPTH)/db/sqlite3/src/sqlite-processed.def - -else -ifndef MOZ_FOLD_LIBS -ifdef GCC_USE_GNU_LD - -GARBAGE += \ - $(LD_VERSION_SCRIPT) \ - $(NULL) - -# Convert to the format we need for ld. -$(LD_VERSION_SCRIPT): $(topsrcdir)/db/sqlite3/src/sqlite.def - @$(call py_action,convert_def_file, \ - $(DEFINES) $(ACDEFINES) $(MOZ_DEBUG_DEFINES) -o $@ $^) - -endif -endif -endif diff --git a/config/external/sqlite/moz.build b/config/external/sqlite/moz.build index b6f500727f..97aeba1581 100644 --- a/config/external/sqlite/moz.build +++ b/config/external/sqlite/moz.build @@ -19,5 +19,4 @@ else: SharedLibrary('sqlite') SHARED_LIBRARY_NAME = 'mozsqlite3' - if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['GCC_USE_GNU_LD']: - LD_VERSION_SCRIPT = 'sqlite-processed.def' + SYMBOLS_FILE = '/db/sqlite3/src/sqlite.symbols' diff --git a/config/faster/rules.mk b/config/faster/rules.mk index 87b9257298..a5f0790449 100644 --- a/config/faster/rules.mk +++ b/config/faster/rules.mk @@ -37,11 +37,6 @@ # Targets to be triggered for a default build default: $(addprefix install-,$(INSTALL_MANIFESTS)) -# Explicit files to be built for a default build -ifndef TEST_MOZBUILD -default: $(TOPOBJDIR)/dist/bin/platform.ini -endif - ifndef NO_XPIDL # Targets from the recursive make backend to be built for a default build default: $(TOPOBJDIR)/config/makefiles/xpidl/xpidl @@ -72,13 +67,6 @@ ACDEFINES += -DBUILD_FASTER # fallback $(TOPOBJDIR)/faster/%: ; -# And files under dist/ are meant to be copied from their first dependency -# if there is no other rule. -$(TOPOBJDIR)/dist/%: - rm -f $@ - mkdir -p $(@D) - cp $< $@ - # Generic rule to fall back to the recursive make backend. # This needs to stay after other $(TOPOBJDIR)/* rules because GNU Make # <3.82 apply pattern rules in definition order, not stem length like @@ -92,7 +80,7 @@ $(TOPOBJDIR)/%: FORCE # corresponding install manifests are named correspondingly, with forward # slashes replaced with underscores, and prefixed with `install_`. That is, # the install manifest for `dist/bin` would be `install_dist_bin`. -$(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/buildid +$(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/buildid.h @# For now, force preprocessed files to be reprocessed every time. @# The overhead is not that big, and this avoids waiting for proper @# support for defines tracking in process_install_manifest. @@ -103,7 +91,6 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/build $(TOPOBJDIR)/$* \ -DAB_CD=en-US \ -DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/browser/locales/en-US/profile \ - -DMOZ_APP_BUILDID=$(shell cat $(TOPOBJDIR)/config/buildid) \ $(ACDEFINES) \ install_$(subst /,_,$*) @@ -111,11 +98,13 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/build # Below is a set of additional dependencies and variables used to build things # that are not supported by data in moz.build. -# Files to build with the recursive backend and simply copy -$(TOPOBJDIR)/dist/bin/platform.ini: $(TOPOBJDIR)/toolkit/xre/platform.ini - -$(TOPOBJDIR)/toolkit/xre/platform.ini: $(TOPOBJDIR)/config/buildid - # The xpidl target in config/makefiles/xpidl requires the install manifest for -# dist/idl to have been processed. +# dist/idl to have been processed. When using the hybrid +# FasterMake/RecursiveMake backend, this dependency is handled in the top-level +# Makefile. +ifndef FASTER_RECURSIVE_MAKE $(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(TOPOBJDIR)/install-dist_idl +endif +# It also requires all the install manifests for dist/bin to have been processed +# because it adds interfaces.manifest references with buildlist.py. +$(TOPOBJDIR)/config/makefiles/xpidl/xpidl: $(addprefix install-,$(filter dist/bin%,$(INSTALL_MANIFESTS))) diff --git a/config/version_win.pl b/config/version_win.pl index 8c0231edc6..252215a967 100755 --- a/config/version_win.pl +++ b/config/version_win.pl @@ -114,7 +114,7 @@ if (!defined($module)) my $bufferstr=" "; my $MILESTONE_FILE = "$topsrcdir/config/milestone.txt"; -my $BUILDID_FILE = "$depth/config/buildid"; +my $BUILDID_FILE = "$depth/buildid.h"; #Read module.ver file #Version file overrides for WIN32: @@ -183,7 +183,7 @@ $displayname =~ s/^\s*(.*)\s*$/$1/; open(BUILDID, "<", $BUILDID_FILE) || die("Couldn't open buildid file: $BUILDID_FILE"); $buildid = ; -$buildid =~ s/\s*$//; +$buildid =~ s/^#define MOZ_BUILDID\s+(\S+)\s*$/$1/; close BUILDID; my $daycount = daysFromBuildID($buildid); diff --git a/configure.in b/configure.in index 44ae0d9779..b0598d2380 100644 --- a/configure.in +++ b/configure.in @@ -96,8 +96,7 @@ dnl ============================================================== _topsrcdir=`cd \`dirname $0\`; pwd -W 2>/dev/null || pwd -P` _objdir=`pwd -P` -dnl TODO Don't exempt L10N builds once bug 842760 is resolved. -if test "$_topsrcdir" = "$_objdir" -a "${with_l10n_base+set}" != set; then +if test "$_topsrcdir" = "$_objdir"; then echo " ***" echo " * Building directly in the main source directory is not allowed." echo " *" @@ -353,7 +352,11 @@ if test -n "$gonkdir" ; then direct_nspr_config=1 android_cxx_stl=mozstlport else - MOZ_ANDROID_NDK + if test "$COMPILE_ENVIRONMENT"; then + MOZ_ANDROID_NDK + else + AC_DEFINE(ANDROID) + fi # COMPILE_ENVIRONMENT case "$target" in *-android*|*-linuxandroid*) @@ -1203,7 +1206,14 @@ esac dnl Configure platform-specific CPU architecture compiler options. dnl ============================================================== -MOZ_ARCH_OPTS +if test "$COMPILE_ENVIRONMENT"; then + MOZ_ARCH_OPTS +else + if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then + dnl Default Android builds to ARMv7. + MOZ_ARCH=armv7-a + fi +fi # COMPILE_ENVIRONMENT dnl ================================================================= dnl Set up and test static assertion macros used to avoid AC_TRY_RUN, @@ -1252,7 +1262,10 @@ dnl Android libstdc++, placed here so it can use MOZ_ARCH dnl computed above. dnl ======================================================== -MOZ_ANDROID_STLPORT +MOZ_ANDROID_CPU_ARCH +if test "$COMPILE_ENVIRONMENT"; then + MOZ_ANDROID_STLPORT +fi # COMPILE_ENVIRONMENT dnl ======================================================== dnl = Nightly build @@ -1839,6 +1852,7 @@ case "$target" in AC_DEFINE(XP_IOS) AC_DEFINE(XP_DARWIN) _PLATFORM_DEFAULT_TOOLKIT='cairo-uikit' + direct_nspr_config=1 else AC_DEFINE(XP_MACOSX) AC_DEFINE(XP_DARWIN) @@ -2055,12 +2069,12 @@ ia64*-hpux*) _USE_CPP_INCLUDE_FLAG=1 _DEFINES_CFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT' _DEFINES_CXXFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT' + SSE_FLAGS="-arch:SSE" + SSE2_FLAGS="-arch:SSE2" CFLAGS="$CFLAGS -W3 -Gy" CXXFLAGS="$CXXFLAGS -W3 -Gy" - if test "$CPU_ARCH" = "x86" -a -z "$CLANG_CL"; then + if test "$CPU_ARCH" = "x86"; then dnl VS2012+ defaults to -arch:SSE2. - dnl Clang-cl gets confused by -arch:IA32, so don't add it. - dnl (See https://llvm.org/bugs/show_bug.cgi?id=24335) CFLAGS="$CFLAGS -arch:IA32" CXXFLAGS="$CXXFLAGS -arch:IA32" fi @@ -2444,6 +2458,7 @@ esac if test -z "$COMPILE_ENVIRONMENT"; then SKIP_COMPILER_CHECKS=1 SKIP_LIBRARY_CHECKS=1 + PKG_SKIP_STRIP=1 else MOZ_COMPILER_OPTS fi # COMPILE_ENVIRONMENT @@ -8553,6 +8568,19 @@ AC_SUBST(MOZ_NATIVE_NSPR) AC_SUBST(MOZ_NATIVE_NSS) AC_SUBST(NSS_DISABLE_DBM) +HOST_CMFLAGS=-fobjc-exceptions +HOST_CMMFLAGS=-fobjc-exceptions +OS_COMPILE_CMFLAGS=-fobjc-exceptions +OS_COMPILE_CMMFLAGS=-fobjc-exceptions +if test "$MOZ_WIDGET_TOOLKIT" = uikit; then + OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch" + OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch" +fi +AC_SUBST(HOST_CMFLAGS) +AC_SUBST(HOST_CMMFLAGS) +AC_SUBST(OS_COMPILE_CMFLAGS) +AC_SUBST(OS_COMPILE_CMMFLAGS) + OS_CFLAGS="$CFLAGS" OS_CXXFLAGS="$CXXFLAGS" OS_CPPFLAGS="$CPPFLAGS" diff --git a/db/sqlite3/src/Makefile.in b/db/sqlite3/src/Makefile.in deleted file mode 100644 index 338fc0c2a8..0000000000 --- a/db/sqlite3/src/Makefile.in +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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/. - -include $(topsrcdir)/config/config.mk - -ifeq ($(OS_ARCH),WINNT) -DEFFILE = $(CURDIR)/sqlite-processed.def - -GARBAGE += \ - $(DEFFILE) \ - $(NULL) - -# We have to preprocess our def file because we need different symbols in debug -# builds exposed that are not built in non-debug builds. -$(DEFFILE): sqlite.def - @$(call py_action,preprocessor,$(DEFINES) $(MOZ_DEBUG_DEFINES) \ - $(srcdir)/sqlite.def -o $(DEFFILE)) -endif diff --git a/db/sqlite3/src/sqlite.def b/db/sqlite3/src/sqlite.def deleted file mode 100644 index 56d8001f53..0000000000 --- a/db/sqlite3/src/sqlite.def +++ /dev/null @@ -1,162 +0,0 @@ -; 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/. - -LIBRARY mozsqlite3.dll - -EXPORTS - sqlite3_aggregate_context - sqlite3_aggregate_count - sqlite3_auto_extension - sqlite3_bind_blob - sqlite3_bind_double - sqlite3_bind_int - sqlite3_bind_int64 - sqlite3_bind_null - sqlite3_bind_parameter_count - sqlite3_bind_parameter_index - sqlite3_bind_parameter_name - sqlite3_bind_text - sqlite3_bind_text16 - sqlite3_bind_value - sqlite3_busy_handler - sqlite3_busy_timeout - sqlite3_changes - sqlite3_clear_bindings - sqlite3_close - sqlite3_collation_needed - sqlite3_collation_needed16 - sqlite3_column_blob - sqlite3_column_bytes - sqlite3_column_bytes16 - sqlite3_column_count - sqlite3_column_decltype - sqlite3_column_decltype16 - sqlite3_column_double - sqlite3_column_int - sqlite3_column_int64 - sqlite3_column_name - sqlite3_column_name16 - sqlite3_column_text - sqlite3_column_text16 - sqlite3_column_type - sqlite3_column_value - sqlite3_commit_hook - sqlite3_complete - sqlite3_complete16 - sqlite3_config - sqlite3_create_collation - sqlite3_create_collation16 - sqlite3_create_function - sqlite3_create_function16 - sqlite3_create_module - sqlite3_data_count - sqlite3_db_filename - sqlite3_db_handle - sqlite3_db_mutex - sqlite3_db_status - sqlite3_declare_vtab - sqlite3_enable_load_extension - sqlite3_enable_shared_cache - sqlite3_errcode - sqlite3_errmsg - sqlite3_errmsg16 - sqlite3_exec - sqlite3_expired - sqlite3_extended_result_codes - sqlite3_file_control - sqlite3_finalize - sqlite3_free - sqlite3_free_table - sqlite3_get_autocommit - sqlite3_get_auxdata - sqlite3_get_table - sqlite3_global_recover - sqlite3_initialize - sqlite3_interrupt - sqlite3_last_insert_rowid - sqlite3_libversion - sqlite3_libversion_number - sqlite3_load_extension - sqlite3_malloc - sqlite3_memory_alarm - sqlite3_memory_highwater - sqlite3_memory_used - sqlite3_mutex_alloc - sqlite3_mutex_enter - sqlite3_mutex_free - sqlite3_mutex_leave - sqlite3_mutex_try - sqlite3_mprintf - sqlite3_next_stmt - sqlite3_open - sqlite3_open_v2 - sqlite3_open16 - sqlite3_overload_function - sqlite3_prepare - sqlite3_prepare16 - sqlite3_prepare16_v2 - sqlite3_prepare_v2 - sqlite3_profile - sqlite3_progress_handler - sqlite3_realloc - sqlite3_release_memory - sqlite3_reset - sqlite3_reset_auto_extension - sqlite3_result_blob - sqlite3_result_double - sqlite3_result_error - sqlite3_result_error16 - sqlite3_result_error_code - sqlite3_result_error_nomem - sqlite3_result_int - sqlite3_result_int64 - sqlite3_result_null - sqlite3_result_text - sqlite3_result_text16 - sqlite3_result_text16be - sqlite3_result_text16le - sqlite3_result_value - sqlite3_rollback_hook - sqlite3_set_authorizer - sqlite3_set_auxdata - sqlite3_shutdown - sqlite3_sleep - sqlite3_snprintf - sqlite3_sql - sqlite3_status - sqlite3_step - sqlite3_stmt_readonly - sqlite3_stmt_status -#ifdef XP_UNIX - sqlite3_temp_directory -#endif - sqlite3_thread_cleanup - sqlite3_total_changes - sqlite3_trace - sqlite3_transfer_bindings - sqlite3_unlock_notify - sqlite3_update_hook - sqlite3_uri_parameter - sqlite3_user_data - sqlite3_value_blob - sqlite3_value_bytes - sqlite3_value_bytes16 - sqlite3_value_double - sqlite3_value_int - sqlite3_value_int64 - sqlite3_value_numeric_type - sqlite3_value_text - sqlite3_value_text16 - sqlite3_value_text16be - sqlite3_value_text16le - sqlite3_value_type - sqlite3_version - sqlite3_vfs_find - sqlite3_vfs_unregister - sqlite3_vfs_register - sqlite3_vmprintf -#ifdef DEBUG - sqlite3_mutex_held - sqlite3_mutex_notheld -#endif diff --git a/db/sqlite3/src/sqlite.symbols b/db/sqlite3/src/sqlite.symbols new file mode 100644 index 0000000000..edd000a97c --- /dev/null +++ b/db/sqlite3/src/sqlite.symbols @@ -0,0 +1,159 @@ +# 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/. + +sqlite3_aggregate_context +sqlite3_aggregate_count +sqlite3_auto_extension +sqlite3_bind_blob +sqlite3_bind_double +sqlite3_bind_int +sqlite3_bind_int64 +sqlite3_bind_null +sqlite3_bind_parameter_count +sqlite3_bind_parameter_index +sqlite3_bind_parameter_name +sqlite3_bind_text +sqlite3_bind_text16 +sqlite3_bind_value +sqlite3_busy_handler +sqlite3_busy_timeout +sqlite3_changes +sqlite3_clear_bindings +sqlite3_close +sqlite3_collation_needed +sqlite3_collation_needed16 +sqlite3_column_blob +sqlite3_column_bytes +sqlite3_column_bytes16 +sqlite3_column_count +sqlite3_column_decltype +sqlite3_column_decltype16 +sqlite3_column_double +sqlite3_column_int +sqlite3_column_int64 +sqlite3_column_name +sqlite3_column_name16 +sqlite3_column_text +sqlite3_column_text16 +sqlite3_column_type +sqlite3_column_value +sqlite3_commit_hook +sqlite3_complete +sqlite3_complete16 +sqlite3_config +sqlite3_create_collation +sqlite3_create_collation16 +sqlite3_create_function +sqlite3_create_function16 +sqlite3_create_module +sqlite3_data_count +sqlite3_db_filename +sqlite3_db_handle +sqlite3_db_mutex +sqlite3_db_status +sqlite3_declare_vtab +sqlite3_enable_load_extension +sqlite3_enable_shared_cache +sqlite3_errcode +sqlite3_errmsg +sqlite3_errmsg16 +sqlite3_exec +sqlite3_expired +sqlite3_extended_result_codes +sqlite3_file_control +sqlite3_finalize +sqlite3_free +sqlite3_free_table +sqlite3_get_autocommit +sqlite3_get_auxdata +sqlite3_get_table +sqlite3_global_recover +sqlite3_initialize +sqlite3_interrupt +sqlite3_last_insert_rowid +sqlite3_libversion +sqlite3_libversion_number +sqlite3_load_extension +sqlite3_malloc +sqlite3_memory_alarm +sqlite3_memory_highwater +sqlite3_memory_used +sqlite3_mutex_alloc +sqlite3_mutex_enter +sqlite3_mutex_free +sqlite3_mutex_leave +sqlite3_mutex_try +sqlite3_mprintf +sqlite3_next_stmt +sqlite3_open +sqlite3_open_v2 +sqlite3_open16 +sqlite3_overload_function +sqlite3_prepare +sqlite3_prepare16 +sqlite3_prepare16_v2 +sqlite3_prepare_v2 +sqlite3_profile +sqlite3_progress_handler +sqlite3_realloc +sqlite3_release_memory +sqlite3_reset +sqlite3_reset_auto_extension +sqlite3_result_blob +sqlite3_result_double +sqlite3_result_error +sqlite3_result_error16 +sqlite3_result_error_code +sqlite3_result_error_nomem +sqlite3_result_int +sqlite3_result_int64 +sqlite3_result_null +sqlite3_result_text +sqlite3_result_text16 +sqlite3_result_text16be +sqlite3_result_text16le +sqlite3_result_value +sqlite3_rollback_hook +sqlite3_set_authorizer +sqlite3_set_auxdata +sqlite3_shutdown +sqlite3_sleep +sqlite3_snprintf +sqlite3_sql +sqlite3_status +sqlite3_step +sqlite3_stmt_readonly +sqlite3_stmt_status +#ifdef XP_UNIX +sqlite3_temp_directory +#endif +sqlite3_thread_cleanup +sqlite3_total_changes +sqlite3_trace +sqlite3_transfer_bindings +sqlite3_unlock_notify +sqlite3_update_hook +sqlite3_uri_parameter +sqlite3_user_data +sqlite3_value_blob +sqlite3_value_bytes +sqlite3_value_bytes16 +sqlite3_value_double +sqlite3_value_int +sqlite3_value_int64 +sqlite3_value_numeric_type +sqlite3_value_text +sqlite3_value_text16 +sqlite3_value_text16be +sqlite3_value_text16le +sqlite3_value_type +sqlite3_version +sqlite3_vfs_find +sqlite3_vfs_unregister +sqlite3_vfs_register +sqlite3_vmprintf +#ifdef DEBUG +sqlite3_mutex_held +sqlite3_mutex_notheld +#endif diff --git a/devtools/client/debugger/debugger-controller.js b/devtools/client/debugger/debugger-controller.js index 7431e8eac8..ee8ecea9ed 100644 --- a/devtools/client/debugger/debugger-controller.js +++ b/devtools/client/debugger/debugger-controller.js @@ -478,10 +478,10 @@ Workers.prototype = { this._updateWorkerList(); }, - _onWorkerSelect: function (type, workerActor) { + _onWorkerSelect: function (workerActor) { DebuggerController.client.attachWorker(workerActor, (response, workerClient) => { - gDevTools.showToolbox(devtools.TargetFactory.forWorker(workerClient), - "jsdebugger", devtools.Toolbox.HostType.WINDOW); + gDevTools.showToolbox(TargetFactory.forWorker(workerClient), + "jsdebugger", Toolbox.HostType.WINDOW); }); } }; @@ -871,7 +871,7 @@ StackFrames.prototype = { // Customize the scope for holding watch expressions evaluations. scope.descriptorTooltip = false; scope.contextMenuId = "debuggerWatchExpressionsContextMenu"; - scope.separatorStr = L10N.getStr("watchExpressionsSeparatorLabel"); + scope.separatorStr = L10N.getStr("watchExpressionsSeparatorLabel2"); scope.switch = DebuggerView.WatchExpressions.switchExpression; scope.delete = DebuggerView.WatchExpressions.deleteExpression; @@ -968,12 +968,15 @@ StackFrames.prototype = { _insertScopeFrameReferences: function(aScope, aFrame) { // Add any thrown exception. if (this._currentException) { - let excRef = aScope.addItem("", { value: this._currentException }); + let excRef = aScope.addItem("", { value: this._currentException }, + { internalItem: true }); DebuggerView.Variables.controller.addExpander(excRef, this._currentException); } // Add any returned value. if (this._currentReturnedValue) { - let retRef = aScope.addItem("", { value: this._currentReturnedValue }); + let retRef = aScope.addItem("", + { value: this._currentReturnedValue }, + { internalItem: true }); DebuggerView.Variables.controller.addExpander(retRef, this._currentReturnedValue); } // Add "this". diff --git a/devtools/client/debugger/debugger-view.js b/devtools/client/debugger/debugger-view.js index 65a1c259d5..03deba4f8c 100644 --- a/devtools/client/debugger/debugger-view.js +++ b/devtools/client/debugger/debugger-view.js @@ -31,6 +31,7 @@ const SEARCH_AUTOFILL = [SEARCH_GLOBAL_FLAG, SEARCH_FUNCTION_FLAG, SEARCH_TOKEN_ const EDITOR_VARIABLE_HOVER_DELAY = 750; // ms const EDITOR_VARIABLE_POPUP_POSITION = "topcenter bottomleft"; const TOOLBAR_ORDER_POPUP_POSITION = "topcenter bottomleft"; +const FUNCTION_SEARCH_POPUP_POSITION = "topcenter bottomleft"; const RESIZE_REFRESH_RATE = 50; // ms const PROMISE_DEBUGGER_URL = "chrome://devtools/content/promisedebugger/promise-debugger.xhtml"; diff --git a/devtools/client/debugger/test/mochitest/browser.ini b/devtools/client/debugger/test/mochitest/browser.ini index 4c47497263..273299b381 100644 --- a/devtools/client/debugger/test/mochitest/browser.ini +++ b/devtools/client/debugger/test/mochitest/browser.ini @@ -18,6 +18,7 @@ support-files = code_breakpoints-other-tabs.js code_bug-896139.js code_frame-script.js + code_function-jump-01.js code_function-search-01.js code_function-search-02.js code_function-search-03.js @@ -69,6 +70,7 @@ support-files = doc_event-listeners-04.html doc_frame-parameters.html doc_function-display-name.html + doc_function-jump.html doc_function-search.html doc_global-method-override.html doc_iframes.html @@ -256,6 +258,8 @@ skip-if = e10s # TODO skip-if = e10s [browser_dbg_host-layout.js] skip-if = e10s && debug +[browser_dbg_jump-to-function-definition.js] +skip-if = e10s && debug [browser_dbg_iframes.js] skip-if = e10s # TODO [browser_dbg_instruments-pane-collapse.js] diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_jump-to-function-definition.js b/devtools/client/debugger/test/mochitest/browser_dbg_jump-to-function-definition.js new file mode 100644 index 0000000000..9a0d94385d --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg_jump-to-function-definition.js @@ -0,0 +1,45 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Tests if the jump to function definition works properly. + */ + +const TAB_URL = EXAMPLE_URL + "doc_function-jump.html"; +const SCRIPT_URI = EXAMPLE_URL + "code_function-jump-01.js"; + + +function test() { + let gTab, gPanel, gDebugger, gSources; + + initDebugger(TAB_URL).then(([aTab,, aPanel]) => { + gTab = aTab; + gPanel = aPanel; + gDebugger = gPanel.panelWin; + gSources = gDebugger.DebuggerView.Sources; + + waitForSourceShown(gPanel, "-01.js") + .then(jumpToFunctionDefinition) + .then(() => closeDebuggerAndFinish(gPanel)) + .then(null, aError => { + ok(false, "Got an error: " + aError.message + "\n" + aError.stack); + }); + }); + + function jumpToFunctionDefinition() { + let callLocation = {line: 5, ch: 0}; + let editor = gDebugger.DebuggerView.editor; + let coords = editor.getCoordsFromPosition(callLocation); + + gDebugger.DebuggerView.Sources._onMouseDown({ clientX: coords.left, + clientY: coords.top, + metaKey: true }); + + let deferred = promise.defer(); + executeSoon(() => { + is(editor.getDebugLocation(), 1, "foo definition should be highlighted"); + deferred.resolve(); + }); + return deferred.promise; + } +} diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_step-out.js b/devtools/client/debugger/test/mochitest/browser_dbg_step-out.js index e6e38a7697..bf23a35624 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_step-out.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_step-out.js @@ -31,6 +31,9 @@ function testNormalReturn() { "Should have the right property name for the returned value."); is(returnVar.value, 10, "Should have the right property value for the returned value."); + ok(returnVar._internalItem, "Should be an internal item"); + ok(returnVar._target.hasAttribute("pseudo-item"), + "Element should be marked as a pseudo-item") resumeDebuggee().then(() => testReturnWithException()); }); @@ -53,6 +56,9 @@ function testReturnWithException() { "Should have the right property name for the returned value."); is(exceptionVar.value, "boom", "Should have the right property value for the returned value."); + ok(exceptionVar._internalItem, "Should be an internal item"); + ok(exceptionVar._target.hasAttribute("pseudo-item"), + "Element should be marked as a pseudo-item") resumeDebuggee().then(() => closeDebuggerAndFinish(gPanel)); }); diff --git a/devtools/client/debugger/test/mochitest/code_function-jump-01.js b/devtools/client/debugger/test/mochitest/code_function-jump-01.js new file mode 100644 index 0000000000..d3310c5b85 --- /dev/null +++ b/devtools/client/debugger/test/mochitest/code_function-jump-01.js @@ -0,0 +1,6 @@ + +function foo() { + //some function +} + +foo(); diff --git a/devtools/client/debugger/test/mochitest/doc_function-jump.html b/devtools/client/debugger/test/mochitest/doc_function-jump.html new file mode 100644 index 0000000000..0cd99e6620 --- /dev/null +++ b/devtools/client/debugger/test/mochitest/doc_function-jump.html @@ -0,0 +1,17 @@ + + + + + + + Debugger test page + + + +

Foo bar, bar, bazz, bar foo bar!

+ + + + + diff --git a/devtools/client/debugger/utils.js b/devtools/client/debugger/utils.js index 3032d6d679..8ec48ddadd 100644 --- a/devtools/client/debugger/utils.js +++ b/devtools/client/debugger/utils.js @@ -316,6 +316,48 @@ const SourceUtils = { } // Give up. return aUrl.spec; + }, + + parseSource: function(aDebuggerView, aParser) { + let editor = aDebuggerView.editor; + + let contents = editor.getText(); + let location = aDebuggerView.Sources.selectedValue; + let parsedSource = aParser.get(contents, location); + + return parsedSource; + }, + + findIdentifier: function(aEditor, parsedSource, x, y) { + let editor = aEditor; + + // Calculate the editor's line and column at the current x and y coords. + let hoveredPos = editor.getPositionFromCoords({ left: x, top: y }); + let hoveredOffset = editor.getOffset(hoveredPos); + let hoveredLine = hoveredPos.line; + let hoveredColumn = hoveredPos.ch; + + let scriptInfo = parsedSource.getScriptInfo(hoveredOffset); + + // If the script length is negative, we're not hovering JS source code. + if (scriptInfo.length == -1) { + return; + } + + // Using the script offset, determine the actual line and column inside the + // script, to use when finding identifiers. + let scriptStart = editor.getPosition(scriptInfo.start); + let scriptLineOffset = scriptStart.line; + let scriptColumnOffset = (hoveredLine == scriptStart.line ? scriptStart.ch : 0); + + let scriptLine = hoveredLine - scriptLineOffset; + let scriptColumn = hoveredColumn - scriptColumnOffset; + let identifierInfo = parsedSource.getIdentifierAt({ + line: scriptLine + 1, + column: scriptColumn, + scriptIndex: scriptInfo.index + }); + + return identifierInfo; } }; - diff --git a/devtools/client/debugger/views/sources-view.js b/devtools/client/debugger/views/sources-view.js index ac05af3b14..fc05a9821f 100644 --- a/devtools/client/debugger/views/sources-view.js +++ b/devtools/client/debugger/views/sources-view.js @@ -20,6 +20,7 @@ function SourcesView(DebuggerController, DebuggerView) { this.Breakpoints = DebuggerController.Breakpoints; this.SourceScripts = DebuggerController.SourceScripts; this.DebuggerView = DebuggerView; + this.Parser = DebuggerController.Parser; this.togglePrettyPrint = this.togglePrettyPrint.bind(this); this.toggleBlackBoxing = this.toggleBlackBoxing.bind(this); @@ -28,6 +29,7 @@ function SourcesView(DebuggerController, DebuggerView) { this._onEditorLoad = this._onEditorLoad.bind(this); this._onEditorUnload = this._onEditorUnload.bind(this); this._onEditorCursorActivity = this._onEditorCursorActivity.bind(this); + this._onMouseDown = this._onMouseDown.bind(this); this._onSourceSelect = this._onSourceSelect.bind(this); this._onStopBlackBoxing = this._onStopBlackBoxing.bind(this); this._onBreakpointRemoved = this._onBreakpointRemoved.bind(this); @@ -69,10 +71,16 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, { this._newTabMenuItem = document.getElementById("debugger-sources-context-newtab"); this._copyUrlMenuItem = document.getElementById("debugger-sources-context-copyurl"); + this._noResultsFoundToolTip = new Tooltip(document); + this._noResultsFoundToolTip.defaultPosition = FUNCTION_SEARCH_POPUP_POSITION; + if (Prefs.prettyPrintEnabled) { this._prettyPrintButton.removeAttribute("hidden"); } + this._editorContainer = document.getElementById("editor"); + this._editorContainer.addEventListener("mousedown", this._onMouseDown, false); + window.on(EVENTS.EDITOR_LOADED, this._onEditorLoad, false); window.on(EVENTS.EDITOR_UNLOADED, this._onEditorUnload, false); this.widget.addEventListener("select", this._onSourceSelect, false); @@ -968,6 +976,81 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, { aEditor.off("cursorActivity", this._onEditorCursorActivity); }, + _onMouseDown: function(e) { + this.hideNoResultsTooltip(); + + if (!e.metaKey) { + return; + } + + let editor = this.DebuggerView.editor; + let identifier = this._findIdentifier(e.clientX, e.clientY); + + if (!identifier) { + return; + } + + let foundDefinitions = this._getFunctionDefinitions(identifier); + + if (!foundDefinitions || !foundDefinitions.definitions) { + return; + } + + this._showFunctionDefinitionResults(identifier, foundDefinitions.definitions, editor); + }, + + /** + * Searches for function definition of a function in a given source file + */ + + _findDefinition: function(parsedSource, aName) { + let functionDefinitions = parsedSource.getNamedFunctionDefinitions(aName); + + let resultList = []; + + if (!functionDefinitions || !functionDefinitions.length || !functionDefinitions[0].length) { + return { + definitions: resultList + }; + } + + //functionDefinitions is a list with an object full of metadata, extract the + //data and use to construct a more useful, less cluttered, contextual list + for (let i=0; i or and distinguishes + * them from ordinary properties that happen + * to have the same name * @return Variable * The newly created Variable instance, null if it already exists. */ - addItem: function(aName = "", aDescriptor = {}, aRelaxed = false) { - if (this._store.has(aName) && !aRelaxed) { + addItem: function(aName = "", aDescriptor = {}, aOptions = {}) { + let {relaxed} = aOptions; + if (this._store.has(aName) && !relaxed) { return this._store.get(aName); } - let child = this._createChild(aName, aDescriptor); + let child = this._createChild(aName, aDescriptor, aOptions); this._store.set(aName, child); this._variablesView._itemsByElement.set(child._target, child); this._variablesView._currHierarchy.set(child.absoluteName, child); @@ -2146,14 +2157,17 @@ XPCOMUtils.defineLazyGetter(Scope, "ellipsis", () => * The variable's name. * @param object aDescriptor * The variable's descriptor. + * @param object aOptions + * Options of the form accepted by Scope.addItem */ -function Variable(aScope, aName, aDescriptor) { +function Variable(aScope, aName, aDescriptor, aOptions) { this._setTooltips = this._setTooltips.bind(this); this._activateNameInput = this._activateNameInput.bind(this); this._activateValueInput = this._activateValueInput.bind(this); this.openNodeInInspector = this.openNodeInInspector.bind(this); this.highlightDomNode = this.highlightDomNode.bind(this); this.unhighlightDomNode = this.unhighlightDomNode.bind(this); + this._internalItem = aOptions.internalItem; // Treat safe getter descriptors as descriptors with a value. if ("getterValue" in aDescriptor) { @@ -2193,11 +2207,13 @@ Variable.prototype = Heritage.extend(Scope.prototype, { * The name of the new Property. * @param object aDescriptor * The property's descriptor. + * @param object aOptions + * Options of the form accepted by Scope.addItem * @return Property * The newly created child Property. */ - _createChild: function(aName, aDescriptor) { - return new Property(this, aName, aDescriptor); + _createChild: function(aName, aDescriptor, aOptions) { + return new Property(this, aName, aDescriptor, aOptions); }, /** @@ -2521,8 +2537,9 @@ Variable.prototype = Heritage.extend(Scope.prototype, { if (this._initialDescriptor.enumerable || this._nameString == "this" || - this._nameString == "" || - this._nameString == "") { + (this._internalItem && + (this._nameString == "" || + this._nameString == ""))) { this.ownerView._enum.appendChild(this._target); this.ownerView._enumItems.push(this); } else { @@ -2869,11 +2886,11 @@ Variable.prototype = Heritage.extend(Scope.prototype, { if (name == "this") { target.setAttribute("self", ""); } - else if (name == "") { + else if (this._internalItem && name == "") { target.setAttribute("exception", ""); target.setAttribute("pseudo-item", ""); } - else if (name == "") { + else if (this._internalItem && name == "") { target.setAttribute("return", ""); target.setAttribute("pseudo-item", ""); } @@ -3008,7 +3025,7 @@ Variable.prototype = Heritage.extend(Scope.prototype, { configurable: true, enumerable: true, writable: true - }, true); + }, {relaxed: true}); // Force showing the separator. item._separatorLabel.hidden = false; @@ -3051,9 +3068,11 @@ Variable.prototype = Heritage.extend(Scope.prototype, { * The property's name. * @param object aDescriptor * The property's descriptor. + * @param object aOptions + * Options of the form accepted by Scope.addItem */ -function Property(aVar, aName, aDescriptor) { - Variable.call(this, aVar, aName, aDescriptor); +function Property(aVar, aName, aDescriptor, aOptions) { + Variable.call(this, aVar, aName, aDescriptor, aOptions); } Property.prototype = Heritage.extend(Variable.prototype, { diff --git a/devtools/client/shared/widgets/VariablesViewController.jsm b/devtools/client/shared/widgets/VariablesViewController.jsm index b851112c81..16247170e2 100644 --- a/devtools/client/shared/widgets/VariablesViewController.jsm +++ b/devtools/client/shared/widgets/VariablesViewController.jsm @@ -430,7 +430,7 @@ VariablesViewController.prototype = { let label = StackFrameUtils.getScopeLabel(environment); // Block scopes may have the same label, so make addItem allow duplicates. - let closure = funcScope.addItem(label, undefined, true); + let closure = funcScope.addItem(label, undefined, {relaxed: true}); closure.target.setAttribute("scope", ""); closure.showArrow(); diff --git a/devtools/client/storage/ui.js b/devtools/client/storage/ui.js index 24a04a3cdd..cb0021eb6e 100644 --- a/devtools/client/storage/ui.js +++ b/devtools/client/storage/ui.js @@ -379,7 +379,7 @@ StorageUI.prototype = { mainScope.expanded = true; if (item.name && item.valueActor) { - let itemVar = mainScope.addItem(item.name + "", {}, true); + let itemVar = mainScope.addItem(item.name + "", {}, {relaxed: true}); item.valueActor.string().then(value => { // The main area where the value will be displayed @@ -461,7 +461,7 @@ StorageUI.prototype = { let valueScope = view.getScopeAtIndex(1) || view.addScope(L10N.getStr("storage.parsedValue.label")); valueScope.expanded = true; - let jsonVar = valueScope.addItem("", Object.create(null), true); + let jsonVar = valueScope.addItem("", Object.create(null), {relaxed: true}); jsonVar.expanded = true; jsonVar.twisty = true; jsonVar.populate(jsonObject, {expanded: true}); diff --git a/devtools/client/webconsole/test/browser.ini b/devtools/client/webconsole/test/browser.ini new file mode 100644 index 0000000000..591a03ad49 --- /dev/null +++ b/devtools/client/webconsole/test/browser.ini @@ -0,0 +1,399 @@ +[DEFAULT] +tags = devtools +subsuite = devtools +support-files = + head.js + test-bug-585956-console-trace.html + test-bug-593003-iframe-wrong-hud-iframe.html + test-bug-593003-iframe-wrong-hud.html + test-bug-595934-canvas-css.html + test-bug-595934-canvas-css.js + test-bug-595934-css-loader.css + test-bug-595934-css-loader.css^headers^ + test-bug-595934-css-loader.html + test-bug-595934-css-parser.css + test-bug-595934-css-parser.html + test-bug-595934-empty-getelementbyid.html + test-bug-595934-empty-getelementbyid.js + test-bug-595934-html.html + test-bug-595934-image.html + test-bug-595934-image.jpg + test-bug-595934-imagemap.html + test-bug-595934-malformedxml-external.html + test-bug-595934-malformedxml-external.xml + test-bug-595934-malformedxml.xhtml + test-bug-595934-svg.xhtml + test-bug-595934-workers.html + test-bug-595934-workers.js + test-bug-597136-external-script-errors.html + test-bug-597136-external-script-errors.js + test-bug-597756-reopen-closed-tab.html + test-bug-599725-response-headers.sjs + test-bug-600183-charset.html + test-bug-600183-charset.html^headers^ + test-bug-601177-log-levels.html + test-bug-601177-log-levels.js + test-bug-603750-websocket.html + test-bug-603750-websocket.js + test-bug-613013-console-api-iframe.html + test-bug-618078-network-exceptions.html + test-bug-621644-jsterm-dollar.html + test-bug-630733-response-redirect-headers.sjs + test-bug-632275-getters.html + test-bug-632347-iterators-generators.html + test-bug-644419-log-limits.html + test-bug-646025-console-file-location.html + test-bug-658368-time-methods.html + test-bug-737873-mixedcontent.html + test-bug-752559-ineffective-iframe-sandbox-warning0.html + test-bug-752559-ineffective-iframe-sandbox-warning1.html + test-bug-752559-ineffective-iframe-sandbox-warning2.html + test-bug-752559-ineffective-iframe-sandbox-warning3.html + test-bug-752559-ineffective-iframe-sandbox-warning4.html + test-bug-752559-ineffective-iframe-sandbox-warning5.html + test-bug-752559-ineffective-iframe-sandbox-warning-inner.html + test-bug-752559-ineffective-iframe-sandbox-warning-nested1.html + test-bug-752559-ineffective-iframe-sandbox-warning-nested2.html + test-bug-762593-insecure-passwords-about-blank-web-console-warning.html + test-bug-762593-insecure-passwords-web-console-warning.html + test-bug-766001-console-log.js + test-bug-766001-js-console-links.html + test-bug-766001-js-errors.js + test-bug-782653-css-errors-1.css + test-bug-782653-css-errors-2.css + test-bug-782653-css-errors.html + test-bug-837351-security-errors.html + test-bug-859170-longstring-hang.html + test-bug-869003-iframe.html + test-bug-869003-top-window.html + test-closure-optimized-out.html + test-closures.html + test-console-assert.html + test-console-count.html + test-console-count-external-file.js + test-console-extras.html + test-console-replaced-api.html + test-console-server-logging.sjs + test-console.html + test-console-workers.html + test-console-table.html + test-console-output-02.html + test-console-output-03.html + test-console-output-04.html + test-console-output-dom-elements.html + test-console-output-events.html + test-console-output-regexp.html + test-console-column.html + test-consoleiframes.html + test-console-trace-async.html + test-certificate-messages.html + test-data.json + test-data.json^headers^ + test-duplicate-error.html + test-encoding-ISO-8859-1.html + test-error.html + test-eval-in-stackframe.html + test-file-location.js + test-filter.html + test-for-of.html + test_hpkp-invalid-headers.sjs + test_hsts-invalid-headers.sjs + test-iframe-762593-insecure-form-action.html + test-iframe-762593-insecure-frame.html + test-iframe1.html + test-iframe2.html + test-iframe3.html + test-image.png + test-mixedcontent-securityerrors.html + test-mutation.html + test-network-request.html + test-network.html + test-observe-http-ajax.html + test-own-console.html + test-property-provider.html + test-repeated-messages.html + test-result-format-as-string.html + test-trackingprotection-securityerrors.html + test-webconsole-error-observer.html + test_bug_770099_violation.html + test_bug_770099_violation.html^headers^ + test-autocomplete-in-stackframe.html + testscript.js + test-bug_923281_console_log_filter.html + test-bug_923281_test1.js + test-bug_923281_test2.js + test-bug_939783_console_trace_duplicates.html + test-bug-952277-highlight-nodes-in-vview.html + test-bug-609872-cd-iframe-parent.html + test-bug-609872-cd-iframe-child.html + test-bug-989025-iframe-parent.html + test-bug_1050691_click_function_to_source.html + test-bug_1050691_click_function_to_source.js + test-console-api-stackframe.html + test-exception-stackframe.html + test_bug_1010953_cspro.html^headers^ + test_bug_1010953_cspro.html + test_bug1045902_console_csp_ignore_reflected_xss_message.html^headers^ + test_bug1045902_console_csp_ignore_reflected_xss_message.html + test_bug1092055_shouldwarn.js^headers^ + test_bug1092055_shouldwarn.js + test_bug1092055_shouldwarn.html + +[browser_bug1045902_console_csp_ignore_reflected_xss_message.js] +skip-if = (e10s && debug) || (e10s && os == 'win') # Bug 1221499 enabled these on windows +[browser_bug664688_sandbox_update_after_navigation.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (intermittent Linux debug) +[browser_bug_638949_copy_link_location.js] +[browser_bug_862916_console_dir_and_filter_off.js] +skip-if = (e10s && os == 'win') # Bug 1221499 enabled these on windows +[browser_bug_865288_repeat_different_objects.js] +[browser_bug_865871_variables_view_close_on_esc_key.js] +[browser_bug_869003_inspect_cross_domain_object.js] +[browser_bug_871156_ctrlw_close_tab.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (intermittent Linux debug) +[browser_cached_messages.js] +[browser_console.js] +[browser_console_addonsdk_loader_exception.js] +[browser_console_clear_on_reload.js] +[browser_console_click_focus.js] +[browser_console_consolejsm_output.js] +[browser_console_copy_command.js] +[browser_console_dead_objects.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_console_copy_entire_message_context_menu.js] +[browser_console_error_source_click.js] +skip-if = buildapp == 'mulet' || e10s # Bug 1042253 - webconsole e10s tests +[browser_console_filters.js] +[browser_console_iframe_messages.js] +skip-if = buildapp == 'mulet' || e10s # Bug 1042253 - webconsole e10s tests +[browser_console_keyboard_accessibility.js] +[browser_console_log_inspectable_object.js] +[browser_console_native_getters.js] +[browser_console_navigation_marker.js] +[browser_console_nsiconsolemessage.js] +skip-if = buildapp == 'mulet' +[browser_console_optimized_out_vars.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_console_private_browsing.js] +skip-if = buildapp == 'mulet' || e10s # Bug 1042253 - webconsole e10s tests +[browser_console_server_logging.js] +[browser_console_variables_view.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_console_variables_view_filter.js] +[browser_console_variables_view_dom_nodes.js] +[browser_console_variables_view_dont_sort_non_sortable_classes_properties.js] +skip-if = buildapp == 'mulet' +[browser_console_variables_view_special_names.js] +[browser_console_variables_view_while_debugging.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_console_variables_view_while_debugging_and_inspecting.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_eval_in_debugger_stackframe.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_eval_in_debugger_stackframe2.js] +[browser_jsterm_inspect.js] +[browser_longstring_hang.js] +[browser_output_breaks_after_console_dir_uninspectable.js] +[browser_output_longstring_expand.js] +[browser_repeated_messages_accuracy.js] +skip-if = buildapp == 'mulet' +[browser_result_format_as_string.js] +[browser_warn_user_about_replaced_api.js] +[browser_webconsole_abbreviate_source_url.js] +[browser_webconsole_allow_mixedcontent_securityerrors.js] +tags = mcb +skip-if = buildapp == 'mulet' +[browser_webconsole_assert.js] +[browser_webconsole_basic_net_logging.js] +[browser_webconsole_block_mixedcontent_securityerrors.js] +tags = mcb +skip-if = buildapp == 'mulet' +[browser_webconsole_bug_579412_input_focus.js] +[browser_webconsole_bug_580001_closing_after_completion.js] +[browser_webconsole_bug_580030_errors_after_page_reload.js] +[browser_webconsole_bug_580454_timestamp_l10n.js] +[browser_webconsole_bug_582201_duplicate_errors.js] +[browser_webconsole_bug_583816_No_input_and_Tab_key_pressed.js] +[browser_webconsole_bug_585237_line_limit.js] +[browser_webconsole_bug_585956_console_trace.js] +[browser_webconsole_bug_585991_autocomplete_keys.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_585991_autocomplete_popup.js] +[browser_webconsole_bug_586388_select_all.js] +[browser_webconsole_bug_587617_output_copy.js] +[browser_webconsole_bug_588342_document_focus.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_588730_text_node_insertion.js] +[browser_webconsole_bug_588967_input_expansion.js] +[browser_webconsole_bug_589162_css_filter.js] +[browser_webconsole_bug_592442_closing_brackets.js] +[browser_webconsole_bug_593003_iframe_wrong_hud.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_594497_history_arrow_keys.js] +[browser_webconsole_bug_595223_file_uri.js] +[browser_webconsole_bug_595350_multiple_windows_and_tabs.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_595934_message_categories.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_597136_external_script_errors.js] +[browser_webconsole_bug_597136_network_requests_from_chrome.js] +[browser_webconsole_bug_597460_filter_scroll.js] +[browser_webconsole_bug_597756_reopen_closed_tab.js] +[browser_webconsole_bug_599725_response_headers.js] +[browser_webconsole_bug_600183_charset.js] +[browser_webconsole_bug_601177_log_levels.js] +[browser_webconsole_bug_601352_scroll.js] +[browser_webconsole_bug_601667_filter_buttons.js] +[browser_webconsole_bug_603750_websocket.js] +[browser_webconsole_bug_611795.js] +[browser_webconsole_bug_613013_console_api_iframe.js] +[browser_webconsole_bug_613280_jsterm_copy.js] +[browser_webconsole_bug_613642_maintain_scroll.js] +[browser_webconsole_bug_613642_prune_scroll.js] +[browser_webconsole_bug_614793_jsterm_scroll.js] +[browser_webconsole_bug_618078_network_exceptions.js] +[browser_webconsole_bug_621644_jsterm_dollar.js] +[browser_webconsole_bug_622303_persistent_filters.js] +[browser_webconsole_bug_623749_ctrl_a_select_all_winnt.js] +skip-if = os != "win" +[browser_webconsole_bug_630733_response_redirect_headers.js] +[browser_webconsole_bug_632275_getters_document_width.js] +[browser_webconsole_bug_632347_iterators_generators.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_632817.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_642108_pruneTest.js] +[browser_webconsole_autocomplete_and_selfxss.js] +[browser_webconsole_bug_644419_log_limits.js] +[browser_webconsole_bug_646025_console_file_location.js] +[browser_webconsole_bug_651501_document_body_autocomplete.js] +[browser_webconsole_bug_653531_highlighter_console_helper.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_658368_time_methods.js] +[browser_webconsole_bug_659907_console_dir.js] +[browser_webconsole_bug_660806_history_nav.js] +[browser_webconsole_bug_664131_console_group.js] +[browser_webconsole_bug_686937_autocomplete_JSTerm_helpers.js] +[browser_webconsole_bug_704295.js] +[browser_webconsole_bug_734061_No_input_change_and_Tab_key_pressed.js] +[browser_webconsole_bug_737873_mixedcontent.js] +tags = mcb +[browser_webconsole_bug_752559_ineffective_iframe_sandbox_warning.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout) +[browser_webconsole_bug_762593_insecure_passwords_about_blank_web_console_warning.js] +skip-if = buildapp == 'mulet' +[browser_webconsole_bug_762593_insecure_passwords_web_console_warning.js] +skip-if = true # Bug 1110500 - mouse event failure in test +[browser_webconsole_bug_764572_output_open_url.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_bug_766001_JS_Console_in_Debugger.js] +[browser_webconsole_bug_770099_violation.js] +skip-if = e10s && os == 'win' +[browser_webconsole_bug_782653_CSS_links_in_Style_Editor.js] +skip-if = buildapp == 'mulet' +[browser_webconsole_bug_804845_ctrl_key_nav.js] +skip-if = os != "mac" +[browser_webconsole_bug_817834_add_edited_input_to_history.js] +[browser_webconsole_bug_837351_securityerrors.js] +skip-if = buildapp == 'mulet' +[browser_webconsole_bug_915141_toggle_response_logging_with_keyboard.js] +[browser_webconsole_filter_buttons_contextmenu.js] +[browser_webconsole_bug_1006027_message_timestamps_incorrect.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug intermittent) +[browser_webconsole_bug_1010953_cspro.js] +skip-if = e10s && os == 'win' +[browser_webconsole_certificate_messages.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_show_subresource_security_errors.js] +skip-if = e10s && os == 'win' +[browser_webconsole_cached_autocomplete.js] +[browser_webconsole_change_font_size.js] +[browser_webconsole_chrome.js] +[browser_webconsole_clickable_urls.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout) +[browser_webconsole_closure_inspection.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_completion.js] +[browser_webconsole_console_extras.js] +[browser_webconsole_console_logging_api.js] +[browser_webconsole_console_logging_workers_api.js] +[browser_webconsole_console_trace_async.js] +[browser_webconsole_count.js] +[browser_webconsole_dont_navigate_on_doubleclick.js] +[browser_webconsole_execution_scope.js] +[browser_webconsole_for_of.js] +[browser_webconsole_history.js] +[browser_webconsole_hpkp_invalid-headers.js] +[browser_webconsole_hsts_invalid-headers.js] +skip-if = buildapp == 'mulet' || e10s # Bug 1042253 - webconsole e10s tests +[browser_webconsole_input_field_focus_on_panel_select.js] +[browser_webconsole_inspect-parsed-documents.js] +[browser_webconsole_js_input_expansion.js] +[browser_webconsole_jsterm.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout) +[browser_webconsole_live_filtering_of_message_types.js] +[browser_webconsole_live_filtering_on_search_strings.js] +[browser_webconsole_message_node_id.js] +[browser_webconsole_netlogging.js] +[browser_webconsole_netlogging_reset_filter.js] +[browser_webconsole_notifications.js] +[browser_webconsole_open-links-without-callback.js] +[browser_webconsole_promise.js] +[browser_webconsole_output_copy_newlines.js] +[browser_webconsole_output_order.js] +[browser_webconsole_property_provider.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_scratchpad_panel_link.js] +[browser_webconsole_split.js] +[browser_webconsole_split_escape_key.js] +[browser_webconsole_split_focus.js] +[browser_webconsole_split_persist.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout) +[browser_webconsole_trackingprotection_errors.js] +tags = trackingprotection +[browser_webconsole_view_source.js] +[browser_webconsole_reflow.js] +[browser_webconsole_log_file_filter.js] +[browser_webconsole_expandable_timestamps.js] +[browser_webconsole_autocomplete_in_debugger_stackframe.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_autocomplete_popup_close_on_tab_switch.js] +skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s +[browser_webconsole_autocomplete-properties-with-non-alphanumeric-names.js] +[browser_console_hide_jsterm_when_devtools_chrome_enabled_false.js] +[browser_console_history_persist.js] +[browser_webconsole_output_01.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests +[browser_webconsole_output_02.js] +[browser_webconsole_output_03.js] +[browser_webconsole_output_04.js] +[browser_webconsole_output_05.js] +[browser_webconsole_output_06.js] +[browser_webconsole_output_dom_elements_01.js] +[browser_webconsole_output_dom_elements_02.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout) +[browser_webconsole_output_dom_elements_03.js] +[browser_webconsole_output_dom_elements_04.js] +skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug timeout) +[browser_webconsole_output_events.js] +[browser_webconsole_output_regexp.js] +[browser_webconsole_output_table.js] +[browser_console_variables_view_highlighter.js] +[browser_webconsole_start_netmon_first.js] +[browser_webconsole_console_trace_duplicates.js] +[browser_webconsole_cd_iframe.js] +[browser_webconsole_autocomplete_crossdomain_iframe.js] +[browser_webconsole_console_custom_styles.js] +[browser_webconsole_console_api_stackframe.js] +[browser_webconsole_exception_stackframe.js] +[browser_webconsole_column_numbers.js] +[browser_console_open_or_focus.js] +[browser_webconsole_bug_922212_console_dirxml.js] +[browser_webconsole_shows_reqs_in_netmonitor.js] +[browser_netmonitor_shows_reqs_in_webconsole.js] +[browser_webconsole_bug_1050691_click_function_to_source.js] +[browser_webconsole_context_menu_open_in_var_view.js] +[browser_webconsole_context_menu_store_as_global.js] +[browser_webconsole_strict_mode_errors.js] diff --git a/devtools/client/webconsole/test/browser_console_variables_view_special_names.js b/devtools/client/webconsole/test/browser_console_variables_view_special_names.js new file mode 100644 index 0000000000..a2e926388f --- /dev/null +++ b/devtools/client/webconsole/test/browser_console_variables_view_special_names.js @@ -0,0 +1,38 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +// Check that variables view handles special names like "" +// properly for ordinary displays. + +"use strict"; + +const TEST_URI = "data:text/html;charset=utf8,

test for bug 1084430"; + +var test = asyncTest(function* () { + yield loadTab(TEST_URI); + let hud = yield openConsole(); + + ok(hud, "web console opened"); + + hud.setFilterState("log", false); + registerCleanupFunction(() => hud.setFilterState("log", true)); + + hud.jsterm.execute("inspect({ '': 47, '': 91 })"); + + let varView = yield hud.jsterm.once("variablesview-fetched"); + ok(varView, "variables view object"); + + let props = yield findVariableViewProperties(varView, [ + { name: "", value: 47 }, + { name: "", value: 91 }, + ], { webconsole: hud }); + + for (let prop of props) { + ok(!prop.matchedProp._internalItem, prop.name + " is not marked internal"); + let target = prop.matchedProp._target; + ok(!target.hasAttribute("pseudo-item"), + prop.name + " is not a pseudo-item"); + } +}); diff --git a/moz.build b/moz.build index 06355bb305..b255f72439 100644 --- a/moz.build +++ b/moz.build @@ -28,6 +28,16 @@ if not CONFIG['JS_STANDALONE']: CONFIGURE_DEFINE_FILES += [ 'mozilla-config.h', ] + EXPORTS += [ + '!buildid.h', + '!mozilla-config.h', + ] + + GENERATED_FILES += [ + 'buildid.h', + ] + + GENERATED_FILES['buildid.h'].script = 'build/variables.py:buildid_header' DIRS += [ 'build', diff --git a/python/compare-locales/mach_commands.py b/python/compare-locales/mach_commands.py index 834837c223..171f868b17 100644 --- a/python/compare-locales/mach_commands.py +++ b/python/compare-locales/mach_commands.py @@ -2,7 +2,7 @@ # 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/. -from __future__ import print_function, unicode_literals +from __future__ import absolute_import, print_function, unicode_literals from mach.decorators import ( CommandArgument, @@ -14,7 +14,7 @@ from mozbuild.base import ( MachCommandBase, ) -import mozpack +import mozpack.path as mozpath MERGE_HELP = '''Directory to merge to. Will be removed to before running diff --git a/python/mozbuild/mozbuild/action/convert_def_file.py b/python/mozbuild/mozbuild/action/convert_def_file.py deleted file mode 100644 index 0b86ea17ed..0000000000 --- a/python/mozbuild/mozbuild/action/convert_def_file.py +++ /dev/null @@ -1,112 +0,0 @@ -# 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/. - -# Convert Windows-style export files into a single Unix-style linker -# script, applying any necessary preprocessing. - -from __future__ import absolute_import - -import itertools -import re -import sys -from StringIO import StringIO - -from mozbuild.preprocessor import Preprocessor -from mozbuild.util import FileAvoidWrite - -def preprocess_file(pp, deffile): - pp.out = StringIO() - with open(deffile, 'rU') as input: - pp.do_include(input, False) - return pp.out.getvalue().splitlines() - -# NSS .def files serve multiple masters, as this copied comment indicates: -# -# OK, this file is meant to support SUN, LINUX, AIX and WINDOWS -# 1. For all unix platforms, the string ";-" means "remove this line" -# 2. For all unix platforms, the string " DATA " will be removed from any -# line on which it occurs. -# 3. Lines containing ";+" will have ";+" removed on SUN and LINUX. -# On AIX, lines containing ";+" will be removed. -# 4. For all unix platforms, the string ";;" will have the ";;" removed. -# 5. For all unix platforms, after the above processing has taken place, -# all characters after the first ";" on the line will be removed. -# And for AIX, the first ";" will also be removed. -# This file is passed directly to windows. Since ';' is a comment, all UNIX -# directives are hidden behind ";", ";+", and ";-" -# -# We don't care about rule 1, as that mainly serves to eliminate LIBRARY -# and EXPORTS lines. Our symbol extraction routines handle DATA, so we -# don't need to bother with rule 2. We don't want to enforce rule 3, as -# we know how to eliminate comments. ';+' also tends to hide Unix -# linker-script specific things, which we don't want to deal with here. -# Rule 5 is also unnecessary; later comment-aware processing will deal -# with that. -# -# We need to handle rule 4, since ';;' often hides things marked with DATA. -def nss_preprocess_file(deffile): - with open(deffile, 'r') as input: - for line in input: - yield line.replace(';;', '') - -COMMENT = re.compile(';.*') - -def extract_symbols(lines): - # Filter comments. - nocomments = iter(COMMENT.sub('', s).strip() for s in lines) - lines = iter(s for s in nocomments if len(s)) - - exports = itertools.dropwhile(lambda s: 'EXPORTS' not in s, lines) - symbols = set() - for line in exports: - if 'EXPORTS' in line: - # Handle the case where symbols are specified along with EXPORT. - fields = line.split()[1:] - if len(fields) == 0: - continue - else: - fields = line.split() - - # We don't support aliases, and we only support the DATA keyword on - # symbols. But since aliases can also be specified as 'SYM=ALIAS' - # with no whitespace, we need extra checks on the original symbol. - if '=' in fields[0]: - raise BaseException, 'aliases are not supported (%s)' % line - if len(fields) == 1: - pass - elif len(fields) != 2 or fields[1] != 'DATA': - raise BaseException, 'aliases and keywords other than DATA are not supported (%s)' % line - - symbols.add(fields[0]) - - return symbols - -def main(args): - pp = Preprocessor() - optparser = pp.getCommandLineParser() - optparser.add_option('--nss-file', action='append', - type='string', dest='nss_files', default=[], - help='Specify a .def file that should have NSS\'s processing rules applied to it') - options, deffiles = optparser.parse_args(args) - - symbols = set() - for f in options.nss_files: - symbols |= extract_symbols(nss_preprocess_file(f)) - for f in deffiles: - # Start each deffile off with a clean slate. - defpp = pp.clone() - symbols |= extract_symbols(preprocess_file(defpp, f)) - - script = """{ -global: - %s -local: - *; -}; -""" - with FileAvoidWrite(options.output) as f: - f.write(script % '\n '.join("%s;" % s for s in sorted(symbols))) - -if __name__ == '__main__': - main(sys.argv[1:]) diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index 9ae3c29ce3..af5eb825db 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -371,7 +371,39 @@ class TreeMetadataEmitter(LoggingMixin): else: return ExternalSharedLibrary(context, name) - def _handle_libraries(self, context): + def _handle_linkables(self, context, passthru): + has_linkables = False + + for kind, cls in [('PROGRAM', Program), ('HOST_PROGRAM', HostProgram)]: + program = context.get(kind) + if program: + if program in self._binaries: + raise SandboxValidationError( + 'Cannot use "%s" as %s name, ' + 'because it is already used in %s' % (program, kind, + self._binaries[program].relativedir), context) + self._binaries[program] = cls(context, program) + self._linkage.append((context, self._binaries[program], + kind.replace('PROGRAM', 'USE_LIBS'))) + has_linkables = True + + for kind, cls in [ + ('SIMPLE_PROGRAMS', SimpleProgram), + ('CPP_UNIT_TESTS', SimpleProgram), + ('HOST_SIMPLE_PROGRAMS', HostSimpleProgram)]: + for program in context[kind]: + if program in self._binaries: + raise SandboxValidationError( + 'Cannot use "%s" in %s, ' + 'because it is already used in %s' % (program, kind, + self._binaries[program].relativedir), context) + self._binaries[program] = cls(context, program, + is_unit_test=kind == 'CPP_UNIT_TESTS') + self._linkage.append((context, self._binaries[program], + 'HOST_USE_LIBS' if kind == 'HOST_SIMPLE_PROGRAMS' + else 'USE_LIBS')) + has_linkables = True + host_libname = context.get('HOST_LIBRARY_NAME') libname = context.get('LIBRARY_NAME') @@ -382,6 +414,7 @@ class TreeMetadataEmitter(LoggingMixin): lib = HostLibrary(context, host_libname) self._libs[host_libname].append(lib) self._linkage.append((context, lib, 'HOST_USE_LIBS')) + has_linkables = True final_lib = context.get('FINAL_LIBRARY') if not libname and final_lib: @@ -528,6 +561,7 @@ class TreeMetadataEmitter(LoggingMixin): lib = SharedLibrary(context, libname, **shared_args) self._libs[libname].append(lib) self._linkage.append((context, lib, 'USE_LIBS')) + has_linkables = True if is_component and not context['NO_COMPONENTS_MANIFEST']: yield ChromeManifestEntry(context, 'components/components.manifest', @@ -543,6 +577,7 @@ class TreeMetadataEmitter(LoggingMixin): lib = StaticLibrary(context, libname, **static_args) self._libs[libname].append(lib) self._linkage.append((context, lib, 'USE_LIBS')) + has_linkables = True if lib_defines: if not libname: @@ -550,6 +585,115 @@ class TreeMetadataEmitter(LoggingMixin): 'LIBRARY_NAME to take effect', context) lib.lib_defines.update(lib_defines) + # Only emit sources if we have linkables defined in the same context. + # Note the linkables are not emitted in this function, but much later, + # after aggregation (because of e.g. USE_LIBS processing). + if not has_linkables: + return + + sources = defaultdict(list) + gen_sources = defaultdict(list) + all_flags = {} + for symbol in ('SOURCES', 'HOST_SOURCES', 'UNIFIED_SOURCES'): + srcs = sources[symbol] + gen_srcs = gen_sources[symbol] + context_srcs = context.get(symbol, []) + for f in context_srcs: + full_path = f.full_path + if isinstance(f, SourcePath): + srcs.append(full_path) + else: + assert isinstance(f, Path) + gen_srcs.append(full_path) + if symbol == 'SOURCES': + flags = context_srcs[f] + if flags: + all_flags[full_path] = flags + + if isinstance(f, SourcePath) and not os.path.exists(full_path): + raise SandboxValidationError('File listed in %s does not ' + 'exist: \'%s\'' % (symbol, full_path), context) + + # HOST_SOURCES and UNIFIED_SOURCES only take SourcePaths, so + # there should be no generated source in here + assert not gen_sources['HOST_SOURCES'] + assert not gen_sources['UNIFIED_SOURCES'] + + no_pgo = context.get('NO_PGO') + no_pgo_sources = [f for f, flags in all_flags.iteritems() + if flags.no_pgo] + if no_pgo: + if no_pgo_sources: + raise SandboxValidationError('NO_PGO and SOURCES[...].no_pgo ' + 'cannot be set at the same time', context) + passthru.variables['NO_PROFILE_GUIDED_OPTIMIZE'] = no_pgo + if no_pgo_sources: + passthru.variables['NO_PROFILE_GUIDED_OPTIMIZE'] = no_pgo_sources + + # A map from "canonical suffixes" for a particular source file + # language to the range of suffixes associated with that language. + # + # We deliberately don't list the canonical suffix in the suffix list + # in the definition; we'll add it in programmatically after defining + # things. + suffix_map = { + '.s': set(['.asm']), + '.c': set(), + '.m': set(), + '.mm': set(), + '.cpp': set(['.cc', '.cxx']), + '.rs': set(), + '.S': set(), + } + + # The inverse of the above, mapping suffixes to their canonical suffix. + canonicalized_suffix_map = {} + for suffix, alternatives in suffix_map.iteritems(): + alternatives.add(suffix) + for a in alternatives: + canonicalized_suffix_map[a] = suffix + + def canonical_suffix_for_file(f): + return canonicalized_suffix_map[mozpath.splitext(f)[1]] + + # A map from moz.build variables to the canonical suffixes of file + # kinds that can be listed therein. + all_suffixes = list(suffix_map.keys()) + varmap = dict( + SOURCES=(Sources, GeneratedSources, all_suffixes), + HOST_SOURCES=(HostSources, None, ['.c', '.mm', '.cpp']), + UNIFIED_SOURCES=(UnifiedSources, None, ['.c', '.mm', '.cpp']), + ) + + for variable, (klass, gen_klass, suffixes) in varmap.items(): + allowed_suffixes = set().union(*[suffix_map[s] for s in suffixes]) + + # First ensure that we haven't been given filetypes that we don't + # recognize. + for f in itertools.chain(sources[variable], gen_sources[variable]): + ext = mozpath.splitext(f)[1] + if ext not in allowed_suffixes: + raise SandboxValidationError( + '%s has an unknown file type.' % f, context) + + for srcs, cls in ((sources[variable], klass), + (gen_sources[variable], gen_klass)): + # Now sort the files to let groupby work. + sorted_files = sorted(srcs, key=canonical_suffix_for_file) + for canonical_suffix, files in itertools.groupby( + sorted_files, canonical_suffix_for_file): + arglist = [context, list(files), canonical_suffix] + if (variable.startswith('UNIFIED_') and + 'FILES_PER_UNIFIED_FILE' in context): + arglist.append(context['FILES_PER_UNIFIED_FILE']) + yield cls(*arglist) + + for f, flags in all_flags.iteritems(): + if flags.flags: + ext = mozpath.splitext(f)[1] + yield PerSourceFlag(context, f, flags.flags) + + def emit_from_context(self, context): """Convert a Context to tree metadata objects. @@ -585,7 +729,6 @@ class TreeMetadataEmitter(LoggingMixin): 'ANDROID_GENERATED_RESFILES', 'DISABLE_STL_WRAPPING', 'EXTRA_DSO_LDOPTS', - 'USE_STATIC_LIBS', 'PYTHON_UNIT_TESTS', 'RCFILE', 'RESFILE', @@ -625,8 +768,20 @@ class TreeMetadataEmitter(LoggingMixin): elif dist_install is False: passthru.variables['NO_DIST_INSTALL'] = True - for obj in self._process_sources(context, passthru): - yield obj + # Ideally, this should be done in templates, but this is difficult at + # the moment because USE_STATIC_LIBS can be set after a template + # returns. Eventually, with context-based templates, it will be + # possible. + if (context.config.substs.get('OS_ARCH') == 'WINNT' and + not context.config.substs.get('GNU_CC')): + use_static_lib = (context.get('USE_STATIC_LIBS') and + not context.config.substs.get('MOZ_ASAN')) + rtl_flag = '-MT' if use_static_lib else '-MD' + if (context.config.substs.get('MOZ_DEBUG') and + not context.config.substs.get('MOZ_NO_DEBUG_RTL')): + rtl_flag += 'd' + # Use a list, like MOZBUILD_*FLAGS variables + passthru.variables['RTL_FLAGS'] = [rtl_flag] generated_files = set() for obj in self._process_generated_files(context): @@ -644,8 +799,6 @@ class TreeMetadataEmitter(LoggingMixin): if host_defines: yield HostDefines(context, host_defines) - self._handle_programs(context) - simple_lists = [ ('GENERATED_EVENTS_WEBIDL_FILES', GeneratedEventWebIDLFile), ('GENERATED_WEBIDL_FILES', GeneratedWebIDLFile), @@ -745,7 +898,7 @@ class TreeMetadataEmitter(LoggingMixin): Manifest('components', mozpath.basename(c))) - for obj in self._handle_libraries(context): + for obj in self._handle_linkables(context, passthru): yield obj for obj in self._process_test_manifests(context): @@ -789,108 +942,6 @@ class TreeMetadataEmitter(LoggingMixin): return sub - def _process_sources(self, context, passthru): - sources = defaultdict(list) - gen_sources = defaultdict(list) - all_flags = {} - for symbol in ('SOURCES', 'HOST_SOURCES', 'UNIFIED_SOURCES'): - srcs = sources[symbol] - gen_srcs = gen_sources[symbol] - context_srcs = context.get(symbol, []) - for f in context_srcs: - full_path = f.full_path - if isinstance(f, SourcePath): - srcs.append(full_path) - else: - assert isinstance(f, Path) - gen_srcs.append(full_path) - if symbol == 'SOURCES': - flags = context_srcs[f] - if flags: - all_flags[full_path] = flags - - if isinstance(f, SourcePath) and not os.path.exists(full_path): - raise SandboxValidationError('File listed in %s does not ' - 'exist: \'%s\'' % (symbol, full_path), context) - - # HOST_SOURCES and UNIFIED_SOURCES only take SourcePaths, so - # there should be no generated source in here - assert not gen_sources['HOST_SOURCES'] - assert not gen_sources['UNIFIED_SOURCES'] - - no_pgo = context.get('NO_PGO') - no_pgo_sources = [f for f, flags in all_flags.iteritems() - if flags.no_pgo] - if no_pgo: - if no_pgo_sources: - raise SandboxValidationError('NO_PGO and SOURCES[...].no_pgo ' - 'cannot be set at the same time', context) - passthru.variables['NO_PROFILE_GUIDED_OPTIMIZE'] = no_pgo - if no_pgo_sources: - passthru.variables['NO_PROFILE_GUIDED_OPTIMIZE'] = no_pgo_sources - - # A map from "canonical suffixes" for a particular source file - # language to the range of suffixes associated with that language. - # - # We deliberately don't list the canonical suffix in the suffix list - # in the definition; we'll add it in programmatically after defining - # things. - suffix_map = { - '.s': set(['.asm']), - '.c': set(), - '.m': set(), - '.mm': set(), - '.cpp': set(['.cc', '.cxx']), - '.S': set(), - } - - # The inverse of the above, mapping suffixes to their canonical suffix. - canonicalized_suffix_map = {} - for suffix, alternatives in suffix_map.iteritems(): - alternatives.add(suffix) - for a in alternatives: - canonicalized_suffix_map[a] = suffix - - def canonical_suffix_for_file(f): - return canonicalized_suffix_map[mozpath.splitext(f)[1]] - - # A map from moz.build variables to the canonical suffixes of file - # kinds that can be listed therein. - all_suffixes = list(suffix_map.keys()) - varmap = dict( - SOURCES=(Sources, GeneratedSources, all_suffixes), - HOST_SOURCES=(HostSources, None, ['.c', '.mm', '.cpp']), - UNIFIED_SOURCES=(UnifiedSources, None, ['.c', '.mm', '.cpp']), - ) - - for variable, (klass, gen_klass, suffixes) in varmap.items(): - allowed_suffixes = set().union(*[suffix_map[s] for s in suffixes]) - - # First ensure that we haven't been given filetypes that we don't - # recognize. - for f in itertools.chain(sources[variable], gen_sources[variable]): - ext = mozpath.splitext(f)[1] - if ext not in allowed_suffixes: - raise SandboxValidationError( - '%s has an unknown file type.' % f, context) - - for srcs, cls in ((sources[variable], klass), - (gen_sources[variable], gen_klass)): - # Now sort the files to let groupby work. - sorted_files = sorted(srcs, key=canonical_suffix_for_file) - for canonical_suffix, files in itertools.groupby( - sorted_files, canonical_suffix_for_file): - arglist = [context, list(files), canonical_suffix] - if (variable.startswith('UNIFIED_') and - 'FILES_PER_UNIFIED_FILE' in context): - arglist.append(context['FILES_PER_UNIFIED_FILE']) - yield cls(*arglist) - - for f, flags in all_flags.iteritems(): - if flags.flags: - ext = mozpath.splitext(f)[1] - yield PerSourceFlag(context, f, flags.flags) - def _process_xpidl(self, context): # XPIDL source files get processed and turned into .h and .xpt files. # If there are multiple XPIDL files in a directory, they get linked @@ -1003,37 +1054,7 @@ class TreeMetadataEmitter(LoggingMixin): yield TestHarnessFiles(context, srcdir_files, srcdir_pattern_files, objdir_files) - def _handle_programs(self, context): - for kind, cls in [('PROGRAM', Program), ('HOST_PROGRAM', HostProgram)]: - program = context.get(kind) - if program: - if program in self._binaries: - raise SandboxValidationError( - 'Cannot use "%s" as %s name, ' - 'because it is already used in %s' % (program, kind, - self._binaries[program].relativedir), context) - self._binaries[program] = cls(context, program) - self._linkage.append((context, self._binaries[program], - kind.replace('PROGRAM', 'USE_LIBS'))) - - for kind, cls in [ - ('SIMPLE_PROGRAMS', SimpleProgram), - ('CPP_UNIT_TESTS', SimpleProgram), - ('HOST_SIMPLE_PROGRAMS', HostSimpleProgram)]: - for program in context[kind]: - if program in self._binaries: - raise SandboxValidationError( - 'Cannot use "%s" in %s, ' - 'because it is already used in %s' % (program, kind, - self._binaries[program].relativedir), context) - self._binaries[program] = cls(context, program, - is_unit_test=kind == 'CPP_UNIT_TESTS') - self._linkage.append((context, self._binaries[program], - 'HOST_USE_LIBS' if kind == 'HOST_SIMPLE_PROGRAMS' - else 'USE_LIBS')) - def _process_test_manifests(self, context): - for prefix, info in TEST_MANIFESTS.items(): for path in context.get('%s_MANIFESTS' % prefix, []): for obj in self._process_test_manifest(context, info, path): diff --git a/python/mozbuild/mozbuild/test/backend/common.py b/python/mozbuild/mozbuild/test/backend/common.py index 316595c38f..06904160d3 100644 --- a/python/mozbuild/mozbuild/test/backend/common.py +++ b/python/mozbuild/mozbuild/test/backend/common.py @@ -51,6 +51,14 @@ CONFIGS = defaultdict(lambda: { ('LIB_SUFFIX', 'a'), ], }, + 'sources': { + 'defines': [], + 'non_global_defines': [], + 'substs': [ + ('LIB_PREFIX', 'lib'), + ('LIB_SUFFIX', 'a'), + ], + }, 'stub0': { 'defines': [ ('MOZ_TRUE_1', '1'), diff --git a/python/mozbuild/mozbuild/test/backend/data/sources/moz.build b/python/mozbuild/mozbuild/test/backend/data/sources/moz.build index cf99876414..2ac50dbe41 100644 --- a/python/mozbuild/mozbuild/test/backend/data/sources/moz.build +++ b/python/mozbuild/mozbuild/test/backend/data/sources/moz.build @@ -2,6 +2,13 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ +@template +def Library(name): + '''Template for libraries.''' + LIBRARY_NAME = name + +Library('dummy') + SOURCES += ['bar.s', 'foo.asm'] HOST_SOURCES += ['bar.cpp', 'foo.cpp'] diff --git a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build index 34f8deb579..c6aa7dfa5c 100644 --- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build +++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build @@ -11,8 +11,6 @@ RESFILE = 'bar.res' RCINCLUDE = 'bar.rc' DEFFILE = 'baz.def' -USE_STATIC_LIBS = True - CFLAGS += ['-fno-exceptions', '-w'] CXXFLAGS += ['-fcxx-exceptions', '-option with spaces'] LDFLAGS += ['-ld flag with spaces', '-x'] diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py index 8aed2cfe53..615b4fc819 100644 --- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py @@ -292,9 +292,6 @@ class TestRecursiveMakeBackend(BackendTester): 'DEFFILE': [ 'DEFFILE := baz.def', ], - 'USE_STATIC_LIBS': [ - 'USE_STATIC_LIBS := 1', - ], 'MOZBUILD_CFLAGS': [ 'MOZBUILD_CFLAGS += -fno-exceptions', 'MOZBUILD_CFLAGS += -w', diff --git a/python/mozbuild/mozbuild/test/frontend/data/generated-sources/moz.build b/python/mozbuild/mozbuild/test/frontend/data/generated-sources/moz.build index a878696070..cf38f02595 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/generated-sources/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/generated-sources/moz.build @@ -2,6 +2,13 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ +@template +def Library(name): + '''Template for libraries.''' + LIBRARY_NAME = name + +Library('dummy') + SOURCES += [ '!a.cpp', '!b.cc', diff --git a/python/mozbuild/mozbuild/test/frontend/data/host-sources/moz.build b/python/mozbuild/mozbuild/test/frontend/data/host-sources/moz.build index 97be75b387..391ab22abf 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/host-sources/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/host-sources/moz.build @@ -2,6 +2,13 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ +@template +def HostLibrary(name): + '''Template for libraries.''' + HOST_LIBRARY_NAME = name + +HostLibrary('dummy') + HOST_SOURCES += [ 'a.cpp', 'b.cc', diff --git a/python/mozbuild/mozbuild/test/frontend/data/sources/moz.build b/python/mozbuild/mozbuild/test/frontend/data/sources/moz.build index 1063a3989a..32eedeee07 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/sources/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/sources/moz.build @@ -2,6 +2,13 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ +@template +def Library(name): + '''Template for libraries.''' + LIBRARY_NAME = name + +Library('dummy') + SOURCES += [ 'a.cpp', 'b.cc', diff --git a/python/mozbuild/mozbuild/test/frontend/data/unified-sources-non-unified/moz.build b/python/mozbuild/mozbuild/test/frontend/data/unified-sources-non-unified/moz.build index ba99b873fb..9016b12366 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/unified-sources-non-unified/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/unified-sources-non-unified/moz.build @@ -2,6 +2,13 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ +@template +def Library(name): + '''Template for libraries.''' + LIBRARY_NAME = name + +Library('dummy') + UNIFIED_SOURCES += [ 'bar.cxx', 'foo.cpp', diff --git a/python/mozbuild/mozbuild/test/frontend/data/unified-sources/moz.build b/python/mozbuild/mozbuild/test/frontend/data/unified-sources/moz.build index 872c32cae0..9eee715728 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/unified-sources/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/unified-sources/moz.build @@ -2,6 +2,13 @@ # Any copyright is dedicated to the Public Domain. # http://creativecommons.org/publicdomain/zero/1.0/ +@template +def Library(name): + '''Template for libraries.''' + LIBRARY_NAME = name + +Library('dummy') + UNIFIED_SOURCES += [ 'bar.cxx', 'foo.cpp', diff --git a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build index 7385e8cc71..28716ff98d 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build @@ -13,8 +13,6 @@ RESFILE = 'bar.res' RCINCLUDE = 'bar.rc' DEFFILE = 'baz.def' -USE_STATIC_LIBS = True - CFLAGS += ['-fno-exceptions', '-w'] CXXFLAGS += ['-fcxx-exceptions', '-include foo.h'] LDFLAGS += ['-framework Foo', '-x'] diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py index 0b532d9543..4b693360fc 100644 --- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py +++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py @@ -179,7 +179,6 @@ class TestEmitterBasic(unittest.TestCase): 'RESFILE': 'bar.res', 'RCINCLUDE': 'bar.rc', 'DEFFILE': 'baz.def', - 'USE_STATIC_LIBS': True, 'MOZBUILD_CFLAGS': ['-fno-exceptions', '-w'], 'MOZBUILD_CXXFLAGS': ['-fcxx-exceptions', '-include foo.h'], 'MOZBUILD_LDFLAGS': ['-framework Foo', '-x', '-DELAYLOAD:foo.dll', @@ -741,6 +740,8 @@ class TestEmitterBasic(unittest.TestCase): reader = self.reader('sources') objs = self.read_topsrcdir(reader) + # The last object is a Linkable, ignore it + objs = objs[:-1] self.assertEqual(len(objs), 6) for o in objs: self.assertIsInstance(o, Sources) @@ -767,6 +768,8 @@ class TestEmitterBasic(unittest.TestCase): reader = self.reader('generated-sources') objs = self.read_topsrcdir(reader) + # The last object is a Linkable, ignore it + objs = objs[:-1] self.assertEqual(len(objs), 6) generated_sources = [o for o in objs if isinstance(o, GeneratedSources)] @@ -794,6 +797,8 @@ class TestEmitterBasic(unittest.TestCase): reader = self.reader('host-sources') objs = self.read_topsrcdir(reader) + # The last object is a Linkable, ignore it + objs = objs[:-1] self.assertEqual(len(objs), 3) for o in objs: self.assertIsInstance(o, HostSources) @@ -817,6 +822,8 @@ class TestEmitterBasic(unittest.TestCase): reader = self.reader('unified-sources') objs = self.read_topsrcdir(reader) + # The last object is a Linkable, ignore it + objs = objs[:-1] self.assertEqual(len(objs), 3) for o in objs: self.assertIsInstance(o, UnifiedSources) @@ -841,6 +848,8 @@ class TestEmitterBasic(unittest.TestCase): reader = self.reader('unified-sources-non-unified') objs = self.read_topsrcdir(reader) + # The last object is a Linkable, ignore it + objs = objs[:-1] self.assertEqual(len(objs), 3) for o in objs: self.assertIsInstance(o, UnifiedSources) diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in index 01b16a8f29..a4bfb76dfb 100644 --- a/toolkit/xre/Makefile.in +++ b/toolkit/xre/Makefile.in @@ -12,43 +12,29 @@ milestone_txt = $(topsrcdir)/config/milestone.txt include $(topsrcdir)/config/rules.mk -# Should version be optional or required ? -TOOLKIT_EM_VERSION=$(shell $(PYTHON) $(topsrcdir)/python/mozbuild/mozbuild/milestone.py --topsrcdir=$(topsrcdir)) -$(call warnIfEmpty,TOOLKIT_EM_VERSION) - -# Valid if null: {warn,error}IfEmpty -DEFINES += -DTOOLKIT_EM_VERSION='"$(TOOLKIT_EM_VERSION)"' - MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template='{node}\n' 2>/dev/null)) -ifdef MOZ_SOURCE_STAMP +ifneq (,$(strip $(MOZ_SOURCE_STAMP))) - INIARGS = --sourcestamp=$(MOZ_SOURCE_STAMP) + DEFINES += -DMOZ_SOURCE_STAMP=$(MOZ_SOURCE_STAMP) ifdef MOZ_INCLUDE_SOURCE_INFO source_repo := $(call getSourceRepo) # extra sanity check for old versions of hg, no showconfig support ifneq (,$(filter http%,$(source_repo))) - INIARGS += --sourcerepo=$(source_repo) + DEFINES += -DMOZ_SOURCE_REPO=$(source_repo) endif endif endif # MOZ_SOURCE_STAMP -GRE_BUILDID := $(strip $(firstword $(shell cat $(DEPTH)/config/buildid 2>/dev/null))) -$(call errorIfEmpty,GRE_MILESTONE GRE_BUILDID) +MOZ_BUILDID := $(shell awk '{print $$3}' $(DEPTH)/buildid.h) +$(call errorIfEmpty,GRE_MILESTONE MOZ_BUILDID) -DEFINES += -DGRE_BUILDID=$(GRE_BUILDID) +DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID) -.PHONY: nsAppRunner.$(OBJ_SUFFIX) - -$(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(milestone_txt) - -platform.ini: FORCE - $(PYTHON) $(srcdir)/make-platformini.py --buildid=$(GRE_BUILDID) $(INIARGS) $(milestone_txt) > $@ - -GARBAGE += platform.ini - -# Moving this out of libs breaks packaging. -libs:: platform.ini - $(INSTALL) $^ $(DIST)/bin +# Note these dependencies are broken because the target is *not* the cpp file. +# BUT, actually fixing it would make libxul rebuilt on every single incremental +# build because of the automatic buildid change. This is why we can't actually +# include buildid.h there, because it would add the dependency. +$(srcdir)/nsAppRunner.cpp: $(DEPTH)/buildid.h $(milestone_txt) diff --git a/toolkit/xre/make-platformini.py b/toolkit/xre/make-platformini.py deleted file mode 100644 index c27429bf48..0000000000 --- a/toolkit/xre/make-platformini.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/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/. - - -from optparse import OptionParser -from datetime import datetime -import time -import sys -import os - -o = OptionParser() -o.add_option("--buildid", dest="buildid") -o.add_option("--print-buildid", action="store_true", dest="print_buildid") -o.add_option("--print-timestamp", action="store_true", dest="print_timestamp") -o.add_option("--sourcestamp", dest="sourcestamp") -o.add_option("--sourcerepo", dest="sourcerepo") - -(options, args) = o.parse_args() - -if options.print_timestamp: - print int(time.time()) - sys.exit(0) - -if options.print_buildid: - print datetime.utcnow().strftime('%Y%m%d%H%M%S') - sys.exit(0) - -if not options.buildid: - print >>sys.stderr, "--buildid is required" - sys.exit(1) - -(milestoneFile,) = args -for line in open(milestoneFile, 'r'): - if line[0] == '#': - continue - - line = line.strip() - if line == '': - continue - - milestone = line - -print """[Build] -BuildID=%s -Milestone=%s""" % (options.buildid, milestone) -if options.sourcestamp: - print "SourceStamp=%s" % options.sourcestamp -if options.sourcerepo: - print "SourceRepository=%s" % options.sourcerepo diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build index 21d08a6eac..d5ae118357 100644 --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build @@ -178,3 +178,8 @@ CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS'] if CONFIG['MOZ_WIDGET_GTK']: CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS'] + +DEFINES['TOPOBJDIR'] = TOPOBJDIR +FINAL_TARGET_PP_FILES += [ + 'platform.ini' +] diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 2939e3017c..18803551b5 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -213,7 +213,7 @@ int gArgc; char **gArgv; static const char gToolkitVersion[] = NS_STRINGIFY(GRE_MILESTONE); -static const char gToolkitBuildID[] = NS_STRINGIFY(GRE_BUILDID); +static const char gToolkitBuildID[] = NS_STRINGIFY(MOZ_BUILDID); static nsIProfileLock* gProfileLock; @@ -242,6 +242,12 @@ static char **gQtOnlyArgv; #include #endif #include "BinaryPath.h" +#ifndef MOZ_BUILDID +// See comment in Makefile.in why we want to avoid including buildid.h. +// Still include it when MOZ_BUILDID is not set, which can happen with some +// build backends. +#include "buildid.h" +#endif #ifdef MOZ_LINKER extern "C" MFBT_API bool IsSignalHandlingBroken(); diff --git a/toolkit/xre/platform.ini b/toolkit/xre/platform.ini new file mode 100644 index 0000000000..0b337554ab --- /dev/null +++ b/toolkit/xre/platform.ini @@ -0,0 +1,16 @@ +#if 0 +; 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/. +#endif +#filter substitution +#include @TOPOBJDIR@/buildid.h +[Build] +BuildID=@MOZ_BUILDID@ +Milestone=@GRE_MILESTONE@ +#ifdef MOZ_SOURCE_REPO +SourceRepository=@MOZ_SOURCE_REPO@ +#endif +#ifdef MOZ_SOURCE_STAMP +SourceStamp=@MOZ_SOURCE_STAMP@ +#endif diff --git a/webapprt/Makefile.in b/webapprt/Makefile.in index ac3998cd72..b83f13feeb 100644 --- a/webapprt/Makefile.in +++ b/webapprt/Makefile.in @@ -10,7 +10,7 @@ include $(topsrcdir)/config/rules.mk libs:: $(call mkdir_deps,$(FINAL_TARGET)) $(call py_action,buildlist,$(FINAL_TARGET)/chrome.manifest 'resource webapprt ./') -MOZ_APP_BUILDID := $(shell cat $(DEPTH)/config/buildid) -DEFINES += -DMOZ_APP_BUILDID=$(MOZ_APP_BUILDID) +MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid) +DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID) $(FINAL_TARGET)/webapprt.ini: $(DEPTH)/config/buildid $(topsrcdir)/config/milestone.txt diff --git a/webapprt/moz.build b/webapprt/moz.build index 5336c4d173..7eef33fc47 100644 --- a/webapprt/moz.build +++ b/webapprt/moz.build @@ -57,3 +57,5 @@ JS_PREFERENCE_PP_FILES += [ FINAL_TARGET_PP_FILES += [ 'webapprt.ini', ] + +DEFINES['TOPOBJDIR'] = TOPOBJDIR diff --git a/webapprt/webapprt.ini b/webapprt/webapprt.ini index e6cbabe313..9be546504a 100644 --- a/webapprt/webapprt.ini +++ b/webapprt/webapprt.ini @@ -5,6 +5,7 @@ #endif #filter substitution +#include @TOPOBJDIR@/buildid.h [App] ID=webapprt@mozilla.org @@ -14,7 +15,7 @@ Vendor=Mozilla ; as distinct products, per bug 747409. Name=Webapp Runtime Version=@GRE_MILESTONE@ -BuildID=@MOZ_APP_BUILDID@ +BuildID=@MOZ_BUILDID@ UAName=@MOZ_APP_BASENAME@ [Gecko] @@ -25,4 +26,4 @@ MaxVersion=@GRE_MILESTONE@ #if MOZILLA_OFFICIAL Enabled=1 #endif -ServerURL=https://crash-reports.mozilla.com/submit?id=webapprt@mozilla.org&version=@GRE_MILESTONE@&buildid=@MOZ_APP_BUILDID@ +ServerURL=https://crash-reports.mozilla.com/submit?id=webapprt@mozilla.org&version=@GRE_MILESTONE@&buildid=@MOZ_BUILDID@ diff --git a/webapprt/win/Makefile.in b/webapprt/win/Makefile.in index b2d23edc6f..15f49bbb7f 100644 --- a/webapprt/win/Makefile.in +++ b/webapprt/win/Makefile.in @@ -48,9 +48,3 @@ PROGRAMS_DEST = $(DIST)/bin include $(topsrcdir)/config/rules.mk include $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk - -GRE_BUILDID := $(shell cat $(DEPTH)/config/buildid) -DEFINES += -DGRE_BUILDID=$(GRE_BUILDID) - -webapprt.$(OBJ_SUFFIX): $(DEPTH)/config/buildid -