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

Outdated GNU config (config.{sub,guess}) and autotools-dev



Henrique de Moraes Holschuh <hmh@debian.org>:
> The config.guess and config.sub files, used by autoconf- and automake-
> generated scripts, need to be constantly updated to address new
> architectures.  Unfortunately, Debian's automake package has failed to
> provide such timely updates regularly, and even if it did, most developers
> are not even aware of the need for such updates.  Their upstream often
> isn't, either.

Both upstream developers and Debian developers need to be educated,
then. Educating Debian developers by adding text to the developer
documentation and filing bugs works reasonably well. Adding a check to
lintian would be a good idea as well, if it can be done in a reasonable
manner.

> By inserting some code in the debian/rules file (the clean target is the
> best place for this, as it guarantees the updated files will make it to the
> source package when dpkg-buildpackage is run), the whole process can be
> safely automated: The config.guess and config.sub files will be updated at
> every build, then.

This also perverts the meaning of the clean target: it no longer merely
removes files built by running make, but actively changes the source code.
In a word, it is a kludge. Making kludges tends to backfire sooner or
later, so a cleaner approach is better. In my humble opinion, making
sure the debian developers know about and deal with this issue is a
cleaner approach than having autobuilders magically change source packags.

> The dh_autotools functionality is very easy to emulate. Just add:
> 	-test -r /usr/share/misc/config.sub && \
> 	   cp -f /usr/share/misc/config.sub config.sub
> 	-test -r /usr/share/misc/config.guess && \
> 	   cp -f /usr/share/misc/config.guess config.guess
> to the clean target of debian/rules.

Using the "-" directive to make is almost always a bad idea, as it tends
to cause make to ignore surprising errors. For example, in this particular
case, if the source directory happens to be mounted read-only, make will
not stop, even if the cp command fails. This is not a particularly fatal
error, but it is still not what should be happening. Writing those
shell commands in the following pattern is a better idea:

    if [ -r /usr/share/misc/config.sub ]
    then
    	cp /usr/share/misc/config.sub config.sub
    fi

With this code, if the cp fails, then make will stop, as it should.

Of course, blindly copying files from /usr/share/misc is wrong. They
should only be copied if they're newer. You provided a makefile snippet
to do that, which is intricate enough that it is likely to have a bug.
It would therefore be better to only have debian/rules call a program
(preferably in autotools-dev) that updates them. Having that code in
hundreds of debian/rules files is likely to be as unpleasant to get
updated as the config.{sub,guess} files are right now.

> (do not forget the build-depends!.  Also, the above script will FAIL if the
> config.sub in the package is so old it doesn't support -t. Do the first
> upgrade by hand :P).

And here I thought the interface to those files was set in stone by
their developers...

> The "it is not wise to do such things automatically" topic has been brought
> up and beaten back, btw. 

FWIW, the last time I participated in this discussion, I stopped because
I got more urgent worries. I don't concede that the "it's ok to clobber
source directories in random ways" school of thought has won the argument.

-- 
Lars Wirzenius <liw@iki.fi>



Reply to: