develooper Front page | perl.par | Postings from September 2008

PAR and YAML

From:
Steffen Mueller
Date:
September 5, 2008 05:28
Subject:
PAR and YAML
Message ID:
20080905122842.5711.qmail@lists.develooper.com
Hi everybody,

the PAR docs have long claimed to respect settings in the META.yml of a
.par (and thus also binary executable) package. Specifically, the
preferred extraction behaviour was claimed to be read from there and
honoured.*

As far as I can tell, this has never been the case. PAR.pm sports the
comment:

# XXX - handle META.yml here!

There is a long-standing bug report about this defect, too:
http://rt.cpan.org/Ticket/Display.html?id=17576

pp generates a simple META.yml. But it just uses a human-written
template, not an actual YAML writer.

If we're ever going to fix this, and I'd really like to, we need to rely
on a YAMLish reader and potentially a YAMLish dumper to be available.
Adding a dependency to PAR(.pm!) is always very bad since it's a
deployment tool. Here's the options:

- Rely on the eventual ubiquity of 5.10 to provide Parse::CPAN::Meta /
add a dependency on that module. It's not a full YAML reader, but we're
only writing META.yml's with no fancy stuff after all!
- Add a dependency on YAML::Tiny. Dependency, ugh. YAML purists will
also hate us.
- Add a dependency on YAML.pm, which is big, so no.
- Add a dependency on any of the XS implementations. Gets a veto.

Remember that for stand-alone executables, the YAML reader would be part
of the uncompressed section. For "use PAR..." usage, it's a dependency
that won't be readable from .par files.

Ideally, we wouldn't have to add a dependency on any specific
implementation and just use a short snippet of code which checks for the
availability of just *any* YAML reader/dumper and returns the subs. But
alas, it's not possible to specify that kind of squishy dependency.

What do you people think? Is it worth adding a dependency on the
Parse::... thing which comes with 5.10? What if in the future, we find
out we actually also need a dumper?

Or is this whole thing of using META.yml as a carrier for run-time
information flawed? I don't think so, but who am I?

Cheers,
Steffen


* There's some more info saved by pp. I particularly like the
"signature" bit:
par:
  clean: $clean
  signature: ''
  verbatim: $verbatim
  version: $PAR::VERSION



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About