Summary: | ant.bat exit strategy improvements and issues | ||
---|---|---|---|
Product: | Ant | Reporter: | Mark DeLaFranier <delafran> |
Component: | Core | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | arve.knudsen, delafran |
Priority: | P2 | Keywords: | PatchAvailable |
Version: | 1.7.0 | ||
Target Milestone: | 1.8.2 | ||
Hardware: | Other | ||
OS: | Windows XP | ||
Attachments: | patch generated from the SVN codeline |
Description
Mark DeLaFranier
2006-11-24 12:11:02 UTC
Created attachment 19170 [details]
patch generated from the SVN codeline
First, know that the .bat file is a source of much grief, much more than its short length would imply. We are scared of it. Historically the trouble has always been win98x support, as its batch language is much simpler. If you tried any of your patched scripts on win9x, things would break. Ant.7 doesnt support win98. so we may be able to change things, though as I said, we are scared of changes. There's no way we'd make the changes without going through a release cycle. Looking at the code, exit /b does look good; it sets the exit code and does not exit from nested batch files, which is probably exactly what everyone needs. The issue for the ant group is -do we adopt this (and so ensure no win98 compatibility) -what's our test process going to be. What about the idea of two batch files: - antw98.bat (does the best job it can for windows 98 and possibly windows nt) - ant.bat (works best with Windows XP, 2000, 2003, Vista) and uses new script capabilities. Or use the same strategy and present a new ant.bat file: - ant2.bat (works best with Windows XP, 2000, 2003, Vista) and uses new script capabilities. - ant.bat (does the best job it can for windows 98 and possibly windows nt) ant.bat continues to keep the backward compatibility at its maximum. Existing build environments will continue to use the older script by default and will continue to function in its, much grief, state. ant2.bat could then be advertised as the new approach that takes advantage of better error reporting script features. Hello Mark, going for antw98.bat and ant.bat sounds to me like the right choice. Regards, Antoine I'm +1 for a separate 'legacy' win98 bat file, with a 'no support' clause. However, there is no way I'd release Ant with a new bat file without going through at least one beta cycle, so its too late to make the 1.7.0 cut. We can put this in Ant 1.7.1 though, and test it thoroughly before shipping to a wider audience. This could be a good time to clean up the .bat file altogether. Why hasn't anything been done about this? Since ant.bat doesn't return an error code, my ant Python wrapper doesn't get when a build has failed (and I spent hours just identifying the cause). I've tested the attached patch on Windows Server 2008, Ant 1.8.1, and it fixes the issue. Will try the patch. Antoine I have used the patch and simplified it, removing the lines which were commented out. Also I have removed the line which said set ANT_ERROR=1 because I think this one would not have allowed to get different exit status. As I understand it, ant.bat will now provide an accurate exit status and not use these funny "color 00" and "echo 1 | choice" statements. Moving the status to fixed, hoping that it will not create other errors. |