Closed kentfredric closed 3 years ago
Aka. “Dist::Zilla 6.010 can't load plugins from inc/
under perl 5.26”. As a workaround one can export PERL_USE_UNSAFE_INC=1
in the current shell, but this is really something that dzil should support by itself.
Note that in some cases dzil handles inc::
modules specially, e.g. by prioritizing them in the authordeps --missing
command (see the Dist::Zilla::Util::AuthorDeps::extract_author_deps()
function). This prioritization seems to make it impossible to consistently work around the inc/
handling via the (external) lib
plugin, but I haven't looked into that deeply.
I have no idea how this should be resolved, possibly by deprecating inc::
style plugins (please not) or by adding the root dir to @INC
while loading plugins (also seems ugly), or by supporting built-in functionality like the lib
plugin, but special-casing it where necessary.
Aka. “Dist::Zilla 6.010 can't load plugins from inc/ under perl 5.26”. As a workaround one can export PERL_USE_UNSAFE_INC=1 in the current shell, but this is really something that dzil should support by itself.
Yeah. There turns out to be no really sane way of handling this other than ensuring "." is reinstated globally sometime before loading the first plugin. Given that by design, you MUST be in your project root for dzil
to even work, the typical paranoia about ". might be insecure" is moot.
Note that in some cases dzil handles inc:: modules specially, e.g. by prioritizing them in the authordeps --missing command (see the Dist::Zilla::Util::AuthorDeps::extract_author_deps() function). This prioritization seems to make it impossible to consistently work around the inc/ handling via the (external) lib plugin, but I haven't looked into that deeply.
Yep. Its not possible to pull this trick through a plugin because the design of authordeps eschews loading plugins by configuration, and so there's no step at which authordeps can actually run the magic that makes this happen.
The "seems ugly" concern seems much less significant when you realise you can replace dist.ini
with dist.pl
and dzil will execute arbitrary code in .
as a result that way: https://metacpan.org/pod/Dist::Zilla::MVP::Reader::Perl https://metacpan.org/source/RJBS/Dist-Zilla-6.010/lib/Dist/Zilla/MVP/Reader/Perl.pm#L21
So PR #600 addresses both of these issues by:
$dist_root
is in @INC
before loading dist.ini
$dist_root
is in @INC
before performing --missing
checks for Util::AuthorDeps
Pre-existing PR #590 kinda took the same approach as 1, but only did so under dzil testing situations, which just isn't enough to solve this problem for real.
Unsure if this is related to #580 or not