GNU bug report logs -
#7671
Presetting various *CLEANFILES variables
Previous Next
To reply to this bug, email your comments to 7671 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7671
; Package
automake
.
(Sat, 18 Dec 2010 00:50:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Behdad Esfahbod <behdad <at> behdad.org>
:
New bug report received and forwarded. Copy sent to
bug-automake <at> gnu.org
.
(Sat, 18 Dec 2010 00:50:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
Currently, automake doesn't set any of the various *CLEANFILES variables.
Since the "+=" syntax is not portable when the variables are not initialized
(and causes an automake warning), this leaves no option for Makefile.am
snippets from various tools other than using the *clean-local targets to do
their cleanups. The problem with this is that it's imperative as opposed to
declarative.
I've been maintaining a pieces of Makefile.am snippet called git.mk:
http://git.gnome.org/browse/pango/tree/git.mk
What it does is to generate .gitignore files based on what "make
maintainer-clean" removes. However, because of the problem stated above, I
cannot simply aggregate the various *CLEANFILES variables and also have to add
support for individual tools (autoconf, automake, libtool, gtk-doc,
gnome-doc-utils, mallard, intltool, and gsettings so far).
If instead automake was changed to always pre-initialize *CLEANFILES
variables, all snippets could just append to do variables and my git.mk
snippet would be more generic and much more simpler at the same time.
So I want to suggest that automake be changed to initialized *CLEANFILES if
the Makefile.am doesn't initialize them explicitly.
In another note, if that change is made and my git.mk simplified to not have
tool-specific logic in it, it would be a great addition to automake itself.
Cheers,
behdad
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7671
; Package
automake
.
(Sat, 18 Dec 2010 09:57:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 7671 <at> debbugs.gnu.org (full text, mbox):
On Saturday 18 December 2010, Behdad Esfahbod wrote:
> Hi,
>
Hello Behdad.
> Currently, automake doesn't set any of the various *CLEANFILES variables.
> Since the "+=" syntax is not portable when the variables are not initialized
> (and causes an automake warning), this leaves no option for Makefile.am
> snippets from various tools other than using the *clean-local targets to do
> their cleanups. The problem with this is that it's imperative as opposed to
> declarative.
>
I agree this might be quite annoying sometimes.
> I've been maintaining a pieces of Makefile.am snippet called git.mk:
>
> http://git.gnome.org/browse/pango/tree/git.mk
>
> What it does is to generate .gitignore files based on what "make
> maintainer-clean" removes. However, because of the problem stated above,
> I cannot simply aggregate the various *CLEANFILES variables and also have
> to add support for individual tools (autoconf, automake, libtool, gtk-doc,
> gnome-doc-utils, mallard, intltool, and gsettings so far).
>
Note that the *CLEANFILES variables cannot be used to remove directories,
so, for your approach to be really useful in all cases (i.e. also be able
to git-ignore generated directories easily), a similar set of *CLEANDIRS
variables would be needed.
And IMHO adding them would be a good idea regardless of your particular
use case.
> If instead automake was changed to always pre-initialize *CLEANFILES
> variables, all snippets could just append to do variables and my git.mk
> snippet would be more generic and much more simpler at the same time.
> So I want to suggest that automake be changed to initialized *CLEANFILES
> if the Makefile.am doesn't initialize them explicitly.
>
If the change you propose can be implemented without breaking backward
compatibility (and I think it probably can), then I'm all in favor of it.
I'd like to hear Ralf's opinion on this before taking any further
action, though.
> In another note, if that change is made and my git.mk simplified to not have
> tool-specific logic in it, it would be a great addition to automake itself.
>
> Cheers,
> behdad
>
Thanks,
Stefano
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7671
; Package
automake
.
(Sun, 19 Dec 2010 09:46:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 7671 <at> debbugs.gnu.org (full text, mbox):
Hi Stefano,
Thanks for the prompt reply.
On 12/18/10 05:02, Stefano Lattarini wrote:
> Note that the *CLEANFILES variables cannot be used to remove directories,
> so, for your approach to be really useful in all cases (i.e. also be able
> to git-ignore generated directories easily), a similar set of *CLEANDIRS
> variables would be needed.
Good point. I didn't think about that.
> And IMHO adding them would be a good idea regardless of your particular
> use case.
Agreed.
>> If instead automake was changed to always pre-initialize *CLEANFILES
>> variables, all snippets could just append to do variables and my git.mk
>> snippet would be more generic and much more simpler at the same time.
>> So I want to suggest that automake be changed to initialized *CLEANFILES
>> if the Makefile.am doesn't initialize them explicitly.
>>
> If the change you propose can be implemented without breaking backward
> compatibility (and I think it probably can), then I'm all in favor of it.
>
> I'd like to hear Ralf's opinion on this before taking any further
> action, though.
Indeed.
Cheers,
behdad
>> In another note, if that change is made and my git.mk simplified to not have
>> tool-specific logic in it, it would be a great addition to automake itself.
>>
>> Cheers,
>> behdad
>>
>
> Thanks,
> Stefano
>
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7671
; Package
automake
.
(Sun, 19 Dec 2010 11:38:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 7671 <at> debbugs.gnu.org (full text, mbox):
Hello Behdad, and thanks for the bug report,
* Behdad Esfahbod wrote on Sat, Dec 18, 2010 at 01:55:22AM CET:
> If instead automake was changed to always pre-initialize *CLEANFILES
> variables, all snippets could just append to do variables and my git.mk
> snippet would be more generic and much more simpler at the same time.
What you can do now is either
- require your users to pre-initialize variables, or
- ship a header fragment to be included first, that sets the needed
variables.
Your proposed change would break typo detection, if we allowed += for
all unset variables. The question is whether typo detection is worth
it. If we only do it for *CLEANFILES variables, that would be very
inconsistent. Users have the same problems with lots of other variables
(EXTRA_DIST, SUFFIXES, SUBDIRS, etc, the list is not stable; see for
example gnulib/gnulib-tool for others). They would not be helped, while
at the same time Automake semantics becomes harder to grasp.
There are more subtle issues with conditionals and with variables that
are already set by automake or that are AC_SUBSTed from configure.ac; in
fact, most of all the uniqe/once-only/override warning machinery is to
disallow ambiguities in these cases.
For example, automake sets DIST_COMMON, an internal variable. Assume
the user writes
DIST_COMMON += foo
Should that add to the automake-given list? I would guess so. But what
about the following (assuming AC_SUBST([substed])):
foo = foo
if COND1
foo = bar
substed = bar
DIST_COMMON = bar
else
foo += baz
substed += baz
DIST_COMMON += baz
endif
The expectation again is clear, and for 'foo' things work out, but it is
not possible to realize for substed with the current implementation where
AC_SUBST([substed]) generates a single
substed = @substed@
line in Makefile.in. It might be fixable, but I haven't looked into it
and assume that at least the disjoint-condition handling may turn out
ugly.
Cheers,
Ralf
Information forwarded
to
owner <at> debbugs.gnu.org, bug-automake <at> gnu.org
:
bug#7671
; Package
automake
.
(Mon, 20 Dec 2010 20:47:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 7671 <at> debbugs.gnu.org (full text, mbox):
On 12/19/10 06:43, Ralf Wildenhues wrote:
> What you can do now is either
> - require your users to pre-initialize variables, or
> - ship a header fragment to be included first, that sets the needed
> variables.
Yeah, that's what we currently do in a few occasions, but I can't sell that to
others when they can remove files in *clean-local targets without such
conditions imposed on their users.
That said, your concerns are real. I let you guys decide if you want to close
this WONTFIX or address it some other way.
Cheers,
behdad
Severity set to 'wishlist' from 'normal'
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 18 Sep 2011 19:21:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 13 years and 271 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.