Lists: | pgsql-hackerspgsql-patches |
---|
From: | Magnus Hagander <magnus(at)hagander(dot)net> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | MSVC build broken with perl 5.10 |
Date: | 2008-04-08 19:34:19 |
Message-ID: | 20080408213419.5426ac0d@mha-laptop |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
I just tried the MSVC build on a system with ActiveState Perl 5.10, and
it doesn't work. Some quick debugging before I downgraded to 5.8 showed
that this regexp in Project.pm line 262:
my $replace_re =
qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*: )?\$(\([^\)]+\))\/(.*)\/[^\/]+$};
matches things properly using Perl 5.8 in for example
src/bin/initdb/Makefile (matches a total of around 10 Makefiles), but
in 5.10 it simply does not match anything...
Any perl guru out there who can comment on why? ;-)
//Magnus
From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: MSVC build broken with perl 5.10 |
Date: | 2008-04-08 20:01:31 |
Message-ID: | 47FBCF1B.806@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Magnus Hagander wrote:
> I just tried the MSVC build on a system with ActiveState Perl 5.10, and
> it doesn't work. Some quick debugging before I downgraded to 5.8 showed
> that this regexp in Project.pm line 262:
> my $replace_re =
> qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*: )?\$(\([^\)]+\))\/(.*)\/[^\/]+$};
>
> matches things properly using Perl 5.8 in for example
> src/bin/initdb/Makefile (matches a total of around 10 Makefiles), but
> in 5.10 it simply does not match anything...
>
> Any perl guru out there who can comment on why? ;-)
>
>
Perhaps you would like to comment it using the x format, so that it
doesn't just look like white noise.
cheers
andrew
From: | Magnus Hagander <magnus(at)hagander(dot)net> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: MSVC build broken with perl 5.10 |
Date: | 2008-04-10 14:12:56 |
Message-ID: | 20080410161256.222d01d7@mha-laptop |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Andrew Dunstan wrote:
>
>
> Magnus Hagander wrote:
> > I just tried the MSVC build on a system with ActiveState Perl 5.10,
> > and it doesn't work. Some quick debugging before I downgraded to
> > 5.8 showed that this regexp in Project.pm line 262:
> > my $replace_re =
> > qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*: )?\$(\([^\)]+\))\/(.*)\/[^\/]+$};
> >
> > matches things properly using Perl 5.8 in for example
> > src/bin/initdb/Makefile (matches a total of around 10 Makefiles),
> > but in 5.10 it simply does not match anything...
> >
> > Any perl guru out there who can comment on why? ;-)
> >
> >
>
> Perhaps you would like to comment it using the x format, so that it
> doesn't just look like white noise.
That would be a good idea, no? ;-) I have no idea what you mean with
"using the x format", though, but I agree in general that the
white-noise format is not a good idea...
//Magnus
From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Magnus Hagander <magnus(at)hagander(dot)net> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: MSVC build broken with perl 5.10 |
Date: | 2008-04-10 14:53:28 |
Message-ID: | 20080410145327.GB5536@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Thu, Apr 10, 2008 at 04:12:56PM +0200, Magnus Hagander wrote:
> > > my $replace_re =
> > > qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*: )?\$(\([^\)]+\))\/(.*)\/[^\/]+$};
> > Perhaps you would like to comment it using the x format, so that it
> > doesn't just look like white noise.
>
> That would be a good idea, no? ;-) I have no idea what you mean with
> "using the x format", though, but I agree in general that the
> white-noise format is not a good idea...
Using x format modifier means you can put comments and whitespace in your regex, like:
my $replace_re = qr{^([^:\n\$]+\.c) # This matches the filename in $1
\s*:\s*(?:%\s*:\ )? # somethig with a %-sign
...etc...
}x;
Check the perlre manpage for more info.
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.
From: | "Zeugswetter Andreas OSB SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at> |
---|---|
To: | <pgsql-patches(at)postgresql(dot)org> |
Cc: | "Magnus Hagander" <magnus(at)hagander(dot)net>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] MSVC build broken with perl 5.10 |
Date: | 2008-04-15 13:43:14 |
Message-ID: | E1539E0ED7043848906A8FF995BDA57902F90E24@m0143.s-mxs.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Magnus Hagander wrote:
> I just tried the MSVC build on a system with ActiveState Perl 5.10,
and
> it doesn't work. Some quick debugging before I downgraded to 5.8
showed
> that this regexp in Project.pm line 262:
> my $replace_re = qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*:
)?\$(\([^\)]+\))\/(.*)\/[^\/]+$};
>
> matches things properly using Perl 5.8 in for example
> src/bin/initdb/Makefile (matches a total of around 10 Makefiles), but
> in 5.10 it simply does not match anything...
>
> Any perl guru out there who can comment on why? ;-)
The answer is actually simple, the \n needs the multiline modifier,
and thus the m needs to be part of the quote-like operator.
The perl doc states:
"This operator quotes (and possibly compiles) its STRING"
(it seems 5.8 did not compile, but 5.10 does)
I feel that it is rather not a perl bug, and that the modifiers need to
be put
on the qr{}. I do not quite see why this re needs to be multiline in the
first place,
but I have not touched that in the attached patch, that is ready to
apply.
(modification works in perl 5.6, 5.8, 5.10)
Andreas
Attachment | Content-Type | Size |
---|---|---|
Project.pm.patch | application/octet-stream | 721 bytes |
From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Zeugswetter Andreas OSB SD <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at> |
Cc: | pgsql-patches(at)postgresql(dot)org, Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [HACKERS] MSVC build broken with perl 5.10 |
Date: | 2008-04-15 16:29:51 |
Message-ID: | 4804D7FF.7050601@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Zeugswetter Andreas OSB SD wrote:
> Magnus Hagander wrote:
>
>> I just tried the MSVC build on a system with ActiveState Perl 5.10,
>>
> and
>
>> it doesn't work. Some quick debugging before I downgraded to 5.8
>>
> showed
>
>> that this regexp in Project.pm line 262:
>> my $replace_re = qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*:
>>
> )?\$(\([^\)]+\))\/(.*)\/[^\/]+$};
>
>> matches things properly using Perl 5.8 in for example
>> src/bin/initdb/Makefile (matches a total of around 10 Makefiles), but
>> in 5.10 it simply does not match anything...
>>
>> Any perl guru out there who can comment on why? ;-)
>>
>
> The answer is actually simple, the \n needs the multiline modifier,
> and thus the m needs to be part of the quote-like operator.
>
> The perl doc states:
> "This operator quotes (and possibly compiles) its STRING"
> (it seems 5.8 did not compile, but 5.10 does)
>
> I feel that it is rather not a perl bug, and that the modifiers need to
> be put
> on the qr{}. I do not quite see why this re needs to be multiline in the
> first place,
> but I have not touched that in the attached patch, that is ready to
> apply.
> (modification works in perl 5.6, 5.8, 5.10)
>
>
Thanks, that makes sense. I wonder how it ever worked before. Anyway,
patch applied back as far as 8.2.
cheers
andrew