Skip to content

Commit

Permalink
Bug 1620744 - Use py3_action for cases that already support it; r=fir…
Browse files Browse the repository at this point in the history
…efox-build-system-reviewers,rstewart

Differential Revision: https://phabricator.services.mozilla.com/D65846
  • Loading branch information
mshal committed Mar 9, 2020
1 parent 4cf1ea5 commit 0c327f8
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ endif
.PHONY: symbolsfullarchive
symbolsfullarchive: prepsymbolsarchive
$(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
$(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
$(call py3_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
$(abspath $(DIST)/crashreporter-symbols) \
--full-archive)

.PHONY: symbolsarchive
symbolsarchive: prepsymbolsarchive
$(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
$(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
$(call py3_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
$(abspath $(DIST)/crashreporter-symbols))

ifdef MOZ_CRASHREPORTER
Expand Down
2 changes: 1 addition & 1 deletion browser/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ endif
# steps. See bug 1431342.
libs:: $(srcdir)/profile/channel-prefs.js
$(NSINSTALL) -D $(DIST)/bin/defaults/pref
$(call py_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
$(call py3_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

Expand Down
2 changes: 1 addition & 1 deletion browser/installer/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ endif

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

Expand Down
2 changes: 1 addition & 1 deletion browser/installer/windows/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $(CONFIG_DIR)/setup.exe::
$(MKDIR) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(call py3_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
Expand Down
4 changes: 2 additions & 2 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ ifndef MOZ_DEBUG
endif
endif
@echo 'Packaging $(XPI_PKGNAME).xpi...'
$(call py_action,zip,-C $(FINAL_TARGET) ../$(XPI_PKGNAME).xpi '*')
$(call py3_action,zip,-C $(FINAL_TARGET) ../$(XPI_PKGNAME).xpi '*')
endif

# See comment above about moving this out of the tools tier.
Expand Down Expand Up @@ -1159,7 +1159,7 @@ PP_TARGETS_ALL_RESULTS := $(sort $(foreach tier,$(PP_TARGETS_TIERS),$(PP_TARGETS
$(PP_TARGETS_ALL_RESULTS):
$(if $(filter-out $(notdir $@),$(notdir $(<:.in=))),$(error Looks like $@ has an unexpected dependency on $< which breaks PP_TARGETS))
$(RM) '$@'
$(call py_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) '$<' -o '$@')
$(call py3_action,preprocessor,--depend $(MDDEPDIR)/$(@F).pp $(PP_TARGET_FLAGS) $(DEFINES) $(ACDEFINES) '$<' -o '$@')

$(filter %.css,$(PP_TARGETS_ALL_RESULTS)): PP_TARGET_FLAGS+=--marker %

Expand Down
1 change: 0 additions & 1 deletion mobile/android/geckoview/src/androidTest/assets/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ for addon in addons:

GENERATED_FILES += [xpi]
GENERATED_FILES[xpi].script = '../../../../../../toolkit/mozapps/extensions/test/create_xpi.py'
GENERATED_FILES[xpi].py2 = True
GENERATED_FILES[xpi].inputs = [indir]

TEST_HARNESS_FILES.testing.mochitest.tests.junit += ['!%s' % xpi]
2 changes: 1 addition & 1 deletion mozglue/build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include $(topsrcdir)/config/config.mk

ifeq (WINNT,$(OS_TARGET))
mozglue.def: $(srcdir)/mozglue.def.in $(GLOBAL_DEPS)
$(call py_action,preprocessor,$(if $(MOZ_REPLACE_MALLOC),-DMOZ_REPLACE_MALLOC) $(ACDEFINES) $< -o $@)
$(call py3_action,preprocessor,$(if $(MOZ_REPLACE_MALLOC),-DMOZ_REPLACE_MALLOC) $(ACDEFINES) $< -o $@)

GARBAGE += mozglue.def

Expand Down
8 changes: 4 additions & 4 deletions python/mozbuild/mozbuild/backend/recursivemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,13 +1591,13 @@ def _process_chrome_manifest_entry(self, obj, backend_file):
mozpath.relpath(obj.path,
obj.install_target))),
]
rule.add_commands(['$(call py_action,buildlist,%s)' %
rule.add_commands(['$(call py3_action,buildlist,%s)' %
' '.join(args)])
args = [
mozpath.join('$(DEPTH)', obj.path),
make_quote(shell_quote(str(obj.entry))),
]
rule.add_commands(['$(call py_action,buildlist,%s)' % ' '.join(args)])
rule.add_commands(['$(call py3_action,buildlist,%s)' % ' '.join(args)])
fragment.dump(backend_file.fh, removal_guard=False)

self._no_skip['misc'].add(obj.relsrcdir)
Expand Down Expand Up @@ -1683,7 +1683,7 @@ def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources, sorted_nonstatic_i
rule.add_dependencies([source])
rule.add_commands([
'$(RM) $@',
'$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) '
'$(call py3_action,preprocessor,$(DEFINES) $(ACDEFINES) '
'$< -o $@)'
])

Expand Down Expand Up @@ -1738,7 +1738,7 @@ def _handle_webidl_build(self, bindings_dir, unified_source_mapping,
# static to preprocessed don't end up writing to a symlink,
# which would modify content in the source directory.
'$(RM) $@',
'$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) '
'$(call py3_action,preprocessor,$(DEFINES) $(ACDEFINES) '
'$< -o $@)'
])

Expand Down
1 change: 1 addition & 0 deletions python/mozbuild/mozbuild/test/backend/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

BASE_SUBSTS = [
('PYTHON', mozpath.normsep(sys.executable)),
('PYTHON3', mozpath.normsep(sys.executable)),
('MOZ_UI_LOCALE', 'en-US'),
]

Expand Down
1 change: 0 additions & 1 deletion toolkit/mozapps/extensions/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ built_in_addons = 'built_in_addons.json'
GENERATED_FILES += [built_in_addons]
manifest = GENERATED_FILES[built_in_addons]
manifest.script = 'gen_built_in_addons.py'
manifest.py2 = True

if CONFIG['MOZ_BUILD_APP'] == 'browser':
manifest.flags = ['--features=browser/features']
Expand Down
4 changes: 2 additions & 2 deletions toolkit/mozapps/installer/packager.mk
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,14 @@ endif
# and places it in dist/bin/res - it should be used when packaging a build.
multilocale.txt: LOCALES?=$(MOZ_CHROME_MULTILOCALE)
multilocale.txt:
$(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp '$(MULTILOCALE_DIR)/multilocale.txt' $(ALL_LOCALES))
$(call py3_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp '$(MULTILOCALE_DIR)/multilocale.txt' $(ALL_LOCALES))

# This version of the target uses AB_CD to build multilocale.txt and places it
# in the $(XPI_NAME)/res dir - it should be used when repackaging a build.
multilocale.txt-%: LOCALES?=$(AB_CD)
multilocale.txt-%: MULTILOCALE_DIR=$(DIST)/xpi-stage/$(XPI_NAME)/res
multilocale.txt-%:
$(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp '$(MULTILOCALE_DIR)/multilocale.txt' $(ALL_LOCALES))
$(call py3_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp '$(MULTILOCALE_DIR)/multilocale.txt' $(ALL_LOCALES))

locale-manifest.in: LOCALES?=$(MOZ_CHROME_MULTILOCALE)
locale-manifest.in: $(GLOBAL_DEPS) FORCE
Expand Down
14 changes: 7 additions & 7 deletions toolkit/mozapps/installer/upload-files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ifdef FUZZING_INTERFACES
JSSHELL_BINS += fuzz-tests$(BIN_SUFFIX)
endif

MAKE_JSSHELL = $(call py_action,zip,-C $(DIST)/bin --strip $(abspath $(PKG_JSSHELL)) $(JSSHELL_BINS))
MAKE_JSSHELL = $(call py3_action,zip,-C $(DIST)/bin --strip $(abspath $(PKG_JSSHELL)) $(JSSHELL_BINS))

ifneq (,$(PGO_JARLOG_PATH))
# The backslash subst is to work around an issue with our version of mozmake,
Expand Down Expand Up @@ -134,14 +134,14 @@ endif

ifeq ($(MOZ_PKG_FORMAT),ZIP)
PKG_SUFFIX = .zip
INNER_MAKE_PACKAGE = $(call py_action,make_zip,'$(MOZ_PKG_DIR)' '$(PACKAGE)')
INNER_UNMAKE_PACKAGE = $(call py_action,make_unzip,$(UNPACKAGE))
INNER_MAKE_PACKAGE = $(call py3_action,make_zip,'$(MOZ_PKG_DIR)' '$(PACKAGE)')
INNER_UNMAKE_PACKAGE = $(call py3_action,make_unzip,$(UNPACKAGE))
endif

ifeq ($(MOZ_PKG_FORMAT),SFX7Z)
PKG_SUFFIX = .exe
INNER_MAKE_PACKAGE = $(call py_action,exe_7z_archive,'$(MOZ_PKG_DIR)' '$(MOZ_INSTALLER_PATH)/app.tag' '$(MOZ_SFX_PACKAGE)' '$(PACKAGE)')
INNER_UNMAKE_PACKAGE = $(call py_action,exe_7z_extract,$(UNPACKAGE) $(MOZ_PKG_DIR))
INNER_MAKE_PACKAGE = $(call py3_action,exe_7z_archive,'$(MOZ_PKG_DIR)' '$(MOZ_INSTALLER_PATH)/app.tag' '$(MOZ_SFX_PACKAGE)' '$(PACKAGE)')
INNER_UNMAKE_PACKAGE = $(call py3_action,exe_7z_extract,$(UNPACKAGE) $(MOZ_PKG_DIR))
endif

#Create an RPM file
Expand Down Expand Up @@ -231,15 +231,15 @@ ifeq ($(MOZ_PKG_FORMAT),DMG)
_ABS_MOZSRCDIR = $(shell cd $(MOZILLA_DIR) && pwd)
PKG_DMG_SOURCE = $(MOZ_PKG_DIR)
INNER_MAKE_PACKAGE = \
$(call py_action,make_dmg, \
$(call py3_action,make_dmg, \
$(if $(MOZ_PKG_MAC_DSSTORE),--dsstore '$(MOZ_PKG_MAC_DSSTORE)') \
$(if $(MOZ_PKG_MAC_BACKGROUND),--background '$(MOZ_PKG_MAC_BACKGROUND)') \
$(if $(MOZ_PKG_MAC_ICON),--icon '$(MOZ_PKG_MAC_ICON)') \
--volume-name '$(MOZ_APP_DISPLAYNAME)' \
'$(PKG_DMG_SOURCE)' '$(PACKAGE)' \
)
INNER_UNMAKE_PACKAGE = \
$(call py_action,unpack_dmg, \
$(call py3_action,unpack_dmg, \
$(if $(MOZ_PKG_MAC_DSSTORE),--dsstore '$(MOZ_PKG_MAC_DSSTORE)') \
$(if $(MOZ_PKG_MAC_BACKGROUND),--background '$(MOZ_PKG_MAC_BACKGROUND)') \
$(if $(MOZ_PKG_MAC_ICON),--icon '$(MOZ_PKG_MAC_ICON)') \
Expand Down
4 changes: 2 additions & 2 deletions toolkit/mozapps/installer/windows/nsis/makensis.mk
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ $(CONFIG_DIR)/helper.exe: $(HELPER_DEPS)
$(MKDIR) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(call py3_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
Expand All @@ -117,7 +117,7 @@ maintenanceservice_installer::
$(MKDIR) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(call py3_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(topsrcdir) \
Expand Down

0 comments on commit 0c327f8

Please sign in to comment.