[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dh(_auto_clean) and Module::Build::Tiny

On Thu, Jan 30, 2014 at 10:35 PM, gregor herrmann <gregoa@debian.org> wrote:
We have a problem with Module::Build::Tiny (itself and M::B::T using
packages), and that is that debhelper (or more exactly: dh_auto_clean
when it detects the perl_build build system [i.e. Build.PL]) runs

`perl Build distclean'

Now Module::Build (for which this was originally written) supports
distclean and realclean, with slightly different semantics;
Module::Build::Tiny only supports realclean.

(I guess this wasn't detected earlier because noone has built a
package / ran the debian/rules clean target with M::B::T and an
existing ./Build file. I recently tried to build a package twice in a
row and ran into this issue.)

So, I'm not sure what to do about this:
- Ask upstream to add a distclean target? - I guess there are reasons
  why it's not there ...
- Add the distclean target in a Debian patch? - Ugh ...
- File a bug report against debhelper to s/distclean/realclean/? -
  Then we probably need arguments and some evidence that this doesn't
  break anything.

Cc'ing upstream to get their advice as well; ideas and comments from
everyone welcome!

As a general remark: we (the "Perl Toolchain Gang") are busy writing up a Build.PL spec, you can find it at https://github.com/Perl-Toolchain-Gang/cpan-api-buildpl. This spec is a minimal useful subset of what Module::Build implements. The current contents are mainly shaped by the needs of CPAN clients, given we haven't had a lot of feedback from packagers yet.

You probably want to avoid depending on features that are not in the spec, given that there will be more tools implementing it (Module::Build::Tiny is more of a prototype that got mature enough to actually be used, you should assume it won't be the last). Fortunately the spec is still in draft, so instead of adapting your tools you could suggest us to add things to the spec :-).

As for option one, Module::Build::Tiny is committed to implementing the full spec so if it would be added to the spec I'll add it to MBT without further discussion. Without that I'd lean towards not doing so, as it does complicate the code somewhat.

I really don't think option two is scalable when other building tools arrive. I really don't think it's desirable anyway.

I'm leaning towards the third option though: s/distclean/realclean/. Essentially, «Build distclean» equals «Build realclean; Build distcheck» except for Build no longer existing during the second part. I don't really think that distcheck is particularly useful in this context: dist* actions are mostly for authors. Do please open up a ticket on the spec github if you disagree.

The clean and realclean actions have a ticket with consensus so far that they should be added precisely for packaging, but the required prose hasn't been produced yet. I do think "the specification guarantees this will work" and "this has worked since the very first version of Module::Build" would be fairly strong arguments for using realclean. Also, it seems cdbs has always used realclean.



P.S. The --create_packlist ticket is also relevant for debhelper.

Reply to: