Re: [perl #36290] [PATCH] Fix 'make test' breakage with mingw32-make

16 views
Skip to first unread message

Leopold Toetsch

unread,
Jun 15, 2005, 4:40:32 AM6/15/05
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
Clement Cherlin (via RT) wrote:

>> perl.exe t\harness --gc-debug --running-make-test
>
> t\library\*.t

[ ... ]

Doesn't a) perl take forward slashes too and b) harness do the glob
anyway? If the shell globs the test args, we'll run into commandline
length issues sooner or later.

leo

Clement Cherlin

unread,
Jun 15, 2005, 1:43:23 AM6/15/05
to bugs-bi...@rt.perl.org
# New Ticket Created by Clement Cherlin
# Please include the string: [perl #36290]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36290 >


François PERRAD wrote:
>
> Please, revert this patch (r8298)
> With MinGW & cmd.exe :
> $ make test


> perl.exe t\harness --gc-debug --running-make-test
t\library\*.t

> t\op\*.t t\pmc\*.t t\native_pbc\*.t imcc\t\*\*.t t\dynclass\*.t
> t\src\*.t t\perl\*.t
> FAILED--no tests were run for some reason.
>
> In its initial mail, Clement Cherlin wrote : "I still haven't gotten
> compilation to finish ..."
>
> Francois Perrad.
>

Not to worry, I have a one-line fix for that problem. Mingw32-make
treats '\*' as a backslash escaping an asterisk, so it turns that into
just '*'. I changed lib/Parrot/Configure/Step.pm to substitute '\\*'
for '\*'. I can now run 'make test'.

I have only tested this patch with mingw32-make, so I would appreciate
it if others could test it with nmake / dmake to make sure they don't
choke on the extra backslashes.

Win98-glob.patch

Clement Cherlin

unread,
Jun 15, 2005, 4:52:14 AM6/15/05
to parrotbug...@parrotcode.org
--- Leopold Toetsch via RT <parrotbug...@parrotcode.org> wrote:

> Clement Cherlin (via RT) wrote:
>

> >> perl.exe t\harness --gc-debug --running-make-test
> >
> > t\library\*.t
>

> [ ... ]
>
> Doesn't a) perl take forward slashes too and b) harness do the glob
> anyway? If the shell globs the test args, we'll run into commandline
> length issues sooner or later.
>
> leo

Perl will accept both forward and backward slashes on Win32, and the
harness does do the globbing. My patch only deals with the fact that
make is treating "\*" as an escaped asterisk, and unescaping it to just
"*". I add an additional backslash, thus escaping the backslash instead
of the asterisk. Make translates "\\*" to "\*" and all is well.

Leopold Toetsch

unread,
Jun 15, 2005, 5:36:39 AM6/15/05
to Clement Cherlin, parrotbug...@parrotcode.org

Yes. But shouldn't in that case the patch convert the backslashes to
just forward slahes - or much better not backslash it in the first place
(and possibly quote the *.t args)?

The patch reverses a wrong action (backslashing) that happens earlier
somewhere in config.

leo

Clement Cherlin

unread,
Jun 15, 2005, 6:05:00 AM6/15/05
to parrotbug...@parrotcode.org

The Makefile uses backslashes because backslashes are the native path
seperator on Windows, and the command.com shell will not accept forward
slashes. My earlier patch intentionally enabled the use of backslashes
in Makefiles when compiling with MinGW, in order to get Parrot to
compile at all. Parrot now compiles, but this problem with "make test"
resulted, and I provided a workaround. I agree that it's a somewhat
ugly workaround, but it was the simplest method I could think of. Can
you suggest an alternate solution?

Clement Cherlin

unread,
Jun 15, 2005, 7:16:49 AM6/15/05
to parrotbug...@parrotcode.org
--- Leopold Toetsch via RT <parrotbug...@parrotcode.org> wrote:

> Clement Cherlin wrote:
>
> > ... I agree that it's a somewhat


> > ugly workaround, but it was the simplest method I could think of.
> Can
> > you suggest an alternate solution?
>

> TEST_FILES in makefiles/root.in has forward slashes. During creation
> of
> the Makefile these get somewhere converted to backslashes. This
> conversion isn't needed (or wrong for MingW), if these files are part
> of
> a perl commandline (or not at all for MingW).
>
> But I actually don't know, where the conversion happens, sorry.
>
> leo

I know where the conversion takes place, that's what my patch modifies.
The point I am trying to make is that the conversion is needed for
MinGW when using command.com, because command.com doesn't understand
forward slashes. I can't get by with forward slashes in makefiles;
Parrot will not build. Perl and the MinGW tools understand both forward
slashes and backslashes just fine. The only problem is that make treats
backslashes as an escape character when they precede an asterisk. So
the patch doubles up backslashes that precede asterisks. With this
patch, Parrot builds and make test runs.

Leopold Toetsch

unread,
Jun 15, 2005, 7:09:09 AM6/15/05
to Clement Cherlin, parrotbug...@parrotcode.org
Clement Cherlin wrote:

> ... I agree that it's a somewhat


> ugly workaround, but it was the simplest method I could think of. Can
> you suggest an alternate solution?

TEST_FILES in makefiles/root.in has forward slashes. During creation of

François PERRAD

unread,
Jul 8, 2005, 2:14:44 AM7/8/05
to perl6-i...@perl.org, l...@toetsch.at, cche...@pacbell.net
At 22:43 14/06/2005 -0700, you wrote:
># New Ticket Created by Clement Cherlin
># Please include the string: [perl #36290]
># in the subject line of all future correspondence about this issue.
># <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=36290 >
>
>
>François PERRAD wrote:
> >
> > Please, revert this patch (r8298)
> > With MinGW & cmd.exe :
> > $ make test
> > perl.exe t\harness --gc-debug --running-make-test
>t\library\*.t
> > t\op\*.t t\pmc\*.t t\native_pbc\*.t imcc\t\*\*.t t\dynclass\*.t
> > t\src\*.t t\perl\*.t
> > FAILED--no tests were run for some reason.
> >
> > In its initial mail, Clement Cherlin wrote : "I still haven't gotten
> > compilation to finish ..."
> >
> > Francois Perrad.
> >
>
>Not to worry, I have a one-line fix for that problem. Mingw32-make
>treats '\*' as a backslash escaping an asterisk, so it turns that into
>just '*'. I changed lib/Parrot/Configure/Step.pm to substitute '\\*'
>for '\*'. I can now run 'make test'.
>
>I have only tested this patch with mingw32-make, so I would appreciate
>it if others could test it with nmake / dmake to make sure they don't
>choke on the extra backslashes.

leo,

this patch (#36290) works for me.
There are 2 choices :
1) revert the patch that creates the revision 8298
2) not revert and add its complement ie. #36290
But it's not possible to stay in the current position.

François Perrad


Reply all
Reply to author
Forward
0 new messages