bug-automake
[Top][All Lists]
Advanced

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

Incorrect behavior for install rule and py-compile for _PYTHON targets


From: Sander Niemeijer
Subject: Incorrect behavior for install rule and py-compile for _PYTHON targets
Date: Mon, 12 Jan 2004 21:42:17 +0100

Hi all,

I've run into the following (AFAICS incorrect) behavior:

Consider a project with a conditional python_PYTHON target.
When the conditional is false and a 'make install' is issued then the rule install-pythonPYTHON is executed with 0 files to install (i.e. the dlist variable in the install rule will be empty). In automake 1.7.9 this resulted in an error since the py-compile script did not allow 0 zero input files. In automake 1.8.0 and 1.8.1 the py-compile script does not complain anymore. The reason why it does not complain with this version is because the script does not correctly check the amount of input files it receives. When you provide only a --basedir option to py-compile (which is what happens in the install-pythonPYTHON rule) the py-compile script will happely execute and start compiling 0 files. If you would try to do the same thing without the --basedir option the py-compile script would complain and terminate with an error code.

Although the current behavior in automake 1.8.x will probably not result in any problems for users, IMHO I think it would be a good idea to make the following changes in order to evade future problems:

- change 'PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(pythondir) $$dlist' for each python install target to 'test -z "$$dlist" || PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(pythondir) $$dlist' - revert the check for the amount of files given to py-compile to the way it was done in automake 1.7.9 (i.e. using the 'if [ $# = 0 ]' check after checking for basedir/help/version flags.

This has the advantage that py-compile isn't executed at all anymore when a 'make install' is run for an excluded conditional _PYTHON target.

Regards,
Sander Niemeijer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]