Re: Lancaster Consensus, deal with PUREPERL_ONLY=0

[email protected] (Jens Rehsack)
Newsgroups perl.cpan.workers
Message-ID <[email protected]>
Am 02.06.2014 um 13:34 schrieb David Golden <[email protected]>:

> On Mon, Jun 2, 2014 at 7:28 AM, Jens Rehsack <[email protected]> wrote:
>> Others (eg. packagers) have always a compiler and want benefit from XS when
>> available and what is more important: if the "DEVELOPER MODE FLAGS IS ON",
>> they want to have a -Werror behavior even for "I enabled foo and it doesn't
>> appear".
> 
> I don't understand what you mean by this.

http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

It's the widest know of those flags - GNU autotools provide such a one, too.
xlc names it -qhalt=<severity> ...

Lot's of tools provide switches which exit when something doesn't do as
wanted (if a specific behavior is intended).

>> I'm fine with "Jens' distribution have a non-standard switch", but I
>> would prefer a "Toolchain community favors that knob to be used".
> 
> In Lancaster, we considered having both a "give me PP" option *and* a
> "give me XS" option and the group decided it was less confusing to
> have just one.

I didn't had the "user control > author mind" situation. I evolved by
implementing (both sides - provide CPAN distributions and use/package
them).

> Here's how I would do it:
> 
> (a) if the PP option is there, give them PP
> (b) if the PP option is missing/false, check if there is a compiler
> (c) if there is a compiler, give them XS or give them death
> (d) if there isn't a compiler, give them PP
> 
> If for (c) that means running tests under some "XS-only" flag of your
> own, that's fine with me.

(b)-(d) shall die (or exit 0 in Makefile.PL) when XS-force flag is set.

I currently prove:
a) what is wanted (tri-state: PP-only, XS-only, check)
pp-b) do just pp
b) check for "sane xs" (perl.h, xsub.h, perl-api, ...)
xs-c) (b) or bail-out
check-c) (b) or goto (pp-b)
d) compile && pp

Is that somehow clear?

But ... that brings me to another point of view. Take Unix::Statgrab,
File::LibMagic or BSD::Resource as example - they won't work without XS
either. Shall they generally bail-out when PUREPERL_ONLY=1 is set?

Cheers
-- 
Jens Rehsack
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.