зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1530016 - Drop bogus entries from the generated-sources tarball. r=froydnj
On Android we apparently try to include the cpufeatures.c file from the NDK as part of the generated-sources tarball. While this works, it makes tar drop the bogus entry for safety reasons when unpacking the archive. It also makes tar return an error, which is undesirable for searchfox. It's better to just skip the entry when building the tarball. Differential Revision: https://phabricator.services.mozilla.com/D20942 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
dbbe2953a3
Коммит
bb22600a64
|
@ -10,7 +10,9 @@ import os.path
|
|||
import sys
|
||||
|
||||
import buildconfig
|
||||
import mozpack.path as mozpath
|
||||
from mozpack.archive import create_tar_gz_from_files
|
||||
from mozpack.files import BaseFile
|
||||
from mozbuild.generated_sources import get_generated_sources
|
||||
|
||||
|
||||
|
@ -20,8 +22,18 @@ def main(argv):
|
|||
parser.add_argument('outputfile', help='File to write output to')
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
objdir_abspath = mozpath.abspath(buildconfig.topobjdir)
|
||||
def is_valid_entry(entry):
|
||||
if isinstance(entry[1], BaseFile):
|
||||
entry_abspath = mozpath.abspath(entry[1].path)
|
||||
else:
|
||||
entry_abspath = mozpath.abspath(entry[1])
|
||||
if not entry_abspath.startswith(objdir_abspath):
|
||||
print("Warning: omitting generated source [%s] from archive" % entry_abspath, file=sys.stderr)
|
||||
return False
|
||||
return True
|
||||
|
||||
files = dict(get_generated_sources())
|
||||
files = dict(filter(is_valid_entry, get_generated_sources()))
|
||||
with open(args.outputfile, 'wb') as fh:
|
||||
create_tar_gz_from_files(fh, files, compresslevel=5)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче