summaryrefslogtreecommitdiff
path: root/build/gyp_helper.py
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2024-03-15 11:47:33 -0700
committerCole Faust <colefaust@google.com>2024-03-15 11:54:54 -0700
commit0d2fef2d6dc74ffd5429c435f87213d1167105c9 (patch)
tree19920fa3df6f81b120737c503bf60cf7aa2570ea /build/gyp_helper.py
parent67a099d7ad12d762da5f50e3904475fa1ff6be69 (diff)
downloadlibchrome-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/gyp_helper.py')
-rw-r--r--build/gyp_helper.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/build/gyp_helper.py b/build/gyp_helper.py
index c840f2d6dc..9543ed3f68 100644
--- a/build/gyp_helper.py
+++ b/build/gyp_helper.py
@@ -19,7 +19,7 @@ def apply_gyp_environment_from_file(file_path):
file_contents = f.read()
try:
file_data = eval(file_contents, {'__builtins__': None}, None)
- except SyntaxError, e:
+ except SyntaxError as e:
e.filename = os.path.abspath(file_path)
raise
supported_vars = (
@@ -50,12 +50,12 @@ def apply_gyp_environment_from_file(file_path):
behavior = 'merges with, and individual components override,'
else:
result = os.environ[var]
- print 'INFO: Environment value for "%s" %s value in %s' % (
+ print('INFO: Environment value for "%s" %s value in %s' % (
var, behavior, os.path.abspath(file_path)
- )
+ ))
string_padding = max(len(var), len(file_path), len('result'))
- print ' %s: %s' % (var.rjust(string_padding), os.environ[var])
- print ' %s: %s' % (file_path.rjust(string_padding), file_val)
+ print(' %s: %s' % (var.rjust(string_padding), os.environ[var]))
+ print(' %s: %s' % (file_path.rjust(string_padding), file_val))
os.environ[var] = result
else:
os.environ[var] = file_val