Issue 47137 - [PATCH] Increase MAXLINELENGTH on Win32
Summary: [PATCH] Increase MAXLINELENGTH on Win32
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: dmake (show other issues)
Version: current
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-11 10:23 UTC by shay
Modified: 2013-08-07 15:34 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Testcase referred to in description above. (7.25 KB, application/x-gzip)
2005-04-11 10:25 UTC, shay
no flags Details
Fix detection of lines that are to long (863 bytes, patch)
2005-04-11 21:38 UTC, quetschke
no flags Details | Diff
Patch to increase MAXLINELENGTH to 8190 in four files, as suggested above. (1.68 KB, patch)
2005-04-12 08:56 UTC, shay
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description shay 2005-04-11 10:23:43 UTC
The current dmake in cws_src680_dmake43p01 doesn't quite build the perl module
ExtUtils-MakeMaker-6.27 out-of-the-box on Win32.  Running "dmake" produces the
error:

dmake:  makefile:  line 317:  Error -- Expecting macro or rule defn, found neither

Line 317 is the blank line after the definition of the PM_TO_BLIB macro, which
is rather long.  (See the Makefile in the following attachment.)  I believe the
problem is that this macro definition has exceeded dmake's MAXLINELENGTH value
(2046) because the following patch, which increases MAXLINELENGTH to 8190, makes
the error go away for me:

diff -ruN dmake.orig/win95/microsft/ruletab.c dmake/win95/microsft/ruletab.c
--- dmake.orig/win95/microsft/ruletab.c	2005-04-09 22:22:36.000000000 +0100
+++ dmake/win95/microsft/ruletab.c	2005-04-11 10:17:36.645496800 +0100
@@ -32,7 +32,7 @@
 #include <stdio.h>
 
 static char *_rules[] = {
-	"MAXLINELENGTH := 2046",
+	"MAXLINELENGTH := 8190",
 	"MAXPROCESSLIMIT := 4",
 	"MAXPROCESS := 1",
 	".IMPORT .IGNORE: DMAKEROOT",
End of Patch.

The following files also contain definitions of MAXLINELENGTH, with various
values in use (indicated in parentheses):

dmake/imacs.c (1024)
dmake/mac/ruletab.c (4094)
dmake/msdos/ruletab.c (2046)
dmake/os2/ruletab.c (2046)
dmake/qssl/ruletab.c (8190)
dmake/tos/ruletab.c (8190)
dmake/unix/ruletab.c (8190)
dmake/win95/borland/ruletab.c (2046)
dmake/win95/microsft/ruletab.c (2046)
dmake/winnt/borland/ruletab.c (2046)
dmake/winnt/microsft/ruletab.c (2046)

It may make sense to make all these values 8190, but I'll leave that up to you
to decide.
Comment 1 shay 2005-04-11 10:25:57 UTC
Created attachment 24911 [details]
Testcase referred to in description above.
Comment 2 quetschke 2005-04-11 20:08:23 UTC
You should assign the issues to me directly. hjs is very busy these days. ;)

> dmake:  makefile:  line 317:  Error -- Expecting macro or rule defn,
> found neither
This is definitely a bug, following your explanation dmake should report
something like this (from getinp.c, but recipe section):
      Fatal( "Input line too long, increase MAXLINELENGTH" );
 
The OOo build solved this problem by putting

MAXLINELENGTH	= 65530

into startup.mk. This should also solve your problem.

> dmake/imacs.c (1024)
This sets the default, but the ruletab.c settings override this immediately.
The nice thing about having MAXLINELENGTH defined in ruletab.c is that
dmake -V reports the value of this macro.

I would only touch these
> dmake/win95/borland/ruletab.c (2046)
> dmake/win95/microsft/ruletab.c (2046)
> dmake/winnt/borland/ruletab.c (2046)
> dmake/winnt/microsft/ruletab.c (2046)
files and set the value to 8190 unless you can verify the other "exotic" OSs.

P.S.: What's your overall perl status? Are still a lot of extra patches needed?
Comment 3 quetschke 2005-04-11 21:38:53 UTC
Created attachment 24939 [details]
Fix detection of lines that are to long
Comment 4 quetschke 2005-04-11 21:45:30 UTC
Committed the previous patch to cws_src680_dmake43p01.
Comment 5 shay 2005-04-12 08:56:22 UTC
Created attachment 24958 [details]
Patch to increase MAXLINELENGTH to 8190 in four files, as suggested above.
Comment 6 shay 2005-04-12 09:06:03 UTC
Thanks for the fix to improve the error message.  I meant to say that the
previous error message wasn't very helpful ;)  I now get the error:

dmake:  makefile:  line 312:  Error -- Input line too long, increase MAXLINELENGTH

which is much better.

The previous attachment sets MAXLINELENGTH to 8190 in the four files that you've
suggested.  I don't have access to the other more exotic targets, so I won't
touch them.

I'm not currently aware of any more changes *needed* to keep perl builders happy
beyond this and the other one that I created yesterday (issue 47135) - did you
see that one?  There are just a couple of other tweaks that I slipped into the
binary build that I put on CPAN a month or so ago; I need to have a think about
whether or not they should be submitted too.

Thanks for your help with all this.  I hope you feel that it has made dmake a
little bit better than it was, as well as helping the perl world.
Comment 7 quetschke 2005-04-16 00:56:57 UTC
Committed to cws_src680_dmake43p01.
Comment 8 Martin Hollmichel 2005-05-23 07:22:14 UTC
close issue.
Comment 9 hjs 2005-05-23 10:50:37 UTC
the according CWS isn't yet integrated so it's a bit too early to close this
issue...
Comment 10 quetschke 2005-06-03 21:20:06 UTC
Still fixed on cws dmake43p01 ;)
Comment 11 quetschke 2005-06-03 21:36:11 UTC
Please verify
Comment 12 shay 2005-06-06 09:24:52 UTC
Who? Me?

Works fine for me.  I retested the original problem description -- that's now
fixed -- and "dmake -V" also displays the value 8190 for MAXLINELENGTH.
Comment 13 hjs 2006-04-06 16:57:40 UTC
.
Comment 14 hjs 2006-04-21 17:24:45 UTC
.