Skip to content

Resolve #2754 and #16300 - introduce a workaround for Module::Install::DSL and fixup return code for perl_parser()#20181

Merged
demerphq merged 4 commits into
bleadfrom
yves/fixup_16300
Sep 3, 2022
Merged

Resolve #2754 and #16300 - introduce a workaround for Module::Install::DSL and fixup return code for perl_parser()#20181
demerphq merged 4 commits into
bleadfrom
yves/fixup_16300

Conversation

@demerphq

Copy link
Copy Markdown
Collaborator

In 0301e89 Zefram fixed a long standing bug #2754, and properly defined the exit code from perl_parse(). This however broke Module::Install::DSL as can be seen in issue #16300. The patch was reverted in 857320c. Module::Install is not easily upgradable due to its design, and there are still a lot of modules out there with the buggy use of INIT.

However, it turns out that the bugfix from #2754 allows us to fix other issues which we want to address.

So this PR reverts Zeframs revert and creates a simple workaround for the Module::Install::DSL issue. INIT blocks in the Module::Install::DSL namespace will magically be treated as BEGIN blocks. This means that they will be executed inside of the eval that Module::Install::DSL creates, and executed as expected, at the same time a warning is produced to show the workaround has been triggered.

The check for this is quite efficient so it should not be noticeable outside of the special case it is meant to work around.

This will enable us to fix Issue: #20161 and potentially also apply PR #20168

This converts INIT {} blocks from the Module::Install::DSL
namespace into BEGIN blocks. This works around the bug reported in
GH Issue #16300. (Hopefully, not fully tested yet.) Which in turn
should allow us to close the bug in #2754.

See also PR: #20168 and Issue: #20161 both of which are blocked by
this.
This reverts commit 857320c.

There were a lot of conflicts due to whitespace changes in the
intervening time. I manually reviewed the differences and merged them.
@demerphq

demerphq commented Aug 29, 2022

Copy link
Copy Markdown
Collaborator Author

Turns this touches on other reverted logic from what i can tell. The last two commits are related to Win32 issues. See #16418

@demerphq

demerphq commented Sep 3, 2022

Copy link
Copy Markdown
Collaborator Author

I will merge this as is, if and when the MI workaround is no longer needed we can remove it.

@demerphq demerphq merged commit 127965c into blead Sep 3, 2022
@jkeenan jkeenan deleted the yves/fixup_16300 branch September 4, 2022 01:22
@tonycoz

tonycoz commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

This links to #2754 but that seems unrelated, I suspect it means rt2754 aka #1537

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants