-
Notifications
You must be signed in to change notification settings - Fork 606
Description
I was working on a branch this evening in which I had occasion to modify dist/Devel-SelfStubber/lib/Devel/SelfStubber.pm. When I ran make test_prep to rebuild, the build died at line 324 in make_ext.pl:
322 {
323 no warnings 'deprecated';
324 goto NO_MAKEFILE;
325 }
...
358 if ($makefile_no_minus_f || !-f $makefile) {
359 NO_MAKEFILE:
360 if (!-f 'Makefile.PL') {
361 unless (just_pm_to_blib($target, $ext_dir, $mname, $return_dir)) {
362 # No problems returned, so it has faked everything for us. :-)
363 chdir $return_dir || die "Cannot cd to $return_dir: $!";
364 return;
365 }
366
367 print "\nCreating Makefile.PL in $ext_dir for $mname\n" if $verbose;
368 my ($fromname, $key, $value);
...
563 }
This apparently is an instance of the kind of usage of goto LABEL that was turned into an exception just this week by
commit d306795336cc8ce0c7c80e251adb1343497abbbd
Author: James E Keenan <[email protected]>
AuthorDate: Wed Nov 19 07:47:06 2025
Commit: James E Keenan <[email protected]>
CommitDate: Tue Dec 16 10:13:47 2025
Fatalize use of goto to jump into construct
...
I've never studied make_ext.pl before, but I suspect that we ran into this code because the directory tree in which SelfStubber.pm resides has no Makefile.PL. And we don't have independent tests of programs like make_ext.pl.
$ trim dist/Devel-SelfStubber/
| `--
| `--lib
| | `--Devel
| | | `--SelfStubber.pm
| `--t
| | `--Devel-SelfStubber.t
Here are some other instances where our internal use of goto LABEL needs to be examined:
autodoc.pl-2477- # Then splice the array, leaving only the out-of-order
autodoc.pl-2478- # items
autodoc.pl-2479- eval "splice \@items, $splice_low[$which]\$i ;";
autodoc.pl:2480: goto spliced;
autodoc.pl-2481- }
autodoc.pl-2482-
autodoc.pl-2483- die "Unexpectedly \@items doesn't contain $leaders[$which]";
--
make_ext.pl-321- _unlink($makefile);
make_ext.pl-322- {
make_ext.pl-323- no warnings 'deprecated';
make_ext.pl:324: goto NO_MAKEFILE;
make_ext.pl-325- }
make_ext.pl-326- }
make_ext.pl-327- }
--
Porting/leakfinder.pl-87-eval {INIT {print ":i2"}};
Porting/leakfinder.pl-88-eval { $proto->can($method) } || push @nok, $method;
Porting/leakfinder.pl-89-eval { push \@ISA, __FILE__ };
Porting/leakfinder.pl:90:eval 'v23: $counter++; goto v23 unless $counter == 2';
Porting/leakfinder.pl:91:eval 'v23 : $counter++; goto v23 unless $counter == 2';
Porting/leakfinder.pl-92-$formdata->{$key} = [ $formdata->{$key}, $value ];
Porting/leakfinder.pl-93-$func = $next{$func} until $pod{$func};
Porting/leakfinder.pl-94-$got_arrayref ? unshift(@{$args[0]}, $cmd) : unshift(@args, $cmd);
--
regen/mph.pl-533- $blob= $new_blob;
regen/mph.pl-534- $old_res= $res;
regen/mph.pl-535- %appended= ();
regen/mph.pl:536: goto REDO;
regen/mph.pl-537- }
regen/mph.pl-538- else {
regen/mph.pl-539- printf "After %d passes final blob length is %d chars.\n"
There may be others. It's too late for me to analyze this thoroughly tonight. We're also scheduled for a development release on Saturday, December 20. Should we revert d306795?