Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3361)

Unified Diff: build/android/gyp/util/build_utils.py

Issue 2336173003: Fix android depfiles to always list GN's outputs[0] (Closed)
Patch Set: fix cronet_package Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/pack_relocations.py ('k') | build/android/gyp/write_build_config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/util/build_utils.py
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
index 8b374e6f11ecabe33a89201e169d2a6436f40e90..98d9f1b51125bc2a5ef57bedc9a988f93e10b7bd 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -423,12 +423,17 @@ def AddDepfileOption(parser):
help='Path to depfile. Must be specified as the action\'s first output.')
-def WriteDepfile(path, dependencies):
- MakeDirectory(os.path.dirname(path))
- with open(path, 'w') as depfile:
- depfile.write(path)
+def WriteDepfile(depfile_path, first_gn_output, inputs=None, add_pydeps=True):
+ assert depfile_path != first_gn_output # http://crbug.com/646165
+ inputs = inputs or []
+ if add_pydeps:
+ inputs = GetPythonDependencies() + inputs
+ MakeDirectory(os.path.dirname(depfile_path))
+ # Ninja does not support multiple outputs in depfiles.
+ with open(depfile_path, 'w') as depfile:
+ depfile.write(first_gn_output.replace(' ', '\\ '))
depfile.write(': ')
- depfile.write(' '.join(dependencies))
+ depfile.write(' '.join(i.replace(' ', '\\ ') for i in inputs))
depfile.write('\n')
@@ -524,7 +529,8 @@ def CallAndWriteDepfileIfStale(function, options, record_path=None,
all_depfile_deps = list(python_deps)
if depfile_deps:
all_depfile_deps.extend(depfile_deps)
- WriteDepfile(options.depfile, all_depfile_deps)
+ WriteDepfile(options.depfile, output_paths[0], all_depfile_deps,
+ add_pydeps=False)
if stamp_file:
Touch(stamp_file)
« no previous file with comments | « build/android/gyp/pack_relocations.py ('k') | build/android/gyp/write_build_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698