Help!

How thorough must the clean target be?

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Policy RSS
Next:  debian-policy_3.7.2.2_i386.changes ACCEPTED  
Author Message
Russ Allbery
External


Since: Nov 17, 2005
Posts: 897



PostPosted: Thu Oct 05, 2006 7:50 pm    Post subject: How thorough must the clean target be?
Archived from groups: linux>debian>policy (more info?)

A recent bug report prompted this question, which had been growing in the
back of my mind for some time.

Some packages run Autconf or Automake at build time, either because they
patch the build machinery or because the package is a CVS snapshot that
doesn't contain any derived files. My gnubg package is an example of
this. Currently, there are two methods for dealing with this, both of
which are blessed by the autotools-dev documentation: run Autoconf and
Automake beforehand and let the Debian *.diff.gz be huge, or run Autoconf
and Automake at build time. Both approaches have strong advocates, and I
think it's fair to say that previous debian-devel conversation has not
reached a project-wide consensus that one approach is better than the
other.

However, the current debian-policy statement about clean is:

This must undo any effects that the build and binary targets may have
had, except that it should leave alone any output files created in the
parent directory by a run of a binary target.

Taken exactly literally, this says that packages that run Autoconf or
Automake at build time must be able to reverse all changes that those
tools make when the clean target is run. Similarly, packages that copy
new config.sub or config.guess files at build time must save the old
versions and restore them when the clean target is run.

In practice, I think that would rule out running Autoconf and Automake at
build time except for simple packages, as those programs make fairly
widespread changes.

I'm not sure that's really what's intended, though. But maybe it is.
Thoughts on this?

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-policy-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Bill Allombert
External


Since: Nov 12, 2004
Posts: 299



PostPosted: Thu Oct 05, 2006 8:30 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, Oct 05, 2006 at 10:44:53AM -0700, Russ Allbery wrote:
> However, the current debian-policy statement about clean is:
>
> This must undo any effects that the build and binary targets may have
> had, except that it should leave alone any output files created in the
> parent directory by a run of a binary target.
>
> Taken exactly literally, this says that packages that run Autoconf or
> Automake at build time must be able to reverse all changes that those
> tools make when the clean target is run. Similarly, packages that copy
> new config.sub or config.guess files at build time must save the old
> versions and restore them when the clean target is run.

\usepackage[shameless]{plug}
\begin{plug}
I have proposed a (IMVHO) better solution to the
config.sub/config.guess problem see
<http://lists.debian.org/debian-science/2006/03/msg00038.html>
\end{plug}

> In practice, I think that would rule out running Autoconf and Automake at
> build time except for simple packages, as those programs make fairly
> widespread changes.

Well you can do 'make maintainer-clean' in the clean target. This will
remove any files generated by Autoconf/Automake. Did I missed something ?

The only unclear issues is files that exist in the tarball but get
removed in the clean target. However since dpkg-buildpackage default
to run debian/rules clean prior to build the package, one might consider
to limit the policy requirement to that case:

1> dpkg-source -x foo.dsc && cd foo-*
2> debian/rules clean
3> debian/rules binary
4> debian/rules clean

We would then require that the tree after 4 must be indentical to the
tree after 2.

Cheers,
--
Bill. <ballombe DeleteThis @debian.org>

Imagine a large red swirl here.


--
To UNSUBSCRIBE, email to debian-policy-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Russ Allbery
External


Since: Nov 17, 2005
Posts: 897



PostPosted: Thu Oct 05, 2006 9:30 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Bill Allombert <allomber.TakeThisOut@math.u-bordeaux.fr> writes:
> On Thu, Oct 05, 2006 at 10:44:53AM -0700, Russ Allbery wrote:

>> In practice, I think that would rule out running Autoconf and Automake
>> at build time except for simple packages, as those programs make fairly
>> widespread changes.

> Well you can do 'make maintainer-clean' in the clean target. This will
> remove any files generated by Autoconf/Automake. Did I missed something ?

> The only unclear issues is files that exist in the tarball but get
> removed in the clean target.

That's the part that seems to still contradict the current policy wording.
Policy says that the clean target has to undo everything that build did.
If build ran Automake, removing all Makefile.in files doesn't seem like
"undoing" that. It seems just as far from undoing as leaving the newly
generated ones in place.

> However since dpkg-buildpackage default to run debian/rules clean prior
> to build the package, one might consider to limit the policy requirement
> to that case:

> 1> dpkg-source -x foo.dsc && cd foo-*
> 2> debian/rules clean
> 3> debian/rules binary
> 4> debian/rules clean

> We would then require that the tree after 4 must be indentical to the
> tree after 2.

Packages that run Autoconf/Automake during build would still fail this,
unless they ran Autoconf/Automake during clean. And doing the latter is
functionally equivalent, with most build tools, to running
Autoconf/Automake at packaging time and including the results in the diff.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-policy-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Russ Allbery
External


Since: Nov 17, 2005
Posts: 897



PostPosted: Thu Oct 05, 2006 9:30 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mike Hommey <mh RemoveThis @glandium.org> writes:
> Bill Allombert <allomber RemoveThis @math.u-bordeaux.fr> wrote:

>> \usepackage[shameless]{plug}
>> \begin{plug}
>> I have proposed a (IMVHO) better solution to the
>> config.sub/config.guess problem see
>> <http://lists.debian.org/debian-science/2006/03/msg00038.html>
>> \end{plug}

> Neat ! Please put that (well, rather the exec version) in the developer
> reference !

It's kind of neat, but I'm not sure it's really any better than just
replacing config.{guess,sub} at build time and it's functionally
equivalent. Either way you have to build-depend on autotools-dev, so it's
a question of preference of one more patch versus two lines in
debian/rules.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-policy-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Henrique de Moraes Holsch
External


Since: Nov 11, 2004
Posts: 648



PostPosted: Thu Oct 05, 2006 9:30 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 05 Oct 2006, Bill Allombert wrote:
> \usepackage[shameless]{plug}
> \begin{plug}
> I have proposed a (IMVHO) better solution to the
> config.sub/config.guess problem see
> <http://lists.debian.org/debian-science/2006/03/msg00038.html>
> \end{plug}

You know, I'd have appreciated getting that email filed as a bug against
autotools-dev instead of finding about it in this thread.

It is a good idea, I will add it to autotools-dev.

> The only unclear issues is files that exist in the tarball but get
> removed in the clean target. However since dpkg-buildpackage default
> to run debian/rules clean prior to build the package, one might consider
> to limit the policy requirement to that case:
>
> 1> dpkg-source -x foo.dsc && cd foo-*
> 2> debian/rules clean
> 3> debian/rules binary
> 4> debian/rules clean
>
> We would then require that the tree after 4 must be indentical to the
> tree after 2.

Seems *very* good. Asking for the tree after 4 being the same as the tree
before 2 is not useful to Debian packages at all, and it *is* a hassle that
requires often more expensive build strategies.

I'd second a proposal for "the tree after 4 must be indentical to the tree
after 2".

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh


--
To UNSUBSCRIBE, email to debian-policy-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Mike Hommey
External


Since: Nov 09, 2004
Posts: 966



PostPosted: Thu Oct 05, 2006 9:30 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, Oct 05, 2006 at 08:28:06PM +0200, Bill Allombert <allomber.RemoveThis@math.u-bordeaux.fr> wrote:
> On Thu, Oct 05, 2006 at 10:44:53AM -0700, Russ Allbery wrote:
> > However, the current debian-policy statement about clean is:
> >
> > This must undo any effects that the build and binary targets may have
> > had, except that it should leave alone any output files created in the
> > parent directory by a run of a binary target.
> >
> > Taken exactly literally, this says that packages that run Autoconf or
> > Automake at build time must be able to reverse all changes that those
> > tools make when the clean target is run. Similarly, packages that copy
> > new config.sub or config.guess files at build time must save the old
> > versions and restore them when the clean target is run.
>
> \usepackage[shameless]{plug}
> \begin{plug}
> I have proposed a (IMVHO) better solution to the
> config.sub/config.guess problem see
> <http://lists.debian.org/debian-science/2006/03/msg00038.html>
> \end{plug}

Neat ! Please put that (well, rather the exec version) in the developer
reference !

Mike


--
To UNSUBSCRIBE, email to debian-policy-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Aaron M. Ucko
External


Since: Dec 02, 2004
Posts: 138



PostPosted: Thu Oct 05, 2006 9:50 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Russ Allbery <rra RemoveThis @debian.org> writes:

> In practice, I think that would rule out running Autoconf and Automake at
> build time except for simple packages, as those programs make fairly
> widespread changes.

I'd characterize this as mainly a problem with automake (and libtool,
IIRC, though I generally try to stay clear of both), as aclocal,
autoconf, and autoheader generally only change one file apiece.
Anyway, one (admittedly somewhat heavyweight) solution for such cases
is to copy *everything* to a new directory, modify it to your heart's
content, and blow it away when done.

--
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
Finger amu RemoveThis @monk.mit.edu (NOT a valid e-mail address) for more info.


--
To UNSUBSCRIBE, email to debian-policy-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Bill Allombert
External


Since: Nov 12, 2004
Posts: 299



PostPosted: Thu Oct 05, 2006 10:00 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, Oct 05, 2006 at 03:50:47PM -0300, Henrique de Moraes Holschuh wrote:
> On Thu, 05 Oct 2006, Bill Allombert wrote:
> > \usepackage[shameless]{plug}
> > \begin{plug}
> > I have proposed a (IMVHO) better solution to the
> > config.sub/config.guess problem see
> > <http://lists.debian.org/debian-science/2006/03/msg00038.html>
> > \end{plug}
>
> You know, I'd have appreciated getting that email filed as a bug against
> autotools-dev instead of finding about it in this thread.

