Bug 1620143 - Convert dependentlibs.py to py3; r=firefox-build-system-reviewers,rstewart

Differential Revision: https://phabricator.services.mozilla.com/D65447

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Shal 2020-03-05 19:05:37 +00:00
parent c71171f151
commit 473672120d
2 changed files with 7 additions and 5 deletions

View File

@ -20,7 +20,8 @@ from mozpack.executables import (
from buildconfig import substs
def dependentlibs_win32_objdump(lib):
proc = subprocess.Popen([substs['LLVM_OBJDUMP'], '--private-headers', lib], stdout = subprocess.PIPE)
proc = subprocess.Popen([substs['LLVM_OBJDUMP'], '--private-headers', lib], stdout = subprocess.PIPE,
universal_newlines=True)
deps = []
for line in proc.stdout:
match = re.match('\s+DLL Name: (\S+)', line)
@ -31,7 +32,8 @@ def dependentlibs_win32_objdump(lib):
def dependentlibs_readelf(lib):
'''Returns the list of dependencies declared in the given ELF .so'''
proc = subprocess.Popen([substs.get('TOOLCHAIN_PREFIX', '') + 'readelf', '-d', lib], stdout = subprocess.PIPE)
proc = subprocess.Popen([substs.get('TOOLCHAIN_PREFIX', '') + 'readelf', '-d', lib], stdout = subprocess.PIPE,
universal_newlines=True)
deps = []
for line in proc.stdout:
# Each line has the following format:
@ -53,7 +55,8 @@ def dependentlibs_readelf(lib):
def dependentlibs_mac_objdump(lib):
'''Returns the list of dependencies declared in the given MACH-O dylib'''
proc = subprocess.Popen([substs['LLVM_OBJDUMP'], '--private-headers', lib], stdout = subprocess.PIPE)
proc = subprocess.Popen([substs['LLVM_OBJDUMP'], '--private-headers', lib], stdout = subprocess.PIPE,
universal_newlines=True)
deps = []
cmd = None
for line in proc.stdout:
@ -113,7 +116,7 @@ def gen_list(output, lib):
output.write('\n'.join(deps.keys()) + '\n')
with open(output.name + ".gtest", 'w') as gtest_out:
libs = deps.keys()
libs = list(deps.keys())
libs[-1] = 'gtest/' + libs[-1]
gtest_out.write('\n'.join(libs) + '\n')

View File

@ -25,6 +25,5 @@ if CONFIG['COMPILE_ENVIRONMENT']:
)
GeneratedFile('dependentlibs.list', 'dependentlibs.list.gtest',
script='dependentlibs.py', entry_point='gen_list',
py2=True,
inputs=['!%s' % full_libname])
FINAL_TARGET_FILES += ['!dependentlibs.list', '!dependentlibs.list.gtest']