Skip to content

Commit f8ef6e8

Browse files
committed
Revert "op.c - work around Module::Install::DSL issue"
This reverts commit 451a9a1. We no longer need the Module::Install::DSL workaround. This fixes GH Issue #20233.
1 parent 9312140 commit f8ef6e8

File tree

4 files changed

+2
-43
lines changed

4 files changed

+2
-43
lines changed

op.c

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10965,19 +10965,16 @@ S_process_special_blocks(pTHX_ I32 floor, const char *const fullname,
1096510965
{
1096610966
const char *const colon = strrchr(fullname,':');
1096710967
const char *const name = colon ? colon + 1 : fullname;
10968-
int is_module_install_hack = 0;
1096910968

1097010969
PERL_ARGS_ASSERT_PROCESS_SPECIAL_BLOCKS;
1097110970

1097210971
if (*name == 'B') {
10973-
module_install_hack:
10974-
if (strEQ(name, "BEGIN") || is_module_install_hack) {
10972+
if (strEQ(name, "BEGIN")) {
1097510973
const I32 oldscope = PL_scopestack_ix;
1097610974
SV *max_nest_sv = NULL;
1097710975
IV max_nest_iv;
1097810976
dSP;
1097910977
(void)CvGV(cv);
10980-
is_module_install_hack = 0;
1098110978
if (floor) LEAVE_SCOPE(floor);
1098210979
ENTER;
1098310980

@@ -11106,30 +11103,6 @@ S_process_special_blocks(pTHX_ I32 floor, const char *const fullname,
1110611103
return FALSE;
1110711104
} else if (*name == 'I') {
1110811105
if (strEQ(name, "INIT")) {
11109-
#ifdef MI_INIT_WORKAROUND_PACK
11110-
{
11111-
HV *hv= CvSTASH(cv);
11112-
STRLEN len = hv ? HvNAMELEN(hv) : 0;
11113-
char *pv= (len == sizeof(MI_INIT_WORKAROUND_PACK)-1)
11114-
? HvNAME_get(hv) : NULL;
11115-
if ( pv && strEQ(pv,MI_INIT_WORKAROUND_PACK) )
11116-
{
11117-
/* old versions of Module::Install::DSL contain code
11118-
* that creates an INIT in eval, which expect to run
11119-
* after an exit(0) in BEGIN. This unfortunately
11120-
* breaks a lot of code in the CPAN river. So we magically
11121-
* convert INIT blocks from Module::Install::DSL to
11122-
* be BEGIN blocks. Which works out, since the INIT
11123-
* blocks it creates are eval'ed so are late.
11124-
*/
11125-
Perl_warn(aTHX_ "Treating %s::INIT block as BEGIN block as workaround",
11126-
MI_INIT_WORKAROUND_PACK);
11127-
is_module_install_hack = 1;
11128-
goto module_install_hack;
11129-
}
11130-
11131-
}
11132-
#endif
1113311106
if (PL_main_start)
1113411107
/* diag_listed_as: Too late to run %s block */
1113511108
Perl_ck_warner(aTHX_ packWARN(WARN_VOID),

op.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,6 @@ struct op_argcheck_aux {
11701170
char slurpy; /* presence of slurpy: may be '\0', '@' or '%' */
11711171
};
11721172

1173-
#define MI_INIT_WORKAROUND_PACK "Module::Install::DSL"
11741173

11751174

11761175
/*

pod/perldiag.pod

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6453,15 +6453,6 @@ C<$tr> or C<$y> may cause this error.
64536453
(F) The lexer couldn't find the final delimiter of a tr///, tr[][],
64546454
y/// or y[][] construct.
64556455

6456-
=item Treating %s::INIT block as BEGIN block as workaround
6457-
6458-
(S) A package is using an old version of C<Module::Install::DSL> to
6459-
install, which makes unsafe assumptions about when INIT blocks will be
6460-
called. Because C<Module::Install::DSL> is used to install other modules
6461-
and is difficult to upgrade we have a special workaround in place to
6462-
deal with this. Unless you are a maintainer of an affected module you
6463-
can ignore this warning. We emit it only as a sanity check.
6464-
64656456
=item '%s' trapped by operation mask
64666457

64676458
(F) You tried to use an operator from a Safe compartment in which it's

t/op/blocks.t

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ BEGIN {
66
set_up_inc('../lib');
77
}
88

9-
plan tests => 26;
9+
plan tests => 25;
1010

1111
my @expect = qw(
1212
b1
@@ -288,7 +288,3 @@ TODO: {
288288

289289
fresh_perl_is('eval "BEGIN {goto end}"; end:', '', {}, 'RT #113934: goto out of BEGIN causes assertion failure');
290290

291-
fresh_perl_is('package Module::Install::DSL; BEGIN { eval "INIT { print q(INIT fired in eval) }" }',
292-
"Treating Module::Install::DSL::INIT block as BEGIN block as workaround at (eval 1) line 1.\n"
293-
."INIT fired in eval", {},
294-
'GH Issue #16300: Module::Install::DSL workaround');

0 commit comments

Comments
 (0)