Sorry, it get buried in the thread you started there
<http://lists.debian.org/debian-devel/2001/07/msg01595.html>
my post being msg01777.html (apology to any reader not yet born in 2001/07).

> It is a good idea, I will add it to autotools-dev.

Something which is less a good idea but it useful with packages
with eon-old libtool is that one:

Build-dep on libtool and do:
printf '#!/bin/sh\nexec libtool "$$@"\n' >libtool

This way the package use /usr/bin/libtool which is up-to-date.

Cheers,
--
Bill. <ballombe.RemoveThis@debian.org>

Imagine a large red swirl here.


--
To UNSUBSCRIBE, email to debian-policy-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Bill Allombert
External


Since: Nov 12, 2004
Posts: 299



PostPosted: Thu Oct 05, 2006 10:10 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, Oct 05, 2006 at 09:53:55PM +0200, Bill Allombert wrote:
> Something which is less a good idea but it useful with packages
> with eon-old libtool is that one:
>
> Build-dep on libtool and do:
> printf '#!/bin/sh\nexec libtool "$$@"\n' >libtool
>
> This way the package use /usr/bin/libtool which is up-to-date.

I really meant to say:

Build-depend on libtool and do in debian/rules after running
configure/ltconfig and before running make:

printf '#!/bin/sh\nexec libtool "$$@"\n' >libtool

This way the build system use the latest libtool.

Cheers,
--
Bill. <ballombe.RemoveThis@debian.org>

Imagine a large red swirl here.


--
To UNSUBSCRIBE, email to debian-policy-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Kurt Roeckx
External


Since: Jan 15, 2005
Posts: 1439



PostPosted: Thu Oct 05, 2006 11:50 pm    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, Oct 05, 2006 at 09:53:55PM +0200, Bill Allombert wrote:
> > It is a good idea, I will add it to autotools-dev.
>
> Something which is less a good idea but it useful with packages
> with eon-old libtool is that one:
>
> Build-dep on libtool and do:
> printf '#!/bin/sh\nexec libtool "$$@"\n' >libtool
>
> This way the package use /usr/bin/libtool which is up-to-date.

Please don't do that.

The /usr/bin/libtool is a "patched" version, so it could be used for
things not having it's own libtool, but it's not really recommended.
Please use the version as generated by configure instead.

I've even considered not putting that file in the package at all, and
might remove it in the future.


Kurt


--
To UNSUBSCRIBE, email to debian-policy-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Mike Hommey
External


Since: Nov 09, 2004
Posts: 966



PostPosted: Fri Oct 06, 2006 7:50 am    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, Oct 05, 2006 at 12:28:11PM -0700, Russ Allbery <rra RemoveThis @debian.org> wrote:
> Mike Hommey <mh RemoveThis @glandium.org> writes:
> > Bill Allombert <allomber RemoveThis @math.u-bordeaux.fr> wrote:
>
> >> \usepackage[shameless]{plug}
> >> \begin{plug}
> >> I have proposed a (IMVHO) better solution to the
> >> config.sub/config.guess problem see
> >> <http://lists.debian.org/debian-science/2006/03/msg00038.html>
> >> \end{plug}
>
> > Neat ! Please put that (well, rather the exec version) in the developer
> > reference !
>
> It's kind of neat, but I'm not sure it's really any better than just
> replacing config.{guess,sub} at build time and it's functionally
> equivalent. Either way you have to build-depend on autotools-dev, so it's
> a question of preference of one more patch versus two lines in
> debian/rules.

Note that these two lines in debian/rules create a quite big patch...

Mike


--
To UNSUBSCRIBE, email to debian-policy-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Russ Allbery
External


Since: Nov 17, 2005
Posts: 897



PostPosted: Fri Oct 06, 2006 7:50 am    Post subject: Re: How thorough must the clean target be? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mike Hommey <mh.TakeThisOut@glandium.org> writes:
> Russ Allbery <rra.TakeThisOut@debian.org> wrote:

>> It's kind of neat, but I'm not sure it's really any better than just
>> replacing config.{guess,sub} at build time and it's functionally
>> equivalent. Either way you have to build-depend on autotools-dev, so
>> it's a question of preference of one more patch versus two lines in
>> debian/rules.

> Note that these two lines in debian/rules create a quite big patch...

The whole point of doing it in debian/rules is that it *doesn't* create a
big patch, at least the way that I do it (which is in the build target
before running configure).

I really don't like the practice of doing this in the clean target. That
behaves very badly for the way that I maintain Debian packages, since it
means I'd be regularly releasing something different from what's checked
into the VCS. Doing it optionally depending on the existence of a file
adds non-deterministic build behavior as a bonus.

I can understand the feeling of the people who like to just take care of
all the Autotools stuff and leave a big patch, but it's a *really* big
patch and I like to be able to read through the Debian patch using
filterdiff -x '*/debian/*' and make sure I understand everything that's
changed (or, for most of my packages, make sure that there's nothing left,
since I use quilt). I'd rather notice and fix build problems related to
newer versions of the Autotools.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-policy-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Policy All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum