On Wed, Feb 17, 2016 at 12:00:06PM +0000, Dave Mitchell wrote:
> On Tue, Feb 16, 2016 at 10:34:07AM -0800, Russ Allbery wrote:
> > My preferred solution would be to require Encode as a prerequisite for
> > podlators when building core. Is there any way to do that?
>
> Probably, but the build system isn't my strong point. I tried hacking
> Makefile.SH so that it adds this line to Makefile if Encode hasn't been
> deselected:
>
> cpan/podlators/pm_to_blib: lib/auto/Encode/Encode.so
>
> but then I get this:
>
> make: Circular lib/auto/Encode/Encode.so <- makeppport dependency dropped.
> make: Circular DynaLoader.o <- cpan/podlators/pm_to_blib dependency
> dropped.
Having looked at this some more, non-XS modules like podlators are all
built before XS modules like Encode. Hacking the build system to
build podlators after Encode is tricky. I made a start and got bogged
down. For example, the early non-XS building is done using ./miniperl, but
the later non-XS would need to be done using ./perl, otherwise Encoding still
isn't available.
But I don't think its necessary after all: the new() method in Pod::Man
is only called in three places during the build:
1. Building cpan/podlators.
At this point Encode isn't built, and the warning is emitted
2. Testing cpan/podlators/t/*/*.t
At this point Encode is built and there are no warnings.
3. Installing perl and all its modules
It's called many times here, but again, at this point Encode is built so
there are no warnings
Only during (1) is the environment variable PERL_CORE set.
Unless there's a need for Encode to be present when padlators is made,
I propose that the code in Pod::Man::new() which warns if Encode isn't
present, only does so if !$ENV{PERL_CORE}.
--
Modern art:
"That's easy, I could have done that!"
"Ah, but you didn't!"