views:

520

answers:

4

I'm using ant.bat (in Ant 1.7.1) to build the all target in a build.xml file, on Windows 2003 Server. (I've substituted "xxx" in the error message for the project name in that file.)

It builds successfully, but then ends with:

2009-06-10 17:26:03 | all:
2009-06-10 17:26:03 | 
2009-06-10 17:26:03 | BUILD FAILED
2009-06-10 17:26:03 | Target "1" does not exist in the project "xxx".

...and returns with a non-zero error code.

I've searched build.xml unsuccessfully for anything that might lead to this error. (There is no target "1", of course, nor any dependencies that might resolve "1".)

I'm hoping someone out there might recall seeing this. I don't expect anyone to debug the XML for me, but a Google search turned up http://simile.mit.edu/mail/ReadMsg?listId=9&msgId=2735, which contains "I found an email thread on this problem and will retry.". I wish I could find that thread.

Update - here's the command-line:

D:/build/toolchain/noarch/ant-1.7.1/bin/ant.bat all  -DBRANCH_NAME="main" -DBUILD_NUMBER="66675" -DCHANGE_NUMBER="1061789" -DGOBUILD_AUTO_COMPONENTS= -DGOBUILD_OFFICIAL_BUILD=1 -DGOBUILD_VICLIB_ROOT=d:/build/ob/bora-66675/compcache//viclib/ob-65655/windows -DGOBUILD_VIMBASE_ROOT=d:/build/ob/bora-66675/compcache//vimbase/ob-64494/windows -DOBJDIR="beta" -DPRODUCT_BUILD_NUMBER="82" -DPUBLISH_DIR="d:/build/ob/bora-66675/publish" -DRELTYPE="beta" -DREMOTE_COPY_SCRIPT="D:/build/toolchain/win32/python-2.5/python.exe D:/build/gobuild/script/gobuildc.py bora-66675"'

Hopefully it's of some help.

+2  A: 

Do you have any targets that depend on "1"? Perhaps due to a typo?

<target name="SomeTarget" depends="1">
   ....
</target>

Update: You explained (paraphrased) that the error message was a result of the (partial) command-line

-DGOBUILD_AUTO_COMPONENTS= -DGOBUILD_OFFICIAL_BUILD=1

Although there's a space between those two define statements, it's being treated like this:

-DGOBUILD_AUTO_COMPONENTS=-DGOBUILD_OFFICIAL_BUILD=1

because something is expected to follow '='. And it appears that the second '=' is being treated as a whitespace, perhaps because ANT is confused. I would not expect that. The correct way to do what you want to do is:

-DGOBUILD_AUTO_COMPONENTS="" -DGOBUILD_OFFICIAL_BUILD=1

That way, something follows the equals sign and ANT won't get confused.

Eddie
No targets that depend on "1". (I was hoping that was it.)
Daryl Spitzer
+1  A: 

could you add the commandline you are using. it could be that ant agrees with you that there is no target '1' but that it believes you are passing one in.

akf
A: 

Ya goose :-) You changed the project to "xxx" in the heading but left it as "vireporting" in the error output.

So the cat's out of the bag. You may as well make our life easier and post the XML since our ability to help you (psychic debugging) is greatly limited. If you want, sanitize the XML you post (better than you sanitized the original, hopefully).

And your comment ('There is no target "1"') makes sense since that's what ant is telling you. What you may have done is inadvertently created a dependency on that non-existent target.

paxdiablo
Oops. I feel like a goose. I'm not sure what lesson I've learned, except I guess to be more careful. One cat may be out of the bag, but if there are more in there, I don't want to let them out if I shouldn't.If my co-workers don't object to my posting the XML, can I just paste the ~275 lines right into my question? (I don't believe attachments are supported.)Right, I didn't expect to find a target called "1", but I meant I didn't find any reference to a target that might resolve to "1".
Daryl Spitzer
A: 

It turns out this error message is the result of "-DGOBUILD_AUTO_COMPONENTS= -DGOBUILD_OFFICIAL_BUILD=1" in the command-line. I guess having nothing after the '=' in that -D option confuses Ant. (As an experiment, I changed "-DGOBUILD_OFFICIAL_BUILD=1" to "-DGOBUILD_OFFICIAL_BUILD=2" in this programmatically-generated command-line and the error message changed to "Target "2" does not exist in the project "xxx".")

Removing "-DGOBUILD_AUTO_COMPONENTS=" eliminated the build failure.

If someone can clearly explain why Ant emits such a strange error message in this case (or perhaps why it's not strange if one looks at it correctly), I'll accept your answer.

Daryl Spitzer