Bug 1331090 - Strip the gtest libxul prior to packaging. r=ted
authorChris Manchester <cmanchester@mozilla.com>
Fri, 13 Jan 2017 16:37:55 -0800
changeset 388084 ce506ee62e4d1bf2353ac9c0f388f76dcecb037d
parent 388083 c648ae80e1df9ae9789a647fd19194b7925a0b36
child 388085 f9f33149db8af599d3af7ef7d55e7c6e0376da14
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1331090
milestone54.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 1331090 - Strip the gtest libxul prior to packaging. r=ted MozReview-Commit-ID: KC3Wgn0OsSM
testing/testsuite-targets.mk
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -198,49 +198,58 @@ stage-mach: make-stage-dir
 stage-mochitest: make-stage-dir
 ifeq ($(MOZ_BUILD_APP),mobile/android)
 	$(MAKE) -C $(DEPTH)/testing/mochitest stage-package
 endif
 
 stage-jstests: make-stage-dir
 	$(MAKE) -C $(DEPTH)/js/src/tests stage-package
 
+ifdef OBJCOPY
+ifneq ($(OBJCOPY), :) # see build/autoconf/toolchain.m4:102 for why this is necessary
+ifndef PKG_SKIP_STRIP
+STRIP_COMPILED_TESTS := 1
+endif
+endif
+endif
+
 stage-gtest: make-stage-dir
-	$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin
+	$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin/gtest
+ifdef STRIP_COMPILED_TESTS
+# The libxul file basename will vary per platform. Fortunately
+# dependentlibs.list always lists the library name as its final line, so we
+# can get the value from there.
+	LIBXUL_BASE=`tail -1 $(DIST)/bin/dependentlibs.list` && \
+        $(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) \
+        $(DIST)/bin/gtest/$$LIBXUL_BASE $(PKG_STAGE)/gtest/gtest_bin/gtest/$$LIBXUL_BASE
+else
 	cp -RL $(DIST)/bin/gtest $(PKG_STAGE)/gtest/gtest_bin
+endif
 	cp -RL $(DEPTH)/_tests/gtest $(PKG_STAGE)
 	cp $(topsrcdir)/testing/gtest/rungtests.py $(PKG_STAGE)/gtest
 	cp $(DIST)/bin/dependentlibs.list.gtest $(PKG_STAGE)/gtest
 	cp $(DEPTH)/mozinfo.json $(PKG_STAGE)/gtest
 
 stage-android: make-stage-dir
 	$(NSINSTALL) $(topsrcdir)/mobile/android/fonts $(DEPTH)/_tests/reftest
 	$(NSINSTALL) $(topsrcdir)/mobile/android/fonts $(DEPTH)/_tests/testing/mochitest
 
 stage-jetpack: make-stage-dir
 	$(MAKE) -C $(DEPTH)/addon-sdk stage-tests-package
 
 CPP_UNIT_TEST_BINS=$(wildcard $(DIST)/cppunittests/*)
 
-ifdef OBJCOPY
-ifneq ($(OBJCOPY), :) # see build/autoconf/toolchain.m4:102 for why this is necessary
-ifndef PKG_SKIP_STRIP
-STRIP_CPP_TESTS := 1
-endif
-endif
-endif
-
 stage-cppunittests: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/cppunittest
-ifdef STRIP_CPP_TESTS
+ifdef STRIP_COMPILED_TESTS
 	$(foreach bin,$(CPP_UNIT_TEST_BINS),$(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) $(bin) $(bin:$(DIST)/cppunittests/%=$(PKG_STAGE)/cppunittest/%);)
 else
 	cp -RL $(CPP_UNIT_TEST_BINS) $(PKG_STAGE)/cppunittest
 endif
-ifdef STRIP_CPP_TESTS
+ifdef STRIP_COMPILED_TESTS
 	$(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) $(DIST)/bin/jsapi-tests$(BIN_SUFFIX) $(PKG_STAGE)/cppunittest/jsapi-tests$(BIN_SUFFIX)
 else
 	cp -RL $(DIST)/bin/jsapi-tests$(BIN_SUFFIX) $(PKG_STAGE)/cppunittest
 endif
 
 stage-steeplechase: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/steeplechase/
 	cp -RL $(DEPTH)/_tests/steeplechase $(PKG_STAGE)/steeplechase/tests