Bug 1432475 - Enable rust analysis on mozsearch jobs and save the output to a build artifact. r?glandium draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 30 Jan 2018 16:32:01 -0500
changeset 749064 7b656808087ffbc53245c38f2391fab9e3b30f0a
parent 748899 fd995039d89708923b5673ecebc652967d40bd4e
push id97315
push userkgupta@mozilla.com
push dateTue, 30 Jan 2018 22:39:29 +0000
reviewersglandium
bugs1432475
milestone60.0a1
Bug 1432475 - Enable rust analysis on mozsearch jobs and save the output to a build artifact. r?glandium This requires unlocking the unstable features in the rust compiler by using RUSTC_BOOTSTRAP=1 MozReview-Commit-ID: 1uUG1Ekp1YH
browser/config/mozconfigs/linux64/debug-searchfox-clang
toolkit/mozapps/installer/package-name.mk
toolkit/mozapps/installer/packager.mk
toolkit/mozapps/installer/upload-files.mk
--- a/browser/config/mozconfigs/linux64/debug-searchfox-clang
+++ b/browser/config/mozconfigs/linux64/debug-searchfox-clang
@@ -8,15 +8,19 @@ ac_add_options --enable-debug
 ac_add_options --enable-dmd
 
 . $topsrcdir/build/mozconfig.stylo
 
 # Use Clang as specified in manifest
 export CC="$topsrcdir/clang/bin/clang"
 export CXX="$topsrcdir/clang/bin/clang++"
 
+# Save rust analysis (this requires unlocking the unstable features)
+export RUSTC_BOOTSTRAP=1
+export RUSTFLAGS="-Zsave-analysis"
+
 # Add the static checker
 ac_add_options --enable-clang-plugin
 ac_add_options --enable-mozsearch-plugin
 
 . "$topsrcdir/build/unix/mozconfig.stdcxx"
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/toolkit/mozapps/installer/package-name.mk
+++ b/toolkit/mozapps/installer/package-name.mk
@@ -83,16 +83,17 @@ SYMBOL_ARCHIVE_BASENAME = $(PKG_BASENAME
 # Generated file package naming
 GENERATED_SOURCE_FILE_PACKAGE = $(PKG_BASENAME).generated-files.tar.gz
 
 # Code coverage package naming
 CODE_COVERAGE_ARCHIVE_BASENAME = $(PKG_BASENAME).code-coverage-gcno
 
 # Mozsearch package naming
 MOZSEARCH_ARCHIVE_BASENAME = $(PKG_BASENAME).mozsearch-index
+MOZSEARCH_RUST_ANALYSIS_BASENAME = $(PKG_BASENAME).mozsearch-rust
 
 # Mozharness naming
 MOZHARNESS_PACKAGE = mozharness.zip
 
 # Test package naming
 TEST_PACKAGE = $(PKG_BASENAME).common.tests.zip
 CPP_TEST_PACKAGE = $(PKG_BASENAME).cppunittest.tests.zip
 XPC_TEST_PACKAGE = $(PKG_BASENAME).xpcshell.tests.zip
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -71,20 +71,24 @@ ifdef MOZ_CODE_COVERAGE
 	@echo 'Generating chrome-map for coverage data...'
 	$(topsrcdir)/mach build-backend -b ChromeMap
 	@echo 'Packaging code coverage data...'
 	$(RM) $(CODE_COVERAGE_ARCHIVE_BASENAME).zip
 	$(PYTHON) -mmozbuild.codecoverage.packager \
 		--output-file='$(DIST)/$(PKG_PATH)$(CODE_COVERAGE_ARCHIVE_BASENAME).zip'
 endif
 ifdef ENABLE_MOZSEARCH_PLUGIN
-	@echo 'Generating mozsearch tarball...'
+	@echo 'Generating mozsearch index tarball...'
 	$(RM) $(MOZSEARCH_ARCHIVE_BASENAME).zip
 	cd $(topobjdir)/mozsearch_index && \
           zip -r5D '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_ARCHIVE_BASENAME).zip' .
+	@echo 'Generating mozsearch rust-analysis tarball...'
+	$(RM) $(MOZSEARCH_RUST_ANALYSIS_BASENAME).zip
+	cd $(topobjdir)/ && \
+          find . -type d -name save-analysis | xargs zip -r5D '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_RUST_ANALYSIS_BASENAME).zip'
 endif
 ifeq (Darwin, $(OS_ARCH))
 ifdef MOZ_ASAN
 	@echo "Rewriting ASan runtime dylib paths for all binaries in $(DIST)/$(MOZ_PKG_DIR)$(_BINPATH) ..."
 	$(PYTHON) $(MOZILLA_DIR)/build/unix/rewrite_asan_dylib.py $(DIST)/$(MOZ_PKG_DIR)$(_BINPATH)
 endif # MOZ_ASAN
 endif # Darwin
 ifdef MOZ_STYLO
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -424,16 +424,17 @@ ifdef MOZ_CODE_COVERAGE
 endif
 
 ifdef MOZ_STYLO
   UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(STYLO_BINDINGS_PACKAGE))
 endif
 
 ifdef ENABLE_MOZSEARCH_PLUGIN
   UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_ARCHIVE_BASENAME).zip)
+  UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(MOZSEARCH_RUST_ANALYSIS_BASENAME).zip)
 endif
 
 SIGN_CHECKSUM_CMD=
 ifdef MOZ_SIGN_CMD
   # If we're signing with gpg, we'll have a bunch of extra detached signatures to
   # upload. We also want to sign our checksums file
   SIGN_CHECKSUM_CMD=$(MOZ_SIGN_CMD) -f gpg $(CHECKSUM_FILE)