diff options
author | Cole Faust <colefaust@google.com> | 2024-03-15 11:47:33 -0700 |
---|---|---|
committer | Cole Faust <colefaust@google.com> | 2024-03-15 11:54:54 -0700 |
commit | 0d2fef2d6dc74ffd5429c435f87213d1167105c9 (patch) | |
tree | 19920fa3df6f81b120737c503bf60cf7aa2570ea /build/check_gn_headers.py | |
parent | 67a099d7ad12d762da5f50e3904475fa1ff6be69 (diff) | |
download | libchrome-0d2fef2d6dc74ffd5429c435f87213d1167105c9.tar.gz |
Add embedded_launcher: true to jni_generator
The jni_generator writes the path to the script into its output files.
When using a non-embedded-launcher soong python binary, soong will
extract the binary to a nondeterministic temporary directory before
running it. These two points together means that the output files
of jni_generator are non-deterministic.
Adding embedded_launcher: true causes all the python sources to be
precompiled as well, so we start getting syntax errors for code paths
that are still in python2 but we weren't running before. Fix those
syntax errors.
Test: Presubmits
Change-Id: I0a856f8cc98b11841c07bd6188d9722980428b5f
Diffstat (limited to 'build/check_gn_headers.py')
-rwxr-xr-x | build/check_gn_headers.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/build/check_gn_headers.py b/build/check_gn_headers.py index 42ea80f8c9..17cfe56ffd 100755 --- a/build/check_gn_headers.py +++ b/build/check_gn_headers.py @@ -135,7 +135,7 @@ def GetDepsPrefixes(q): gclient_out = subprocess.check_output([ os.path.join(DEPOT_TOOLS_DIR, gclient_exe), 'recurse', '--no-progress', '-j1', - 'python', '-c', 'import os;print os.environ["GCLIENT_DEP_PATH"]'], + 'python', '-c', 'import os;print(os.environ["GCLIENT_DEP_PATH"])'], universal_newlines=True) for i in gclient_out.split('\n'): if i.startswith('src/'): @@ -152,7 +152,7 @@ def IsBuildClean(out_dir): out = subprocess.check_output(cmd) return 'no work to do.' in out except Exception as e: - print e + print(e) return False def ParseWhiteList(whitelist): @@ -211,7 +211,7 @@ def main(): # Assume running on the bots. Silently skip this step. # This is possible because "analyze" step can be wrong due to # underspecified header files. See crbug.com/725877 - print dirty_msg + print(dirty_msg) DumpJson([]) return 0 else: @@ -250,7 +250,7 @@ def main(): if deps_err: PrintError(deps_err) if len(GetNonExistingFiles(d)) > 0: - print 'Non-existing files in ninja deps:', GetNonExistingFiles(d) + print('Non-existing files in ninja deps:', GetNonExistingFiles(d)) PrintError('Found non-existing files in ninja deps. You should ' + 'build all in OUT_DIR.') if len(d) == 0: @@ -272,30 +272,30 @@ def main(): return 0 if len(missing) > 0: - print '\nThe following files should be included in gn files:' + print('\nThe following files should be included in gn files:') for i in missing: - print i + print(i) if len(nonexisting) > 0: - print '\nThe following non-existing files should be removed from gn files:' + print('\nThe following non-existing files should be removed from gn files:') for i in nonexisting: - print i + print(i) if args.verbose: # Only get detailed obj dependency here since it is slower. GetHeadersFromNinja(args.out_dir, False, d_q) d, d_err = d_q.get() - print '\nDetailed dependency info:' + print('\nDetailed dependency info:') for f in missing: - print f + print(f) for cc in d[f]: - print ' ', cc + print(' ', cc) - print '\nMissing headers sorted by number of affected object files:' + print('\nMissing headers sorted by number of affected object files:') count = {k: len(v) for (k, v) in d.items()} for f in sorted(count, key=count.get, reverse=True): if f in missing: - print count[f], f + print(count[f], f) return 1 |