Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: 'make install' fails when build directory is differnet from that of source tree.



From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
Subject: Re: 'make install' fails when build directory is differnet from that of source tree.
Date: Sun, 31 May 2020 01:57:39 +0000

> Thanks for the report.
> 
> This looks like another effect of the same series of Doc/Makefile.in commits:
> 
>     76a16498d 43692: Generate man pages in the build dir, rather than the source dir.
>     b2ddd9717 43404 (after 43392): Fix 'make install' in out-of-tree builds
>     85ae84e89 43392: dist: Generate doc/help/* and doc/help.txt in builddir rather than srcdir.
> 
> For me, the patch I just posted (the second revision, from today) fixes
> this issue as well.  I also confirmed that `cd $DESTDIR/$prefix/share/zsh/5.8/help && find`
> and `cd /usr/share/zsh/help && find` [the latter being my distro's
> build] produce identical outputs.
> 
> Do let us know if anything else seems amiss.

I applied new patch to tarball source with following step.

1. cd /tmp/zsh/source
2. tar xfpvJ /somewhere/zsh-5.8.tar.xz
3. cd zsh-5.8
4. ./Util/preconfig

And tried both in-tree and out-of-tree build. Then 'make
install.runhelp' succeeded with both cases. But there are difference
about output of 'make instlal.runhelp'.

in-tree build produced following output.

----------------------------------------------------------------------
yasu@rolling-vm-debian2[2167]% make DESTDIR=/tmp/zsh/install install.runhelp
make[1]: Entering directory '/tmp/zsh/source/zsh-5.8/Doc'
if test x"/usr/local/share/zsh/5.8/help" != x""; then \
    /bin/sh ../mkinstalldirs /tmp/zsh/install/usr/local/share/zsh/5.8/help; \
    /bin/install -c -m 644 help/* /tmp/zsh/install/usr/local/share/zsh/5.8/help; \
    while read from to; do \
        rm -f /tmp/zsh/install/usr/local/share/zsh/5.8/help/$to || : ; \
        ln -s $from /tmp/zsh/install/usr/local/share/zsh/5.8/help/$to; \
    done < help.txt; \
fi
mkdir -m 755 -p -- /tmp/zsh/install/usr/local/share/zsh/5.8/help
make[1]: Leaving directory '/tmp/zsh/source/zsh-5.8/Doc'
yasu@rolling-vm-debian2[2168]%
----------------------------------------------------------------------

And out-of-tree build produced following output.

----------------------------------------------------------------------
yasu@rolling-vm-debian2[2161]% make DESTDIR=/tmp/zsh/install install.runhelp
make[1]: Entering directory '/tmp/zsh/build/Doc'
perl /tmp/zsh/source/zsh-5.8/Util/helpfiles \
    zshbuiltins.1 help help.txt \
    || rm -f help.txt help/*
helpfiles: attempting man zshbuiltins.1 >help/man.tmp
helpfiles: attempting col -bx <help/man.tmp >help/col.tmp
if test x"/usr/local/share/zsh/5.8/help" != x""; then \
    /bin/sh /tmp/zsh/source/zsh-5.8/mkinstalldirs /tmp/zsh/install/usr/local/share/zsh/5.8/help; \
    /bin/install -c -m 644 help/* /tmp/zsh/install/usr/local/share/zsh/5.8/help; \
    while read from to; do \
        rm -f /tmp/zsh/install/usr/local/share/zsh/5.8/help/$to || : ; \
        ln -s $from /tmp/zsh/install/usr/local/share/zsh/5.8/help/$to; \
    done < help.txt; \
fi
mkdir -m 755 -p -- /tmp/zsh/install/usr/local/share/zsh/5.8/help
make[1]: Leaving directory '/tmp/zsh/build/Doc'
yasu@rolling-vm-debian2[2162]%
----------------------------------------------------------------------

I you compare these outputs, there are following extra output in the
later.

----------------------------------------------------------------------
perl /tmp/zsh/source/zsh-5.8/Util/helpfiles \
    zshbuiltins.1 help help.txt \
    || rm -f help.txt help/*
----------------------------------------------------------------------

This means that on out-of-source build help files are generated before
installing them and that out-of-source build has extra dependency on
perl which isn't necessary on in-tree build.

Usually it doesn't matter since perl is included in normal install of
most Unix-like OSes. But, for example, FreeBSD doesn't include perl in
its base system and user sepalately needs to install it by using
FreeBSD ports/packages collection if he want to use it. So if you make
out-of-source build with tarball source on base system only FreeBSD
environment, then 'make install.runhelp' will fail with same error as
previously reported.

Actually I created tarball source that the patch is applied with above
steps, made base sytem only install of FreeBSD 12.1-RELEASE amd64,
copied created source to the environment and tried out-of-tree build.
Then 'make install.runhelp' resulted in following error.

----------------------------------------------------------------------
root@rolling-vm-freebsd5:/tmp/zsh/build # make DESTDIR=/tmp/zsh/install install.runhelp
perl /tmp/zsh/source/zsh-5.8/Util/helpfiles  zshbuiltins.1 help help.txt  || rm -f help.txt help/*
/bin/sh: perl: not found
if test x"/usr/local/share/zsh/5.8/help" != x""; then  /bin/sh /tmp/zsh/source/zsh-5.8/mkinstalldirs /tmp/zsh/install/usr/local/share/zsh/5.8/help;  /usr/bin/install -c -m 644 help/* /tmp/zsh/install/usr/local/share/zsh/5.8/help;  while read from to; do  rm -f /tmp/zsh/install/usr/local/share/zsh/5.8/help/$to || : ;  ln -s $from /tmp/zsh/install/usr/local/share/zsh/5.8/help/$to;  done < help.txt;  fi
mkdir /tmp/zsh/install/usr
chmod 755 /tmp/zsh/install/usr
mkdir /tmp/zsh/install/usr/local
chmod 755 /tmp/zsh/install/usr/local
mkdir /tmp/zsh/install/usr/local/share
chmod 755 /tmp/zsh/install/usr/local/share
mkdir /tmp/zsh/install/usr/local/share/zsh
chmod 755 /tmp/zsh/install/usr/local/share/zsh
mkdir /tmp/zsh/install/usr/local/share/zsh/5.8
chmod 755 /tmp/zsh/install/usr/local/share/zsh/5.8
mkdir /tmp/zsh/install/usr/local/share/zsh/5.8/help
chmod 755 /tmp/zsh/install/usr/local/share/zsh/5.8/help
install: help/*: No such file or directory
*** Error code 71

Stop.
make[1]: stopped in /tmp/zsh/build/Doc
*** Error code 1

Stop.
make: stopped in /tmp/zsh/build
root@rolling-vm-freebsd5:/tmp/zsh/build # 
----------------------------------------------------------------------

---
Yasuhiro KIMURA



Messages sorted by: Reverse Date, Date, Thread, Author