Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 3, 2022

Conversation

demerphq
Copy link
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
Copy link
Collaborator Author

demerphq commented Aug 29, 2022

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

@demerphq
Copy link
Collaborator Author

demerphq commented Sep 3, 2022

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
Copy link
Contributor

tonycoz commented Apr 16, 2025

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
2 participants
close