[cmake-developers] Fwd: [CMake 0013366]: Ninja generator on windows does not take everything into account when checking the command line length limit

Peter Kümmel syntheticpp at gmx.net
Mon Jul 2 12:22:22 EDT 2012


On 02.07.2012 17:40, Bill Hoffman wrote:
>
>
> Can we  just put the link step into the response files?
>

The code now catches nearly all cases. I don't think
it will fail in any real-live usage.

Peter


> -------- Original Message --------
> Subject: [CMake 0013366]: Ninja generator on windows does not take
> everything into account when checking the command line length limit
> Date: Sun, 1 Jul 2012 16:59:52 -0400
> From: Mantis Bug Tracker<mantis at public.kitware.com>
> To: bill.hoffman at kitware.com
>
>
> The following issue has been SUBMITTED.
> ======================================================================
> http://www.cmake.org/Bug/view.php?id=13366
> ======================================================================
> Reported By:                Josh Faust
> Assigned To:
> ======================================================================
> Project:                    CMake
> Issue ID:                   13366
> Category:                   CMake
> Reproducibility:            always
> Severity:                   major
> Priority:                   normal
> Status:                     new
> ======================================================================
> Date Submitted:             2012-07-01 16:59 EDT
> Last Modified:              2012-07-01 16:59 EDT
> ======================================================================
> Summary:                    Ninja generator on windows does not take
> everything
> into account when checking the command line length limit
> Description:
> When generating the ninja build files, on windows cmake will check the
> command
> line length and generate a response file if it's too long. It does this by
> checking the args and the build line passed to the ninja rule. This does not
> take into account, though, what the ninja rule actually expands to
> including any
> variables passed such as link flags, full executable path, etc.
>
> CMake sets the command line limit to 8000 characters on windows, though the
> actual limit is 8192. I'm assuming it's set to 8000 because it's trying to
> account for the lack of these flags, but this is not always enough. In rare
> cases the build can still fail with a "The command line is too long."
> error.
>
> In my specific case, these extra flags account for ~500 characters,
> while cmake
> only actually checks http://www.cmake.org/Bug/view.php?id=5058#c7700
> characters
> -- and added together they're above the 8192 limit.
>
> The quick fix seems to be changing the max command line to be shorter (say,
> 7000) in cmNinjaNormalTargetGenerator.cxx:483.
>
> The real fix would be to retrieve the rule and expand all the variables
> in the
> command, which I do not see an easy way of doing after a quick look
> through the
> code.
> ======================================================================
>
> Issue History
> Date Modified    Username       Field                    Change
>
> ======================================================================
> 2012-07-01 16:59 Josh Faust     New Issue
>
> ======================================================================
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>



More information about the cmake-developers mailing list