Skip to content

Commit f137fa0

Browse files
committed
Backed out 6 changesets (bug 1632916, bug 1599658, bug 1633037, bug 1633039, bug 1633016, bug 1632920) for SA bustages CLOSED TREE
Backed out changeset 332ce0963b4e (bug 1633039) Backed out changeset a9904cbc40d9 (bug 1633037) Backed out changeset d06b0ec349f8 (bug 1599658) Backed out changeset 8fd300cad80f (bug 1633016) Backed out changeset f8820941c703 (bug 1632916) Backed out changeset ac9c2c8746ed (bug 1632920)
1 parent d1320d8 commit f137fa0

File tree

73 files changed

+334
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+334
-253
lines changed

Makefile.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
9898
@# same directory, because that would blow up
9999
$(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
100100
endif
101-
$(addprefix $(call py_action,process_install_manifest,--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
101+
$(addprefix $(call py3_action,process_install_manifest,--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
102102

103103
# Dummy wrapper rule to allow the faster backend to piggy back
104104
$(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
@@ -108,7 +108,7 @@ install-tests: install-test-files
108108

109109
.PHONY: install-test-files
110110
install-test-files:
111-
$(call py_action,process_install_manifest,--track install__test_files.track _tests _build_manifests/install/_test_files)
111+
$(call py3_action,process_install_manifest,--track install__test_files.track _tests _build_manifests/install/_test_files)
112112

113113
include $(topsrcdir)/build/moz-automation.mk
114114

@@ -140,7 +140,7 @@ endif
140140

141141
ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
142142
recurse_android-fat-aar-artifact:
143-
$(call py_action,fat_aar,\
143+
$(call py3_action,fat_aar,\
144144
$(addprefix --armeabi-v7a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
145145
$(addprefix --arm64-v8a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
146146
$(addprefix --x86 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86)) \
@@ -196,14 +196,14 @@ endif
196196
.PHONY: symbolsfullarchive
197197
symbolsfullarchive: prepsymbolsarchive
198198
$(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
199-
$(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
199+
$(call py3_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
200200
$(abspath $(DIST)/crashreporter-symbols) \
201201
--full-archive)
202202

203203
.PHONY: symbolsarchive
204204
symbolsarchive: prepsymbolsarchive
205205
$(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
206-
$(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
206+
$(call py3_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
207207
$(abspath $(DIST)/crashreporter-symbols))
208208

209209
ifdef MOZ_CRASHREPORTER
@@ -220,7 +220,7 @@ endif
220220

221221
uploadsymbols:
222222
ifdef MOZ_CRASHREPORTER
223-
$(PYTHON3) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
223+
$(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
224224
endif
225225

226226
.PHONY: update-packaging
@@ -229,7 +229,7 @@ update-packaging:
229229

230230
.PHONY: package-generated-sources
231231
package-generated-sources:
232-
$(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
232+
$(call py3_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
233233

234234
ifdef JS_STANDALONE
235235
# Delegate js-specific rules to js

browser/app/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ endif
5656
# steps. See bug 1431342.
5757
libs:: $(srcdir)/profile/channel-prefs.js
5858
$(NSINSTALL) -D $(DIST)/bin/defaults/pref
59-
$(call py_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
59+
$(call py3_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
6060

6161
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
6262

@@ -78,7 +78,7 @@ LPROJ := Contents/Resources/$(LPROJ_ROOT).lproj
7878
clean clobber repackage::
7979
$(RM) -r $(dist_dest)
8080

81-
MAC_BUNDLE_VERSION = $(shell $(PYTHON3) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/buildid.h)
81+
MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/buildid.h)
8282

8383
.PHONY: repackage
8484
tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME)

browser/app/macversion.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@
33
# License, v. 2.0. If a copy of the MPL was not distributed with this
44
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
55

6-
from __future__ import absolute_import, print_function, unicode_literals
7-
import io
6+
from __future__ import absolute_import, print_function
87
from optparse import OptionParser
98
import sys
109
import re
1110

1211
o = OptionParser()
13-
o.add_option('--buildid', dest='buildid')
14-
o.add_option('--version', dest='version')
12+
o.add_option("--buildid", dest="buildid")
13+
o.add_option("--version", dest="version")
1514

1615
(options, args) = o.parse_args()
1716

1817
if not options.buildid:
19-
print('--buildid is required', file=sys.stderr)
18+
print >>sys.stderr, "--buildid is required"
2019
sys.exit(1)
2120

2221
if not options.version:
23-
print('--version is required', file=sys.stderr)
22+
print >>sys.stderr, "--version is required"
2423
sys.exit(1)
2524

2625
# We want to build a version number that matches the format allowed for
@@ -29,8 +28,7 @@
2928
# builds), but also so that newly-built older versions (e.g. beta build) aren't
3029
# considered "newer" than previously-built newer versions (e.g. a trunk nightly)
3130

32-
define, MOZ_BUILDID, buildid = io.open(
33-
options.buildid, 'r', encoding='utf-8').read().split()
31+
define, MOZ_BUILDID, buildid = open(options.buildid, 'r').read().split()
3432

3533
# extract only the major version (i.e. "14" from "14.0b1")
3634
majorVersion = re.match(r'^(\d+)[^\d].*', options.version).group(1)

browser/installer/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ endif
177177

178178
package-compare::
179179
cd $(DIST); find $(PKGCOMP_FIND_OPTS) '$(FINDPATH)' -type f | sort > bin-list.txt
180-
$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(MOZ_PKG_MANIFEST)) | grep '^$(BINPATH)' | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt
180+
$(call py3_action,preprocessor,$(DEFINES) $(ACDEFINES) $(MOZ_PKG_MANIFEST)) | grep '^$(BINPATH)' | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt
181181
-diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt
182182
rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
183183

browser/installer/windows/Makefile.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ $(CONFIG_DIR)/setup.exe::
6060
$(MKDIR) $(CONFIG_DIR)
6161
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
6262
$(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR)
63-
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
63+
$(call py3_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
6464
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
65-
$(PYTHON3) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
65+
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
6666
--preprocess-locale $(topsrcdir) \
6767
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
68-
$(PYTHON3) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
68+
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
6969
--preprocess-single-file $(topsrcdir) \
7070
$(PPL_LOCALE_ARGS) $(CONFIG_DIR) \
7171
nsisstrings.properties nsisstrings.nlf
72-
$(PYTHON3) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
72+
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
7373
--convert-utf8-utf16le \
7474
$(srcdir)/nsis/extensionsLocale.nsh $(CONFIG_DIR)/extensionsLocale.nsh
7575

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ task machBuildFaster(type: MachExec) {
168168

169169
workingDir "${topsrcdir}"
170170

171-
commandLine mozconfig.substs.PYTHON3
171+
commandLine mozconfig.substs.PYTHON
172172
args "${topsrcdir}/mach"
173173
args 'build'
174174
args 'faster'

build/autoconf/compiler-opts.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
146146
if AC_TRY_COMMAND([${CC-cc} -o conftest.${ac_objext} $CFLAGS $MOZ_DEBUG_FLAGS -c conftest.${ac_ext} 1>&2]) &&
147147
AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS $MOZ_DEBUG_FLAGS -Wl,--gc-sections conftest.${ac_objext} $LIBS 1>&2]) &&
148148
test -s conftest${ac_exeext} -a -s conftest.${ac_objext}; then
149-
if test "`$PYTHON3 -m mozbuild.configure.check_debug_ranges conftest.${ac_objext} conftest.${ac_ext}`" = \
150-
"`$PYTHON3 -m mozbuild.configure.check_debug_ranges conftest${ac_exeext} conftest.${ac_ext}`"; then
149+
if test "`$PYTHON -m mozbuild.configure.check_debug_ranges conftest.${ac_objext} conftest.${ac_ext}`" = \
150+
"`$PYTHON -m mozbuild.configure.check_debug_ranges conftest${ac_exeext} conftest.${ac_ext}`"; then
151151
GC_SECTIONS_BREAKS_DEBUG_RANGES=no
152152
else
153153
GC_SECTIONS_BREAKS_DEBUG_RANGES=yes

build/moz-automation.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ AUTOMATION_EXTRA_CMDLINE-check = --keep-going
9292
# However, the target automation/buildsymbols will still be executed in this
9393
# case because it is a prerequisite of automation/upload.
9494
define automation_commands
95-
@+$(PYTHON3) $(topsrcdir)/config/run-and-prefix.py $1 $(MAKE) $1 $(AUTOMATION_EXTRA_CMDLINE-$1)
95+
@+$(PYTHON) $(topsrcdir)/config/run-and-prefix.py $1 $(MAKE) $1 $(AUTOMATION_EXTRA_CMDLINE-$1)
9696
$(call BUILDSTATUS,TIER_FINISH $1)
9797
endef
9898

build/moz.configure/init.configure

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,113 @@ def mozconfig_options(mozconfig, automation, help):
470470
add(key, value)
471471

472472

473+
# Python 2
474+
# ========
475+
476+
option(env='PYTHON', nargs=1, help='Python 2.7 interpreter')
477+
478+
479+
@depends('PYTHON', check_build_environment, 'MOZILLABUILD')
480+
@imports(_from='__builtin__', _import='Exception')
481+
@imports(_from='mozbuild.configure.util', _import='LineIO')
482+
@imports(_from='mozbuild.virtualenv', _import='VirtualenvManager')
483+
@imports(_from='mozbuild.virtualenv', _import='verify_python_version')
484+
@imports(_from='mozbuild.pythonutil', _import='find_python2_executable')
485+
@imports(_from='mozbuild.pythonutil', _import='python_executable_version')
486+
@imports(_from='six', _import='ensure_text')
487+
def virtualenv_python2(env_python, build_env, mozillabuild):
488+
# Verify that the Python version we executed this code with is the minimum
489+
# required version to handle all project code.
490+
with LineIO(lambda l: log.error(l)) as out:
491+
verify_python_version(out)
492+
493+
python = env_python[0] if env_python else None
494+
495+
log.debug("python2: executable from configuration: %r" % python)
496+
497+
# If this is a mozilla-central build, we'll find the virtualenv in the top
498+
# source directory. If this is a SpiderMonkey build, we assume we're at
499+
# js/src and try to find the virtualenv from the mozilla-central root.
500+
# See mozilla-central changeset d2cce982a7c809815d86d5daecefe2e7a563ecca
501+
# Bug 784841
502+
topsrcdir, topobjdir = build_env.topsrcdir, build_env.topobjdir
503+
if topobjdir.endswith('/js/src'):
504+
topobjdir = topobjdir[:-7]
505+
506+
# If we know the Python executable the caller is asking for then verify its
507+
# version. If the caller did not ask for a specific executable then find
508+
# a reasonable default.
509+
if python:
510+
try:
511+
version = python_executable_version(python).version
512+
except Exception as e:
513+
raise FatalCheckError('could not determine version of PYTHON '
514+
'(%s): %s' % (python, e))
515+
elif mozillabuild:
516+
# MozillaBuild provides a Python 2.
517+
python = normsep('%s/python/python2.exe' % mozillabuild)
518+
519+
try:
520+
version = python_executable_version(python).version
521+
except Exception as e:
522+
raise FatalCheckError('could not determine version of '
523+
'MozillaBuild python: %s' % e)
524+
else:
525+
# Fall back to the search routine.
526+
python, version = find_python2_executable()
527+
528+
# The API returns a bytes whereas everything in configure is unicode.
529+
if python:
530+
python = ensure_text(python)
531+
532+
if not python:
533+
raise FatalCheckError('Python 2.7 is required to build. '
534+
'Ensure a `python2.7` executable is in your '
535+
'PATH or define PYTHON to point to a Python '
536+
'2.7 executable.')
537+
538+
if version < (2, 7, 0):
539+
raise FatalCheckError('Python 2.7 required to build; '
540+
'%s is Python %d.%d' % (python, version[0],
541+
version[1]))
542+
543+
log.debug("python2: found executable: %r" % python)
544+
545+
virtualenvs_root = os.path.join(topobjdir, '_virtualenvs')
546+
with LineIO(lambda l: log.info(l), 'replace') as out:
547+
manager = VirtualenvManager(
548+
topsrcdir, topobjdir,
549+
os.path.join(virtualenvs_root, 'init'), out,
550+
os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt'))
551+
552+
log.debug("python: using venv: %r" % manager.virtualenv_root)
553+
554+
if not manager.up_to_date(python):
555+
log.info('Creating Python 2 environment')
556+
manager.build(python)
557+
else:
558+
log.debug("python2: venv is up to date")
559+
560+
python = normsep(manager.python_path)
561+
str_version = '.'.join(str(v) for v in version)
562+
563+
return namespace(
564+
path=python,
565+
version=version,
566+
str_version=str_version,
567+
)
568+
569+
570+
@depends(virtualenv_python2)
571+
@checking('for Python 2', callback=lambda x: '%s (%s)' % (x.path, x.str_version))
572+
def virtualenv_python2(venv):
573+
return venv
574+
575+
576+
set_config('PYTHON', virtualenv_python2.path)
577+
add_old_configure_assignment('PYTHON', virtualenv_python2.path)
578+
579+
473580
# Source checkout and version control integration.
474581
# ================================================
475582

client.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ifeq "$(CWD)" "/"
3232
CWD := /.
3333
endif
3434

35-
PYTHON3 ?= python3
35+
PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
3636

3737
####################################
3838
# Load mozconfig Options
@@ -46,7 +46,7 @@ endif
4646

4747
# Automatically add -jN to make flags if not defined. N defaults to number of cores.
4848
ifeq (,$(findstring -j,$(MOZ_MAKE_FLAGS)))
49-
cores=$(shell $(PYTHON3) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
49+
cores=$(shell $(PYTHON) -c 'import multiprocessing; print(multiprocessing.cpu_count())')
5050
MOZ_MAKE_FLAGS += -j$(cores)
5151
endif
5252

0 commit comments

Comments
 (0)