You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2019/01/25 04:02:27 UTC

[Bug 63111] New: Javac task CreateProcess Error 206 on windows

https://bz.apache.org/bugzilla/show_bug.cgi?id=63111

            Bug ID: 63111
           Summary: Javac task CreateProcess Error 206 on windows
           Product: Ant
           Version: 1.9.7
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
          Assignee: notifications@ant.apache.org
          Reporter: florian.bruckner@3kraft.com
  Target Milestone: ---

On Windows, CreateProcess has a limit of 32K characters for the command line.
If the generated javac command line exceeds this limit, running javac fails
with an error 206.

Inspecting the source responsible for creating the command line reveals that
this is already a known issue and executeExternalCompile of
DefaultCompilerAdapter creates an arg file for the files to be compiled in case
the command line is longer.

This does not happen when another parameter (like -classpath) causes the limit
to exceed. According to e.g.
https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#commandlineargfile
any command line parameter except -J arguments can be put into an argument
file.

I therefore propose to modify DefaultCompilerAdapter so it will put all command
line arguments into the argument file already generated except those before the
last -J parameter.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63111] Javac task CreateProcess Error 206 on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63111

--- Comment #1 from Florian Bruckner <fl...@3kraft.com> ---
Created attachment 36394
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36394&action=edit
a proposed patch

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63111] Javac task CreateProcess Error 206 on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63111

--- Comment #3 from Fergal Gavin <fe...@ie.ibm.com> ---
Hi folks,

Has anything changed internally between ANT 1.10.6 and ANT 1.10.7 with regards
to the <javac> target and the limit for the associated generated command line.

We have observed within out project:

 - same location for the "ANT" installation.
 - same location for the Java source being compiled.

When we run the same build script target to compile the source for a specific
directory, the build is successful using ANT 1.10.6 (and earlier versions
including the 1.9.x versions) but falls over using the specific 1.10.7 version
(see error below).

Any ideas on what could be causing this with regards to the possible changes
introduced between those two versions of ANT?

Thanks,

Fergal.

=======================
ANT TARGET

  <target name="-compile-actions">
    <javac
      memoryMaximumSize="${cmp.maxmemory}"
      memoryInitialSize="${cmp.maxmemory}"
      fork="yes"
      srcdir="${dir.gen.actions}"
      destdir="${dir.tmp.actions}"
      debug="${debug.info}"
      includeantruntime="false"
      deprecation="${cmp.deprecation}"
      debuglevel="${debug.level}"
      classpathref="compile.cp">
      <compilerarg value="-Xbootclasspath/p:${toString:xml.cp}" />
      <compilerarg value="-Xmaxwarns"/>
      <compilerarg value="${cmp.maxwarnings}"/>
      <compilerarg line="${cmp.compilerarg}"/>
    </javac>
  </target>

=======================
Error
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: java.io.IOException: Cannot run program
"C:\CC\DevEnv\7.0.10.0\tools\java\bin\javac.exe" (in directory
"C:\Dev\TI_7100_2\TI\tests\TabTestApp\webclient"): CreateProcess error=206, The
filename or extension is too long
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at java.lang.Runtime.exec(Runtime.java:620)
        at
org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:424)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:438)
        at
org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter.executeExternalCompile(DefaultCompilerAdapter.java:588)
        ... 61 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or
extension is too long
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 66 more

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63111] Javac task CreateProcess Error 206 on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63111

--- Comment #4 from Jaikiran Pai <ja...@apache.org> ---
Yes, we have had a change in this area in this recent release. However, we did
fix a bug related to this in the latest (unreleased) upstream master. Is there
any chance you can try our latest nightly Ant build
https://builds.apache.org/job/Ant_Nightly/lastSuccessfulBuild/artifact/distribution/
and see if it's reproducible there? If it still is reproducible with the
nightly build, please report back with the details, preferably in a new
bugzilla issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63111] Javac task CreateProcess Error 206 on windows

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63111

Florian Bruckner <fl...@3kraft.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #2 from Florian Bruckner <fl...@3kraft.com> ---
This is probably a duplicate of 50781

-- 
You are receiving this mail because:
You are the assignee for the bug.