Bug 1207882 - Ensure chrome manifests are created in a directory that exists when processing jar manifests. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 24 Sep 2015 10:33:17 +0900
changeset 300041 53df14a71227dbae17db814718b299d49ce9022d
parent 300040 8dbff48899a6c5b6f0a202d454993978ae573486
child 300042 d742983b5010bf26d1d1e31fd4112dd773fc9688
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1207882
milestone44.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 1207882 - Ensure chrome manifests are created in a directory that exists when processing jar manifests. r=gps This currently works because other things in the build system are creating those directories, but it's not a safe thing to rely on.
python/mozbuild/mozbuild/jar.py
--- a/python/mozbuild/mozbuild/jar.py
+++ b/python/mozbuild/mozbuild/jar.py
@@ -15,16 +15,17 @@ import os
 import errno
 import re
 import logging
 from time import localtime
 from MozZipFile import ZipFile
 from cStringIO import StringIO
 
 from mozbuild.util import (
+    ensureParentDir,
     lock_file,
     PushbackIter,
 )
 
 from mozbuild.preprocessor import Preprocessor
 from mozbuild.action.buildlist import addEntriesToListFile
 from mozpack.files import FileFinder
 if sys.platform == 'win32':
@@ -195,16 +196,17 @@ class JarMaker(object):
                                   % (chromeDir,
                                  self.rootManifestAppId)])
 
     def updateManifest(self, manifestPath, chromebasepath, register):
         '''updateManifest replaces the % in the chrome registration entries
         with the given chrome base path, and updates the given manifest file.
         '''
 
+        ensureParentDir(manifestPath)
         lock = lock_file(manifestPath + '.lck')
         try:
             myregister = dict.fromkeys(map(lambda s: s.replace('%',
                     chromebasepath), register.iterkeys()))
             manifestExists = os.path.isfile(manifestPath)
             mode = manifestExists and 'r+b' or 'wb'
             mf = open(manifestPath, mode)
             if manifestExists: