Re: GNU make 4.2 (and 4.2.1) failing due to length of command-line
Adrian Muresan <[email protected]> Wed, 22 Jun 2016 20:36:04 +0000
| Newsgroups | gmane.comp.gnu.make.windows |
|---|---|
| Message-ID | <BY2PR11MB058173F513285000A557D20EBE2C0@BY2PR11MB0581.namprd11.prod.outlook.com> |
--===============5088445189277960428== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY2PR11MB058173F513285000A557D20EBE2C0BY2PR11MB0581namp_" --_000_BY2PR11MB058173F513285000A557D20EBE2C0BY2PR11MB0581namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Does batch_mode_shell =3D 1 mean that it always uses the sh.exe instead of = Windows.cmd? That would make sense why it's now working. The limitation on cmd.exe is 8192 https://support.microsoft.com/en-us/kb/830473 But I have around 18k characters. Sent from my iPhone On Jun 22, 2016, at 3:57 PM, Paul Smith <[email protected]<mailto:[email protected]= rg>> wrote: On Wed, 2016-06-22 at 19:47 +0000, Adrian Muresan wrote: In config.h, I uncommented the line /* #define BATCH_MODE_ONLY_SHELL 1 */ this affects job.c static const char *sh_cmds_sh[] =3D { "cd", "eval", "exec", "exit", "login", "logout", "set", "umask", "wait", "while", "for", "case", "if", ":", ".", "break", "continue", "export", "read", "readonly", "shift", "times", "trap", "switch", "test", #ifdef BATCH_MODE_ONLY_SHELL "echo", #endif 0 }; I can see where you might think this makes a difference, but really this is not relevant. These are used to decide whether or not to use the "fast path" or require a shell to run the recipe. Your script is complex enough that make will always decide to run the shell so having "echo" in this list won't make any difference. The thing that is relevant to your situation is in main.c: if (!unixy_shell && sh_found && (strstr (default_shell, "sh") || strstr (default_shell, "SH"))) { unixy_shell =3D 1; batch_mode_shell =3D 0; } #ifdef BATCH_MODE_ONLY_SHELL batch_mode_shell =3D 1; #endif Here we first decide that we have a UNIX-like shell (because make finds your sh.exe); if that's true then we disable batch_mode_shell because a UNIX shell should be sufficiently powerful to not need it. Setting that config.h option causes batch_mode_shell to be set to 1 (true) always, in all situations. That change is what's working around your broken shell. --_000_BY2PR11MB058173F513285000A557D20EBE2C0BY2PR11MB0581namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"= > </head> <body dir=3D"auto"> <div>Does batch_mode_shell =3D 1 mean that it always uses the sh.exe instea= d of Windows.cmd?</div> <div><br> </div> <div>That would make sense why it's now working. </div> <div>The limitation on cmd.exe is 8192</div> <div><br> </div> <div><a href=3D"https://support.microsoft.com/en-us/kb/830473">https://supp= ort.microsoft.com/en-us/kb/830473</a></div> <div><br> </div> <div>But I have around 18k characters. <br> <br> <div>Sent from my iPhone</div> </div> <div><br> On Jun 22, 2016, at 3:57 PM, Paul Smith <<a href=3D"mailto:[email protected]= g">[email protected]</a>> wrote:<br> <br> </div> <blockquote type=3D"cite"> <div><span>On Wed, 2016-06-22 at 19:47 +0000, Adrian Muresan wrote:</sp= an><br> <blockquote type=3D"cite"><span>In config.h, I uncommented the line</s= pan><br> </blockquote> <blockquote type=3D"cite"><span>/* #define BATCH_MODE_ONLY_SHELL 1 */<= /span><br> </blockquote> <blockquote type=3D"cite"><span></span><br> </blockquote> <blockquote type=3D"cite"><span>this affects job.c</span><br> </blockquote> <blockquote type=3D"cite"><span></span><br> </blockquote> <blockquote type=3D"cite"><span> static const char *sh_cmds_sh[] =3D<= /span><br> </blockquote> <blockquote type=3D"cite"><span> { "cd", "eval&= quot;, "exec", "exit", "login", "logout&= quot;, "set",</span><br> </blockquote> <blockquote type=3D"cite"><span>"umask", "wait",</span>= <br> </blockquote> <blockquote type=3D"cite"><span> "while", &qu= ot;for", "case", "if", ":", "."= ;, "break", "continue",</span><br> </blockquote> <blockquote type=3D"cite"><span>"export",</span><br> </blockquote> <blockquote type=3D"cite"><span> "read", &quo= t;readonly", "shift", "times", "trap", &= quot;switch", "test",</span><br> </blockquote> <blockquote type=3D"cite"><span>#ifdef BATCH_MODE_ONLY_SHELL</span><br> </blockquote> <blockquote type=3D"cite"><span> "echo",</spa= n><br> </blockquote> <blockquote type=3D"cite"><span>#endif</span><br> </blockquote> <blockquote type=3D"cite"><span> 0 };</span><br> </blockquote> <span></span><br> <span>I can see where you might think this makes a difference, but really</= span><br> <span>this is not relevant. These are used to decide whether or not t= o use</span><br> <span>the "fast path" or require a shell to run the recipe.  = ;Your script is</span><br> <span>complex enough that make will always decide to run the shell so havin= g</span><br> <span>"echo" in this list won't make any difference.</span><br> <span></span><br> <span>The thing that is relevant to your situation is in main.c:</span><br> <span></span><br> <span> if (!unixy_shell && sh_found</span><br> <span> && (strstr (defaul= t_shell, "sh") || strstr (default_shell, "SH")))</span>= <br> <span> {</span><br> <span> unixy_shell =3D 1;</span><= br> <span> batch_mode_shell =3D 0;</sp= an><br> <span> }</span><br> <span></span><br> <span> #ifdef BATCH_MODE_ONLY_SHELL</span><br> <span> batch_mode_shell =3D 1;</span><br> <span> #endif</span><br> <span></span><br> <span>Here we first decide that we have a UNIX-like shell (because make fin= ds</span><br> <span>your sh.exe); if that's true then we disable batch_mode_shell because= a</span><br> <span>UNIX shell should be sufficiently powerful to not need it.</span><br> <span></span><br> <span>Setting that config.h option causes batch_mode_shell to be set to 1</= span><br> <span>(true) always, in all situations.</span><br> <span></span><br> <span>That change is what's working around your broken shell.</span><br> </div> </blockquote> </body> </html> --_000_BY2PR11MB058173F513285000A557D20EBE2C0BY2PR11MB0581namp_-- --===============5088445189277960428== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Make-w32 mailing list [email protected] https://lists.gnu.org/mailman/listinfo/make-w32 --===============5088445189277960428==--