Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #42082] [BUG]: Configure.pl: Misspecified option; 2 non-valid options documented

5 views
Skip to first unread message

James Keenan

unread,
Mar 25, 2007, 10:34:23 PM3/25/07
to bugs-bi...@rt.perl.org
# New Ticket Created by James Keenan
# Please include the string: [perl #42082]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42082 >


Ongoing refactoring of Configure.pl in the 'reconfigure' branch
suggests two bugs in Configure.pl.

1. Configure.pl has a lexical @valid_opts (starting at line 284 for
me). One of the elements of this array is: 'verbose-step=N'.
Shouldn't this really be: 'verbose-step'?

2. The POD for Configure.pl documents two options which are not
found in @valid_opts: 'bison_required' and 'flex_required'. Are
these old options that have been removed? If so, the corresponding
POD should also be deleted.

Here is a patch that will correct these problems in trunk.

kid51

Configure.pl.pod.errors.txt

Joshua Isom

unread,
Mar 26, 2007, 1:59:19 AM3/26/07
to perl6-i...@perl.org, bugs-bi...@rt.perl.org

On Mar 25, 2007, at 9:34 PM, James Keenan (via RT) wrote:

> # New Ticket Created by James Keenan
> # Please include the string: [perl #42082]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42082 >
>
>
> Ongoing refactoring of Configure.pl in the 'reconfigure' branch
> suggests two bugs in Configure.pl.
>
> 1. Configure.pl has a lexical @valid_opts (starting at line 284 for
> me). One of the elements of this array is: 'verbose-step=N'.
> Shouldn't this really be: 'verbose-step'?

Configure.pl uses verbose-step=N which obviously looks wrong, and
lib/Parrot/Configure.pm uses verbose-step. Does verbose-step=N or
verbose-step=regex even work? There's probably an rt ticket or two
about it(or just no one uses the option which may be the case).

> 2. The POD for Configure.pl documents two options which are not
> found in @valid_opts: 'bison_required' and 'flex_required'. Are
> these old options that have been removed? If so, the corresponding
> POD should also be deleted.

At the same time, is the check even made and made properly? When
parrot started needing 2.5.33, my config.sh script worked just fine,
until imclexer.c needing updating and my build failed. And still, I
only have 2.5.4 in my path yet Configure.pl still works just fine with
me setting --lex=flex.

> Here is a patch that will correct these problems in trunk.
>
> kid51
>

> Index: Configure.pl
> ===================================================================
> --- Configure.pl (revision 17743)
> +++ Configure.pl (working copy)
> @@ -142,18 +142,10 @@
>
> Specify which lexer to use.
>
> -=item C<--flex_required=X.Y.Z>
> -
> -Override the minimum acceptable flex version.
> -
> =item C<--yacc=(parser)>
>
> Specify which parser to use.
>
> -=item C<--bison_required=X.Y>
> -
> -Override the minimum acceptable bison version.
> -
> =item C<--define=val1[,val2]>
>
> Generate "#define PARROT_DEF_VAL1 1" ... entries in has_header.h.
> Currently
> @@ -295,7 +287,7 @@
> jitcapable ld ldflags lex libdir libexecdir libs link linkflags
> localstatedir m maintainer mandir miniparrot nomanicheck
> oldincludedir
> opcode ops optimize parrot_is_shared pmc prefix profile sbindir
> - sharedstatedir step sysconfdir verbose verbose-step=N version
> without-gdbm
> + sharedstatedir step sysconfdir verbose verbose-step version
> without-gdbm
> without-gmp without-icu yacc);
>
> my %args;

James Keenan via RT

unread,
Mar 26, 2007, 7:02:19 AM3/26/07
to perl6-i...@perl.org
On Sun Mar 25 23:00:09 2007, jri...@gmail.com wrote:
>
> On Mar 25, 2007, at 9:34 PM, James Keenan (via RT) wrote:
>
> >
> > 1. Configure.pl has a lexical @valid_opts (starting at line 284 for
> > me). One of the elements of this array is: 'verbose-step=N'.
> > Shouldn't this really be: 'verbose-step'?
>
> Configure.pl uses verbose-step=N which obviously looks wrong,

Yes, because it appends the value to the key.


> and lib/Parrot/Configure.pm uses verbose-step.

... which looks correct, though I haven't tried it.

> Does verbose-step=N or
> verbose-step=regex even work? There's probably an rt ticket or two
> about it(or just no one uses the option which may be the case).
>
> > 2. The POD for Configure.pl documents two options which are not
> > found in @valid_opts: 'bison_required' and 'flex_required'. Are
> > these old options that have been removed? If so, the corresponding
> > POD should also be deleted.
>
> At the same time, is the check even made and made properly? When
> parrot started needing 2.5.33, my config.sh script worked just fine,
> until imclexer.c needing updating and my build failed. And still, I
> only have 2.5.4 in my path yet Configure.pl still works just fine with
> me setting --lex=flex.
>

I haven't looked into that yet. In the course of my refactoring (which you can look at in the
'reconfigure' branch), I happened to write a test that examined the POD in Configure.PL and
compared the options documented there to those found in @valid_opts (which, in that
branch, is now in lib/Parrot/Configure/Options.pm). The test pointed out the three
discrepancies I reported.

kid51

James Keenan via RT

unread,
Mar 31, 2007, 11:27:26 AM3/31/07
to perl6-i...@perl.org
I decided to look further into this apparent error in Configure.pl:

my @valid_opts = qw(ask bindir cage cc ccflags ccwarn cgoto cxx
datadir #<-- line 292
...


sharedstatedir step sysconfdir verbose verbose-step=N version

without-gdbm #<-- line 298
without-gmp without-icu yacc);

I decided to try to invoke Configure.pl taking the above
'verbose-step=N' as an option key literally, i.e., 'verbose-step=N=3'.

$ cat myconfigure.with.verbose.step.bad.sh
#!/bin/sh
CC="/usr/bin/gcc-3.3"
CX="/usr/bin/g++-3.3"
/usr/local/bin/perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" \
--ld="$CX" --without-icu --without-gmp --verbose-step=N=3 $@

$ ./myconfigure.with.verbose.step.bad.sh
Invalid option verbose-step. See "perl Configure.pl --help" for valid
options

Without altering Configure.pl, I tried the above, only with
'--verbose-step=3'. Same results. (From this I would infer that nobody
has been using the 'verbose-step' option lately. Otherwise, the bug
would have been reported earlier!)

I then modified Configure.pl as per my submitted patch:

my @valid_opts = qw(ask bindir cage cc ccflags ccwarn cgoto cxx
datadir #<-- line 292
...


sharedstatedir step sysconfdir verbose verbose-step version

without-gdbm #<-- line 298
without-gmp without-icu yacc);

I then configured with 'verbose-step=3'; 'verbose-step' is the option,
'3' is its value:

#!/bin/sh
CC="/usr/bin/gcc-3.3"
CX="/usr/bin/g++-3.3"
/usr/local/bin/perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" \
--ld="$CX" --without-icu --without-gmp --verbose-step=3 $@

$ ./myconfigure.with.verbose.step.good.sh
Parrot Version 0.4.10 Configure 2.0
Copyright (C) 2001-2007, The Perl Foundation.

Hello, I'm Configure. My job is to poke and prod your system to figure out
how to build Parrot. The process is completely automated, unless you
passed in
the `--ask' flag on the command line, in which case it'll prompt you
for a few
pieces of info.

Since you're running this program, you obviously have Perl 5--I'll be
pulling
some defaults from its configuration.

Checking
MANIFEST.....................................................done.
Setting up Configure's default
values.................................done.
Setting up installation
paths.........................................done.Setting Configuration
Data:
(
verbose => undef,
);

Tweaking settings for
miniparrot...................................skipped.
Loading platform and local hints
files................................done.

And Parrot happily went on to complete configuration.

I then tried the regex variant:

#!/bin/sh
CC="/usr/bin/gcc-3.3"
CX="/usr/bin/g++-3.3"
/usr/local/bin/perl Configure.pl --cc="$CC" --cxx="$CX" --link="$CX" \
--ld="$CX" --without-icu --without-gmp --verbose-step=miniparrot $@

Parrot again configured with verbose output where requested.

[parrot] 542 $ ./myconfigure.with.verbose.step.good.sh
Parrot Version 0.4.10 Configure 2.0
Copyright (C) 2001-2007, The Perl Foundation.

Hello, I'm Configure. My job is to poke and prod your system to figure out
how to build Parrot. The process is completely automated, unless you
passed in
the `--ask' flag on the command line, in which case it'll prompt you
for a few
pieces of info.

Since you're running this program, you obviously have Perl 5--I'll be
pulling
some defaults from its configuration.

Checking
MANIFEST.....................................................done.
Setting up Configure's default
values.................................done.
Setting up installation
paths.........................................done.
Tweaking settings for
miniparrot...................................skipped.Setting
Configuration Data:
(
verbose => undef,
);
Loading platform and local hints
files................................done.
Determining nongenerated header
files.................................done.

I then proceeded to run this last configuration through 'make' and 'make
test'. All tests passed on Darwin PPC and on Linux.

I am therefore applying the patch to trunk.

kid51


James Keenan via RT

unread,
Mar 31, 2007, 12:07:58 PM3/31/07
to perl6-i...@perl.org
Applied in r17899.

James Keenan via RT

unread,
Mar 31, 2007, 12:29:58 PM3/31/07
to perl6-i...@perl.org
Closing ticket.
0 new messages