-
1. Re: Problem with AopC Ant Task -- cmd too long!
squeak Oct 19, 2004 3:51 PM (in response to squeak)Wanted to give an update on this for what I found.
It is definetly an issue related to the length of the command that is passed to Runtime.exec.
To experiment, I changed the path that my class are build from long pathc:\eclipse\workspace\myproj\bin
to something very short:c:\a
Worked great! Same number of classes being compiled.
So, I played further and tried to find the breaking point of the directory length, for my instance, and I found that while:C:\abcdefghiklmnop\abcd\
works. this doesn't:C:\abcdefghiklmnop\abcde\
The extra letter on every path of every class causes it to pass that magical threshold -- which after looking at the the lengths of the two strings that are generated, is somewhere around 2^15.
Any hope of getting a fix before the 1.0 release to the AopC ant task so the compiler will handle a directory passed in, and pass that directly to the standalone compiler? I would assume that I am not the only one who is going to have this issue. -
2. Re: Problem with AopC Ant Task -- cmd too long!
adrian.brock Oct 19, 2004 4:35 PM (in response to squeak)The usual fix for this is to allow a
--SOURCEFILES [file-name]
to be passed in to the compiler.
If the length of the file names is too large it can write them to a temp file
and pass --SOURCEFILES [tmp-file-name]
The other fix is to not use Windows :-) -
3. Re: Problem with AopC Ant Task -- cmd too long!
bill.burke Oct 19, 2004 5:25 PM (in response to squeak)I wonder if the javac target in Ant has the same problem as I based aopc on this code.
I will try and resolve your request...We need to release 1.0 this week as other JBoss Inc. projects are waiting on it so I can't promise anything.
But, this is a serious usability bug, so I'll put cycles into it.
Bill -
4. Re: Problem with AopC Ant Task -- cmd too long!
squeak Oct 19, 2004 8:07 PM (in response to squeak)Bill,
You bring up a good point. I saw your comment about using javac as the basis for the code.
In my same ant task, I also compile the same set of code using javac with no issues. Weird.
I understand about getting 1.0 out --- I can look tonight at the differences and why javac would work and aopc would not. -
5. Re: Problem with AopC Ant Task -- cmd too long!
squeak Oct 19, 2004 9:41 PM (in response to squeak)Bill,
Looking at the source of the javac task -- it appears that Adrian's solution is exactly what they do. When the user wants to fork the process, and the command line is >4096, it outputs it to a temp file, and passes that to the compiler.
When you don't fork via with javac, there is no problem what so ever? Would it be simplier to just not fork the AopC compiler and run it in the same process, like javac? -
6. Re: Problem with AopC Ant Task -- cmd too long!
kabirkhan Oct 20, 2004 2:24 PM (in response to squeak)This will be in the release. If the files portion of the java command is longer than a given number of chars, it creates a temp file as outlined.
I don't know what the limits are, so I have added a maxsrc parameter to the ant task. The default is 1000 -
7. Re: Problem with AopC Ant Task -- cmd too long!
squeak Oct 20, 2004 3:35 PM (in response to squeak)Thanks....I really do appreciate it.
Personally, I think following Ant's lead and hardcoding it 4096 as the threshold is fine -- that is the number that POSIX defines as the limit. -
8. Re: Problem with AopC Ant Task -- cmd too long!
adrian.brock Oct 20, 2004 8:53 PM (in response to squeak)Be careful.
Windows is only notionally POSIX compliant.
It defines a POSIX compliant interface, but it does not use it internally (e.g from
the command line/shell) and most WIN32 apis ignore it as well.