Bug 891474 - Establish unified directory for Python build actions; r=glandium, ted
authorGregory Szorc <gps@mozilla.com>
Thu, 11 Jul 2013 13:42:26 -0700
changeset 138205 3abc4c4a4f6559974e04e083a2af43cadf6ce18d
parent 138204 da344a3836aeac41ce220b97a416d756826e97d7
child 138206 cc1d6a5a4840d0c76f95a30bf42a1b76bf5eab1a
push id30868
push usergszorc@mozilla.com
push dateThu, 11 Jul 2013 20:43:33 +0000
treeherdermozilla-inbound@3abc4c4a4f65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium, ted
bugs891474
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 891474 - Establish unified directory for Python build actions; r=glandium, ted
Makefile.in
build/xpccheck.py
config/config.mk
config/makefiles/xpcshell.mk
config/purge_directories.py
js/src/config/config.mk
js/src/config/makefiles/xpcshell.mk
python/mozbuild/mozbuild/action/__init__.py
python/mozbuild/mozbuild/action/purge_manifests.py
python/mozbuild/mozbuild/action/xpccheck.py
--- a/Makefile.in
+++ b/Makefile.in
@@ -55,17 +55,17 @@ ifndef MOZ_PROFILE_USE
 # a specific subdirectory of the object directory. The invoked Python
 # script simply iterates over all the manifests, purging files as
 # necessary. To manage new directories or add files to the manifests,
 # modify the backend generator.
 #
 # We need to explicitly put backend.RecursiveMakeBackend.built here
 # otherwise the rule in rules.mk doesn't run early enough.
 default alldep all:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
-	$(PYTHON) $(topsrcdir)/config/purge_directories.py -d _build_manifests/purge .
+	$(call py_action,purge_manifests,-d _build_manifests/purge .)
 endif
 
 CLOBBER: $(topsrcdir)/CLOBBER
 	@echo "STOP!  The CLOBBER file has changed."
 	@echo "Please run the build through a sanctioned build wrapper, such as"
 	@echo "'mach build' or client.mk."
 	@exit 1
 
--- a/config/config.mk
+++ b/config/config.mk
@@ -808,8 +808,16 @@ endif
 
 export CL_INCLUDES_PREFIX
 
 ifeq ($(MOZ_WIDGET_GTK),2)
 MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk2/compat $(MOZ_GTK2_CFLAGS)
 endif
 
 DEFINES += -DNO_NSPR_10_SUPPORT
+
+# Run a named Python build action. The first argument is the name of the build
+# action. The second argument are the arguments to pass to the action (space
+# delimited arguments). e.g.
+#
+#   libs::
+#       $(call py_action,purge_manifests,_build_manifests/purge/foo.manifest)
+py_action = $(PYTHON) -m mozbuild.action.$(1) $(2)
--- a/config/makefiles/xpcshell.mk
+++ b/config/makefiles/xpcshell.mk
@@ -24,19 +24,17 @@ SOLO_FILE ?= $(error Specify a test file
 testxpcsrcdir = $(topsrcdir)/testing/xpcshell
 
 libs:: libs-xpcshell-tests
 
 ###########################################################################
 libs-xpcshell-tests:
 	$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
 ifndef NO_XPCSHELL_MANIFEST_CHECK #{
-	$(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \
-	  $(topsrcdir) \
-	  $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS))
+	$(call py_action,xpccheck,$(topsrcdir) $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS)))
 endif #} NO_XPCSHELL_MANIFEST_CHECK 
 
 ###########################################################################
 # Execute all tests in the $(XPCSHELL_TESTS) directories.
 # See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
 xpcshell-tests:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
 	  -I$(DEPTH)/build \
--- a/js/src/config/config.mk
+++ b/js/src/config/config.mk
@@ -808,8 +808,16 @@ endif
 
 export CL_INCLUDES_PREFIX
 
 ifeq ($(MOZ_WIDGET_GTK),2)
 MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk2/compat $(MOZ_GTK2_CFLAGS)
 endif
 
 DEFINES += -DNO_NSPR_10_SUPPORT
+
+# Run a named Python build action. The first argument is the name of the build
+# action. The second argument are the arguments to pass to the action (space
+# delimited arguments). e.g.
+#
+#   libs::
+#       $(call py_action,purge_manifests,_build_manifests/purge/foo.manifest)
+py_action = $(PYTHON) -m mozbuild.action.$(1) $(2)
--- a/js/src/config/makefiles/xpcshell.mk
+++ b/js/src/config/makefiles/xpcshell.mk
@@ -24,19 +24,17 @@ SOLO_FILE ?= $(error Specify a test file
 testxpcsrcdir = $(topsrcdir)/testing/xpcshell
 
 libs:: libs-xpcshell-tests
 
 ###########################################################################
 libs-xpcshell-tests:
 	$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
 ifndef NO_XPCSHELL_MANIFEST_CHECK #{
-	$(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \
-	  $(topsrcdir) \
-	  $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS))
+	$(call py_action,xpccheck,$(topsrcdir) $(addprefix $(MOZILLA_DIR)/$(relativesrcdir)/,$(XPCSHELL_TESTS)))
 endif #} NO_XPCSHELL_MANIFEST_CHECK 
 
 ###########################################################################
 # Execute all tests in the $(XPCSHELL_TESTS) directories.
 # See also testsuite-targets.mk 'xpcshell-tests' target for global execution.
 xpcshell-tests:
 	$(PYTHON) -u $(topsrcdir)/config/pythonpath.py \
 	  -I$(DEPTH)/build \
new file mode 100644
rename from config/purge_directories.py
rename to python/mozbuild/mozbuild/action/purge_manifests.py
rename from build/xpccheck.py
rename to python/mozbuild/mozbuild/action/xpccheck.py