Improve the error message when a tool fails to bootstrap.

Review Request #2135 - Created April 29, 2015 and submitted

Information
Andy Reitz
pants
51fd738...
Reviewers
pants-reviews
benjyw, nhoward_tw, zundel

Suppressing the error message when failling to bootstrap a tool makes it really hard to debug the problem.

Apply this diff:

diff --git a/BUILD.tools b/BUILD.tools
index 81fc8d8..88dd916 100644
--- a/BUILD.tools
+++ b/BUILD.tools
@@ -117,7 +117,9 @@ jar_library(name = 'scalastyle',
 jar_library(name = 'checkstyle',
             jars = [
               jar(org = 'com.puppycrawl.tools', name = 'checkstyle', rev = '5.6'),
-            ])
+            ],
+            dependencies = [":bogus-dep"],
+            )

 jar_library(name = 'junit',
             jars = [

And run this command: PANTS_DEV=1 ./pants compile examples/src/java/org/pantsbuild/example/hello::

Before:

16:54:13 00:01     [checkstyle]
                   Invalidated 3 targets.
                   Failed to resolve target for tool: //:checkstyle.
                   This target was obtained from option checkstyle in scope compile.checkstyle.
                   You probably need to add this target to your tools BUILD file(s), usually located in the workspace root.

FAILURE

After:

16:52:51 00:03     [checkstyle]
                   Invalidated 3 targets.
                   Failed to resolve target for tool: //:checkstyle.
                   This target was obtained from option checkstyle in scope compile.checkstyle.
                   You probably need to add this target to your tools BUILD file(s), usually located in the workspace root.

                   Exception: bogus-dep was not found in BUILD file /Users/areitz/workspace/pants/BUILD. Perhaps you meant one of: 
                     BUILD:readme
                     BUILD.tools:antlr-3.4
                     BUILD.tools:antlr-4
                     BUILD.tools:benchmark-caliper-0.5
                     BUILD.tools:benchmark-java-allocation-instrumenter-2.1
                     BUILD.tools:checkstyle
                     BUILD.tools:cobertura-instrument
                     BUILD.tools:cobertura-report
                     BUILD.tools:cobertura-run
                     BUILD.tools:emma
                     BUILD.tools:jar-tool
                     BUILD.tools:jarjar
                     BUILD.tools:java-compiler
                     BUILD.tools:jmake
                     BUILD.tools:junit
                     BUILD.tools:nailgun-server
                     BUILD.tools:scala-compiler
                     BUILD.tools:scala-library
                     BUILD.tools:scala-repl
                     BUILD.tools:scala-specs
                     BUILD.tools:scalastyle
                     BUILD.tools:scrooge-gen
                     BUILD.tools:scrooge-linter
                     BUILD.tools:spindle-codegen
                     BUILD.tools:wire-compiler
                     BUILD.tools:wire-runtime
                     BUILD.tools:xalan
                     BUILD.tools:zinc
                     referenced from :checkstyle

FAILURE
Eric Ayers
Andy Reitz
Review request changed

Status: Closed (submitted)

Loading...