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

Unified Diff: build/android/gyp/javac.py

Issue 1706363003: Fix javac sometimes not create all outputs with enable_incremental_javac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/javac.py
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py
index a818ff853a4da92f702281e80edf6b874a21872f..02ee57606eca01d5c5ab441f2e7d47bf0bf357b6 100755
--- a/build/android/gyp/javac.py
+++ b/build/android/gyp/javac.py
@@ -228,6 +228,11 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs,
classpath_idx = javac_cmd.index('-classpath')
javac_cmd[classpath_idx + 1] += ':' + classes_dir
+ # Can happen when a target goes from having no sources, to having sources.
+ # It's created by the call to build_utils.Touch() below.
+ if os.path.exists(pdb_path) and not os.path.getsize(pdb_path):
nyquist 2016/02/19 20:57:12 Nit: Should you add if options.incremental here? O
agrieve 2016/02/23 02:55:21 The bots agree with you! Done.
+ os.unlink(pdb_path)
+
# Don't include the output directory in the initial set of args since it
# being in a temp dir makes it unstable (breaks md5 stamping).
cmd = javac_cmd + ['-d', classes_dir] + java_files
@@ -253,6 +258,9 @@ def _OnStaleMd5(changes, options, javac_cmd, java_files, classpath_inputs,
'(http://crbug.com/551449).')
os.unlink(pdb_path)
attempt_build()
+ elif options.incremental:
+ # Make sure output exists.
+ build_utils.Touch(pdb_path)
if options.main_class or options.manifest_entry:
entries = []
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698