New issue
Advanced search Search tips

Issue 771347 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

[Android build] Javac error prints enormous command line

Project Member Reported by mfo...@chromium.org, Oct 3 2017

Issue description

When a compilation error occurs running javac over the Android java sources, it prints an enormous command line that appears to include every .java file in the source tree.  I'm attaching a sample.

- This is too long to be useful or human readable

- It doesn't really tell you which file had the error (the actual error messages do), and makes it harder to find the actual errors printed

- It causes my emacs to choke when it tries to font-lock the line (I can try to fix that by setting some limits)

Maybe we can only print the first N characters of the command line for failed javac commands?

CCing agrieve since they have landed patches to javac.py recently.

 
javac-error.txt
160 KB View Download
Summary: [Android build] Javac error prints enormous command line (was: [Android build] Javac erorr prints enormous command line)
Ninja already prints a command you can run to repro the error, so I think it'd be fine to not also print the underlying command-line.

Looks like javac supports response files (passing args via @file-with-args), so that's probably the easiest way to fix this.
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc084a8b5afa3744a74927344e304c02ae54189f

commit bc084a8b5afa3744a74927344e304c02ae54189f
Author: Eric Stevenson <estevenson@chromium.org>
Date: Fri Jan 19 00:48:08 2018

Android: Shorten javac command line with response files.

This makes errors more readable and easier to debug.

Bug:  771347 
Change-Id: I4203e1fb4c9dbe76b58928369d6fc373590f6980
Reviewed-on: https://chromium-review.googlesource.com/874951
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530369}
[modify] https://crrev.com/bc084a8b5afa3744a74927344e304c02ae54189f/build/android/gyp/javac.py

Status: Fixed (was: Untriaged)
The ninja command line is still large ish for certain targets (chrome_java) due to srcjars being listed but for the most part the output is pretty readable now.
Owner: estevenson@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Jan 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/da00d557f2525a0cdf79b34d2951e66350dba249

commit da00d557f2525a0cdf79b34d2951e66350dba249
Author: Andrew Grieve <agrieve@chromium.org>
Date: Tue Jan 30 18:02:09 2018

Android: Don't use response file for javac.py's classpath

It's sometimes quite useful when debugging build failures to be able to
see the classpath.

Bug:  771347 
Change-Id: Ic378b969e25f93d1325663c832fc76583ca15744
Reviewed-on: https://chromium-review.googlesource.com/893518
Reviewed-by: Eric Stevenson <estevenson@chromium.org>
Commit-Queue: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532941}
[modify] https://crrev.com/da00d557f2525a0cdf79b34d2951e66350dba249/build/android/gyp/javac.py

Sign in to add a comment