Hi all,

I want to ask you for urgent code review for this problem:
6807294 Wrong perl is used for smime_keys and smime_keys_test.pl scripts in 
SUNWmutt

The change is simple. Just one line moved from `make install` to `configure`:
http://cr.opensolaris.org/~aragorn/6807294/


Problem description:
====================

Mike Sullivan pointed out the following problem in the current mutt integration:

 *** /usr/bin/smime_keys (SUNWmutt) is a perl script, but uses
     /usr/bin/perl instead of /usr/perl5/bin/perl as recommended by ON Perl
     Style Guidelines.
 *** /usr/share/doc/mutt/samples/smime_keys_test.pl (SUNWmutt) is a perl
     script, but uses /usr/bin/perl instead of /usr/perl5/bin/perl as
     recommended by ON Perl Style Guidelines.
check-deps.pl: ERROR: TOTAL: 2 errors of type PerlPath


Evaluation and solution:
========================

The proximate root cause of the problem could be considered missing
MAKEFLAGS=-e from the environment. But the problem is born from several small
issues across the mutt integration:

During upgrade of mutt to version 1.5.19 (see CR 6787900) the "env -" was added
to all configure and make calls in Makefile.sfw. The change was made according
to the "Package writing guidelines" available at
<http://wikis.sun.com/display/SFWNotes/Package+writing+guidelines>. This caused
that the environment variables are cleared for configure and make commands
including MAKEFLAGS=-e.

According to the Makefile.sfw, only the internal INSTALL macro is set (for the
install target). With MAKEFLAGS=-e the INSTALL was propagated to environment of
subsequent make calls. Now, because we do not have MAKEFLAGS=-e, the INSTALL is
not propagated.

For mutt builds we use /usr/ccs/bin/make. This make variant is by default not
POSIX compliant. This means that MAKEFLAGS does not contain macro assignments,
thus the INSTALL macro is not passed down to the subsequent make invocations.
Usage of POSIX compliant make would hide the problem too.

Note: The /usr/ccs/bin/make could by changed to be POSIX compliant using
special .POSIX: target, but this target is not included in mutt's Makefile.

Finally, because the configure is called without the INSTALL variable set, it
found first available install command. In our case it is /bin/ginstall. Without
the "env -" the configure found /opt/onbld/bin/i386/install. This was incorrect
too.

As a consequence, all subsequent make calls under `make install` are using
/bin/ginstall, instead of correct $(INSTALL_PROTO).

Note: $(INSTALL_PROTO) is responsible for post processing of various file
types, including perl scripts. On the other hand, /bin/ginstall is not able to
do such (required) postprocessing.


Several possible solutions:
1. Use gmake instead of make (it is POSIX compliant by default, at least its
MAKEFLAGS behaviour).
2. Add .POSIX: target into mutt's Makefile.
3. Make sure the correct install is found by configure.
4. Set environment variable MAKEFLAGS to -e for the install target.

I believe the main problem is that configure is not able to find the correct
install command. We should enforce the configure to find $(INSTALL_PROTO)
instead of /bin/ginstall. This is the right solution, because the configure
will be aware about the correct install program from beginning, it will enforce
the correct install command usage for every make calls. All other possible
solutions are only workarounds for the main problem.

Note: The main problem is here since first mutt integration but was overriden
by `MAKEFLAGS=-e make install INSTALL=....` implicit workaround.



Thank you.

-- 
Marcel Telka
Solaris RPE

Reply via email to