• dh_auto_clean, autoconf, and building packages twice (was: Potential MB

    From Magnus Holmgren@21:1/5 to All on Sun Jun 23 14:05:47 2024
    Hi,

    I'm very late to the party, but after reading the entire thread, I'd like to discuss a more specific, but perhaps not uncommon, situation with regard to cleaning and building again:

    We have a [still fairly] typical upstream package using Autotools. The tarball includes some built files (e.g. documentation), i.e. make dist builds them (as long as the right tools are installed) and make distclean deletes them. dh_auto_clean by default runs make distclean if such a target exists. But that's not the case until ./configure has been run, because until then, there are no makefiles. So The first time you run debian/rules build, the shipped version of the files will be untouched and used in the final package, but when you then clean and build again, they will be deleted and rebuilt (or the
    second build fails because of missing build dependencies).

    Besides building a package twice potentially failing, this can lead to the second build being different from the first. So I'm thinking:

    1. Do we generally want dh_auto_build to run make distclean, deleting files that we otherwise wouldn't need to build? dh_autoreconf regenerating configure and Makefile.in is another thing, I think, because those files aren't part of the final binary package, and dh_autoreconf tracks which files are changed so dh_autoreconf_clean can remove them.

    2. In my case, I think I want those files (manpages) to be rebuilt already the first time, because the configured ${sysconfdir} is injected into them. But to get them rebuilt, I either need to run make distclean and then ./configure again, or explicitly delete those specific files, neither option being completely elegant. Perhaps I'm missing some better option?

    3. But if we do want to build as much as possible from scratch, wouldn't it make some sense to run dh_auto_configure an extra time before dh_auto_clean,
    to ensure that the latter actually does something (which it otherwise
    shouldn't have to, when building freshly unpacked source)?

    --
    Magnus Holmgren holmgren@debian.org
    Debian Developer
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEzSoHOzhhVBcKQILo1PIZv+yZhIkFAmZ4D5sACgkQ1PIZv+yZ hIn2nxAAmulNB0DLnjIParyBdXSYZDe4rGkchmiBne3V9vdttfXf04u1BMP33UZj z7yhFhS+g0NCOpKk5ej+x8NTjLjGaDOfks65Tv7lkHd9KZSGSLAyPEVCgfdkbkqF YgS8potPSvARjpacfFlyR4JNOFqwhFnw25Vmtt45mXtTTciczOy4DvvHW75A/9HM 9Uqhetok680uicurqfyEpd2avXXF/gjgk4MsXbOOuR8wDou2safwY7mtX3l56pxh YnUSV4FCEqkzeUS7QUj0g73d5aFZHyHnEQmx52bbey2YOXKQpB9XHMnTw/KKKkqa D/KzPEzHXapXDggWdyliu8qfvzWMpqb2oxCVjNVVq0bW0lqZu1elZ/SER7oJq/Fd xj9nFQ7BFNMe5uicgJbXx+BdF79COsr+2kcSYAV3ZALwxCs5PQgdijC4szBdIGzh XNSr9O6EBhC+g4y0i+Yr9ygw/Ecoo9a2Y6DTttkBHcEdE8CVdSnh/hKLMOna44Q9 h+k5uVJEfB6Mwl+ZOwJCdiQCAuUHV3aSMb7BHiBfwuBITsvsVeHbFEwMn95ebGe6 8ucyHLIdZjwUChTR9Rr2y0b0pKDtRKvMAXQwlhJ/0CsY53A/rhUo+Q69Ti9CINJB yK6HIKobY5cM3Q66EzmhSDd9Jk8oDOgBaBgv5PdQXOsKzVJLNn8=
    =x/Ui
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)