Joshua Hoblitt wrote:
The issue is here is that there is nothing in Configure.pl's output to
correlate the package name of the step with the output seen from a
typical run.

[snip]

Possible ways forward:

[snip]

7) have every configure step print it's package name as part of it's
output


Back in August when we were discussing the --verbose-step option, I remarked about Joshua's suggestion #7:

>
> I'm thinking that this is a happy compromise between the 'provide the
> step::name only' and 'provide something that appears in the description'
> position.  What the user would type to request verbosity would be fairly
> self-evident.
>

But I didn't actually implement this. What I actually implemented was specifying the configuration step name *as an alternative to* specifying a portion of the step's description. While this satisfied particle's original request, it led to some ugly code in Parrot::Configure::_run_this_step:

+            (
+                # by step number
+                ( $args->{verbose_step} =~ /^\d+$/ )
+                    and
+                ( $args->{n} == $args->{verbose_step} )
+            )
+                or
+            (
+                # by step name
+                ( ${$conf->{hash_of_steps}}{$args->{verbose_step}} )
+                    and
+                ( $args->{verbose_step} eq $step_name )
+            )
+                or
+            (
+                # by description
+                $description =~ /$args->{verbose_step}/
+            )

Code this ugly is difficult to test thoroughly. In fact, as I've been working on this code in the reconfigure/ branch, this code excerpt is the only code in lib/Parrot/Configure.pm which is not 100% covered by the tests with respect to statements, branches and conditions.

I'd like to propose that we look at Joshua's option #7 more closely. What that would imply is that in non-verbose mode, where Configure.pl *currently* prints out this:

   Loading platform and local hints files..........................done.

... it would instead print out something like this:

   inter::progs:  Loading platform and local hints files...........done.

If the user wanted step 'inter::progs' to print out verbosely, on the next pass she would be instructed by the docs to specify:

   perl Configure.pl --verbose-step=inter::progs

... and would get verbose output for that step. (Some config step descriptions might have to be shortened, but I'd be prepared to take on that legwork.)

Apart from simplifying the code in _run_this_step() cited above, this approach would have the advantage that we could arrange it for the user to specify a comma-delimited string of configuration steps if she wanted more than one step (but not all steps) to execute verbosely.

   perl Configure.pl --verbose-step=inter::progs,gen::makefiles

In the reconfigure/ branch, I have figured out how to do this with the --fatal-step option (https://rt.perl.org/rt3/Ticket/Display.html?id=45525). I will soon be proposing a patch to trunk for --fatal-step, and it would be great if --verbose-step and --fatal-step could work in the same manner.

I should note that currently you can also specify --verbose-step=53 and have step # 53, and only #53, execute verbosely. How that would be affected I haven't yet thought through?

Comments?

Thank you very much.
kid51

Reply via email to