MantisBT - CMake
View Issue Details
0011462CMakeCMakepublic2010-11-15 15:482011-05-02 14:45
Dieter Oberkofler 
David Cole 
normalmajoralways
closedno change required 
WindowsWindowsWindows XP SP3
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011462: "the input line is too long" error after upgrading from 2.8.2 to 2.8.3
After upgrading from CMake 2.8.2 to 2.8.2 a build for nmake shows error messages "the input line is too long" when running nmake.

The problem must be somehow related to the upgrade because moving back to
2.8.2 with the absolute same build environment works as expected.

The error message seems to generated by a rather long (about 500
characters) command in a ADD_CUSTOM_COMMAND section.

No tags attached.
related to 0009963closed David Cole Passing command-line arguments to ExternalProject truncates variables 
Issue History
2010-11-15 15:48Dieter OberkoflerNew Issue
2010-11-15 16:06David ColeAssigned To => David Cole
2010-11-15 16:06David ColeStatusnew => assigned
2010-11-15 17:57David ColeRelationship addedrelated to 0009963
2010-11-15 17:58David ColeNote Added: 0023277
2010-12-17 07:41David ColeTarget Version => CMake 2.8.4
2010-12-17 17:07David ColeNote Added: 0024253
2010-12-17 17:08David ColeNote Added: 0024254
2010-12-17 17:08David ColeStatusassigned => resolved
2010-12-17 17:08David ColeFixed in Version => CMake 2.8.4
2010-12-17 17:08David ColeResolutionopen => no change required
2011-01-07 15:34Dieter OberkoflerNote Added: 0024514
2011-01-07 15:34Dieter OberkoflerStatusresolved => feedback
2011-01-07 15:34Dieter OberkoflerResolutionno change required => reopened
2011-01-07 15:42David ColeNote Added: 0024515
2011-01-07 15:54Dieter OberkoflerNote Added: 0024516
2011-01-07 15:54Dieter OberkoflerStatusfeedback => assigned
2011-01-07 15:57David ColeNote Added: 0024517
2011-01-07 15:57David ColeStatusassigned => resolved
2011-01-07 15:57David ColeResolutionreopened => no change required
2011-01-07 15:58David ColeNote Edited: 0024517bug_revision_view_page.php?bugnote_id=24517#r81
2011-05-02 14:45David ColeNote Added: 0026324
2011-05-02 14:45David ColeStatusresolved => closed

Notes
(0023277)
David Cole   
2010-11-15 17:58   
This issue was possibly caused by the fix for 0009963 : this commit :
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=269a4b876a34483c5cb664499dc6b1634fa453ff [^]

However, waiting for confirmation from the reporter as to whether reversing that commit actually fixes *this* issue...
(0024253)
David Cole   
2010-12-17 17:07   
Some ways you can work around this, if indeed the fix for 0009963 was the cause of this problem:

- Split up your custom command into multiple steps; you can often chain the OUTPUT and DEPENDS of separate add_custom_command calls to get a similar result to a long sequence of commands used in a single add_custom_command

- Use a "short path name" (unquoted, no spaces) for the initial command) -- the bug fix for 0009963 only affects commands that begin with the " (double quote character)

I really don't think it's viable to reverse the change for 0009963 to address this issue if there are other ways you could work around it. However, if you have a suggestion about it, I'm willing to discuss it.

Can you submit a project that demonstrates this problem for us so that we can reproduce it here to see if there's a way to keep our fix for 0009963, but also fix the issue for your situation? If so, please do.

Thanks.
(0024254)
David Cole   
2010-12-17 17:08   
See my previous note for details. I really think we need to keep the changes that fixed 0009963 - but please re-open this issue if you would like to discuss things further.
(0024514)
Dieter Oberkofler   
2011-01-07 15:34   
I finally had the time to test the information provided by David Cole and discovered as follows:

1) Shortening the command itself did not really help. Even half the length still generated the original error messages.
2) What seems to solve the issues is to simply not enclose the command (and comment) in double quotes

EXAMPLE:

# does generate the error in 2.8.3
ADD_CUSTOM_COMMAND(
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/some_output"
   COMMAND "really_long_command"
   DEPENDS "${dependencies}"
   COMMENT "really_long_command"
)

# works in 2.8.3 as it did in 2.8.2
ADD_CUSTOM_COMMAND(
   OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/some_output"
   COMMAND really_long_command
   DEPENDS "${dependencies}"
   COMMENT really_long_command
)
(0024515)
David Cole   
2011-01-07 15:42   
Excellent.

So are you satisfied with marking this as resolved without any CMake changes, given that you can change your add_custom_command calls to work with either 2.8.2 or 2.8.3?

Or do you think we need to reproduce this and do more investigation?

Thanks for adding the note with the new information.
(0024516)
Dieter Oberkofler   
2011-01-07 15:54   
This works just fine for me. Thank you!
(0024517)
David Cole   
2011-01-07 15:57   
(edited on: 2011-01-07 15:58)
Excellent! Thank *you*!

(0026324)
David Cole   
2011-05-02 14:45   
Closing resolved issues that have not been updated in more than 3 months.