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.



Yasuhiro KIMURA wrote on Fri, 29 May 2020 15:07 +0900:
> 1. cd /tmp/zsh/source
> 2. tar xfpvJ /somewhere/zsh-5.8.tar.xz
> 3. cd /tmp/zsh/build
> 4. /tmp/zsh/source/zsh-5.8/configure --srcdir=/tmp/zsh/source/zsh-5.8
> 5. make
> 6. make DESTDIR=/tmp/zsh/install install

> ----------------------------------------------------------------------
> make[1]: Entering directory '/tmp/zsh/build/Doc'
> /bin/sh /tmp/zsh/source/zsh-5.8/mkinstalldirs /tmp/zsh/install/usr/local/share/man/man1
> mkdir -m 755 -p -- /tmp/zsh/install/usr/local/share/man/man1
> for file in zsh.1 zshbuiltins.1 zshcalsys.1 zshcompctl.1 zshcompwid.1 zshcompsys.1 zshcontrib.1 zshexpn.1 zshmisc.1 zshmodules.1 zshoptions.1 zshparam.1 zshroadmap.1 zshtcpsys.1 zshzftpsys.1 zshzle.1 zshall.1; do \
>     test -s $file || exit 1; \
>     /bin/install -c -m 644 $file /tmp/zsh/install/usr/local/share/man/man1/`echo $file | sed 's|zsh|zsh|'` || exit 1; \done
> make[1]: *** [Makefile:474: install.man] Error 1
> make[1]: Leaving directory '/tmp/zsh/build/Doc'
> make: *** [Makefile:222: install.man] Error 2

I can reproduce this.

I added «set -x» to Doc/Makefile [sic] in front of the loop.  It
fails on «test -s zsh.1».

> But if I checked out source tree from git repository such problem
> doesn't happen.

Good catch.

> Why such difference happens? And how it is fixed?

In git builds the manual pages are generated in the build directory.
I made it work this way a few years ago (workers/43692, commit
zsh-5.6.2-54-g76a16498d) on the principle that the source directory
should never be written to by out-of-tree builds.  (That fix only was a
step in the right direction, rather than a complete fix.  «make» still
puts some files in the source directory.)

In contrast, in tarball builds pre-build manual pages are shipped in the
tarball, so they'll be found in the source directory (/tmp/zsh/source/Doc/*.1)
rather than the build directory (/tmp/zsh/build/Doc/*.1).  I suppose
we don't require yodl for tarball builds.

In Doc/Makefile rule there is ".yo.1" suffix rule that's supposed to
generate man pages.  In tarball out-of-tree builds, the commands of that
rule don't run because neither the target file nor any of its dependencies
exist.  I'm appending the relevant part of make(1) debug output for
reference.

I would prefer to fix this by making tarball builds copy the *.1 files
from the source directory («$(sdir)» in Doc/Makefile) to the build
directory.  This would minimize the difference: tarball builds would
compile the man pages using yodl and git builds would copy the
pregenerated ones.  The following patch does this.

[[[
diff --git a/configure.ac b/configure.ac
index e78ebf86b..c72fe72b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3178,6 +3178,13 @@ AC_CONFIG_COMMANDS([stamp-h], [echo >stamp-h])
 
 AC_OUTPUT
 
+dnl Copy pre-built man pages, for tarball out-of-tree builds.
+for manpage in ${srcdir}/Doc/*.1; do
+  if test x"$manpage" != x*"*"*; then
+    cp ${manpage} ./Doc/
+  fi
+done
+
 eval "zshbin1=${bindir}"
 eval "zshbin2=${zshbin1}"
 eval "zshman1=${mandir}"
]]]

If you could test it (by applying it to «configure»), that'd be great.

Thanks for the bug report and for pinpointing the problem!

Daniel



[[[
% make -dC Doc
    Considering target file 'zsh.1'.
     Looking for an implicit rule for 'zsh.1'.
     Trying pattern rule with stem 'zsh'.
     Trying implicit prerequisite 'zsh.yo'.
     Found an implicit rule for 'zsh.1'.
      Considering target file 'zsh.yo'.
       Looking for an implicit rule for 'zsh.yo'.
       Trying pattern rule with stem 'zsh.yo'.
       Trying implicit prerequisite 'zsh.yo,v'.
       Trying pattern rule with stem 'zsh.yo'.
       Trying implicit prerequisite 'RCS/zsh.yo,v'.
       Trying pattern rule with stem 'zsh.yo'.
       Trying implicit prerequisite 'RCS/zsh.yo'.
       Trying pattern rule with stem 'zsh.yo'.
       Trying implicit prerequisite 's.zsh.yo'.
       Trying pattern rule with stem 'zsh.yo'.
       Trying implicit prerequisite 'SCCS/s.zsh.yo'.
       No implicit rule found for 'zsh.yo'.
       Finished prerequisites of target file 'zsh.yo'.
      No need to remake target 'zsh.yo'; using VPATH name '../../tarball/Doc/zsh.yo'.
      Considering target file 'version.yo'.
        Considering target file '../../tarball/Config/version.mk'.
         Looking for an implicit rule for '../../tarball/Config/version.mk'.
         Trying pattern rule with stem 'version.mk'.
         Trying implicit prerequisite '../../tarball/Config/version.mk,v'.
         Trying pattern rule with stem 'version.mk'.
         Trying implicit prerequisite '../../tarball/Config/RCS/version.mk,v'.
         Trying pattern rule with stem 'version.mk'.
         Trying implicit prerequisite '../../tarball/Config/RCS/version.mk'.
         Trying pattern rule with stem 'version.mk'.
         Trying implicit prerequisite '../../tarball/Config/s.version.mk'.
         Trying pattern rule with stem 'version.mk'.
         Trying implicit prerequisite '../../tarball/Config/SCCS/s.version.mk'.
         No implicit rule found for '../../tarball/Config/version.mk'.
         Finished prerequisites of target file '../../tarball/Config/version.mk'.
        No need to remake target '../../tarball/Config/version.mk'.
       Finished prerequisites of target file 'version.yo'.
       Prerequisite '../../tarball/Config/version.mk' is older than target 'version.yo'.
      No need to remake target 'version.yo'; using VPATH name '../../tarball/Doc/version.yo'.
      Considering target file 'zmacros.yo'.
       Looking for an implicit rule for 'zmacros.yo'.
       Trying pattern rule with stem 'zmacros.yo'.
       Trying implicit prerequisite 'zmacros.yo,v'.
       Trying pattern rule with stem 'zmacros.yo'.
       Trying implicit prerequisite 'RCS/zmacros.yo,v'.
       Trying pattern rule with stem 'zmacros.yo'.
       Trying implicit prerequisite 'RCS/zmacros.yo'.
       Trying pattern rule with stem 'zmacros.yo'.
       Trying implicit prerequisite 's.zmacros.yo'.
       Trying pattern rule with stem 'zmacros.yo'.
       Trying implicit prerequisite 'SCCS/s.zmacros.yo'.
       No implicit rule found for 'zmacros.yo'.
       Finished prerequisites of target file 'zmacros.yo'.
      No need to remake target 'zmacros.yo'; using VPATH name '../../tarball/Doc/zmacros.yo'.
      Considering target file 'zman.yo'.
       Looking for an implicit rule for 'zman.yo'.
       Trying pattern rule with stem 'zman.yo'.
       Trying implicit prerequisite 'zman.yo,v'.
       Trying pattern rule with stem 'zman.yo'.
       Trying implicit prerequisite 'RCS/zman.yo,v'.
       Trying pattern rule with stem 'zman.yo'.
       Trying implicit prerequisite 'RCS/zman.yo'.
       Trying pattern rule with stem 'zman.yo'.
       Trying implicit prerequisite 's.zman.yo'.
       Trying pattern rule with stem 'zman.yo'.
       Trying implicit prerequisite 'SCCS/s.zman.yo'.
       No implicit rule found for 'zman.yo'.
       Finished prerequisites of target file 'zman.yo'.
      No need to remake target 'zman.yo'; using VPATH name '../../tarball/Doc/zman.yo'.
      Considering target file 'Zsh/intro.yo'.
       Looking for an implicit rule for 'Zsh/intro.yo'.
       Trying pattern rule with stem 'intro.yo'.
       Trying implicit prerequisite 'Zsh/intro.yo,v'.
       Trying pattern rule with stem 'intro.yo'.
       Trying implicit prerequisite 'Zsh/RCS/intro.yo,v'.
       Trying pattern rule with stem 'intro.yo'.
       Trying implicit prerequisite 'Zsh/RCS/intro.yo'.
       Trying pattern rule with stem 'intro.yo'.
       Trying implicit prerequisite 'Zsh/s.intro.yo'.
       Trying pattern rule with stem 'intro.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.intro.yo'.
       No implicit rule found for 'Zsh/intro.yo'.
       Finished prerequisites of target file 'Zsh/intro.yo'.
      No need to remake target 'Zsh/intro.yo'; using VPATH name '../../tarball/Doc/Zsh/intro.yo'.
      Considering target file 'Zsh/metafaq.yo'.
       Looking for an implicit rule for 'Zsh/metafaq.yo'.
       Trying pattern rule with stem 'metafaq.yo'.
       Trying implicit prerequisite 'Zsh/metafaq.yo,v'.
       Trying pattern rule with stem 'metafaq.yo'.
       Trying implicit prerequisite 'Zsh/RCS/metafaq.yo,v'.
       Trying pattern rule with stem 'metafaq.yo'.
       Trying implicit prerequisite 'Zsh/RCS/metafaq.yo'.
       Trying pattern rule with stem 'metafaq.yo'.
       Trying implicit prerequisite 'Zsh/s.metafaq.yo'.
       Trying pattern rule with stem 'metafaq.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.metafaq.yo'.
       No implicit rule found for 'Zsh/metafaq.yo'.
       Finished prerequisites of target file 'Zsh/metafaq.yo'.
      No need to remake target 'Zsh/metafaq.yo'; using VPATH name '../../tarball/Doc/Zsh/metafaq.yo'.
      Considering target file 'Zsh/invoke.yo'.
       Looking for an implicit rule for 'Zsh/invoke.yo'.
       Trying pattern rule with stem 'invoke.yo'.
       Trying implicit prerequisite 'Zsh/invoke.yo,v'.
       Trying pattern rule with stem 'invoke.yo'.
       Trying implicit prerequisite 'Zsh/RCS/invoke.yo,v'.
       Trying pattern rule with stem 'invoke.yo'.
       Trying implicit prerequisite 'Zsh/RCS/invoke.yo'.
       Trying pattern rule with stem 'invoke.yo'.
       Trying implicit prerequisite 'Zsh/s.invoke.yo'.
       Trying pattern rule with stem 'invoke.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.invoke.yo'.
       No implicit rule found for 'Zsh/invoke.yo'.
       Finished prerequisites of target file 'Zsh/invoke.yo'.
      No need to remake target 'Zsh/invoke.yo'; using VPATH name '../../tarball/Doc/Zsh/invoke.yo'.
      Considering target file 'Zsh/files.yo'.
       Looking for an implicit rule for 'Zsh/files.yo'.
       Trying pattern rule with stem 'files.yo'.
       Trying implicit prerequisite 'Zsh/files.yo,v'.
       Trying pattern rule with stem 'files.yo'.
       Trying implicit prerequisite 'Zsh/RCS/files.yo,v'.
       Trying pattern rule with stem 'files.yo'.
       Trying implicit prerequisite 'Zsh/RCS/files.yo'.
       Trying pattern rule with stem 'files.yo'.
       Trying implicit prerequisite 'Zsh/s.files.yo'.
       Trying pattern rule with stem 'files.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.files.yo'.
       No implicit rule found for 'Zsh/files.yo'.
       Finished prerequisites of target file 'Zsh/files.yo'.
      No need to remake target 'Zsh/files.yo'; using VPATH name '../../tarball/Doc/Zsh/files.yo'.
      Considering target file 'Zsh/filelist.yo'.
       Looking for an implicit rule for 'Zsh/filelist.yo'.
       Trying pattern rule with stem 'filelist.yo'.
       Trying implicit prerequisite 'Zsh/filelist.yo,v'.
       Trying pattern rule with stem 'filelist.yo'.
       Trying implicit prerequisite 'Zsh/RCS/filelist.yo,v'.
       Trying pattern rule with stem 'filelist.yo'.
       Trying implicit prerequisite 'Zsh/RCS/filelist.yo'.
       Trying pattern rule with stem 'filelist.yo'.
       Trying implicit prerequisite 'Zsh/s.filelist.yo'.
       Trying pattern rule with stem 'filelist.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.filelist.yo'.
       No implicit rule found for 'Zsh/filelist.yo'.
       Finished prerequisites of target file 'Zsh/filelist.yo'.
      No need to remake target 'Zsh/filelist.yo'; using VPATH name '../../tarball/Doc/Zsh/filelist.yo'.
      Pruning file '../../tarball/Doc/Zsh/filelist.yo'.
      Considering target file 'Zsh/seealso.yo'.
       Looking for an implicit rule for 'Zsh/seealso.yo'.
       Trying pattern rule with stem 'seealso.yo'.
       Trying implicit prerequisite 'Zsh/seealso.yo,v'.
       Trying pattern rule with stem 'seealso.yo'.
       Trying implicit prerequisite 'Zsh/RCS/seealso.yo,v'.
       Trying pattern rule with stem 'seealso.yo'.
       Trying implicit prerequisite 'Zsh/RCS/seealso.yo'.
       Trying pattern rule with stem 'seealso.yo'.
       Trying implicit prerequisite 'Zsh/s.seealso.yo'.
       Trying pattern rule with stem 'seealso.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.seealso.yo'.
       No implicit rule found for 'Zsh/seealso.yo'.
       Finished prerequisites of target file 'Zsh/seealso.yo'.
      No need to remake target 'Zsh/seealso.yo'; using VPATH name '../../tarball/Doc/Zsh/seealso.yo'.
      Considering target file 'Zsh/compat.yo'.
       Looking for an implicit rule for 'Zsh/compat.yo'.
       Trying pattern rule with stem 'compat.yo'.
       Trying implicit prerequisite 'Zsh/compat.yo,v'.
       Trying pattern rule with stem 'compat.yo'.
       Trying implicit prerequisite 'Zsh/RCS/compat.yo,v'.
       Trying pattern rule with stem 'compat.yo'.
       Trying implicit prerequisite 'Zsh/RCS/compat.yo'.
       Trying pattern rule with stem 'compat.yo'.
       Trying implicit prerequisite 'Zsh/s.compat.yo'.
       Trying pattern rule with stem 'compat.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.compat.yo'.
       No implicit rule found for 'Zsh/compat.yo'.
       Finished prerequisites of target file 'Zsh/compat.yo'.
      No need to remake target 'Zsh/compat.yo'; using VPATH name '../../tarball/Doc/Zsh/compat.yo'.
      Considering target file 'Zsh/restricted.yo'.
       Looking for an implicit rule for 'Zsh/restricted.yo'.
       Trying pattern rule with stem 'restricted.yo'.
       Trying implicit prerequisite 'Zsh/restricted.yo,v'.
       Trying pattern rule with stem 'restricted.yo'.
       Trying implicit prerequisite 'Zsh/RCS/restricted.yo,v'.
       Trying pattern rule with stem 'restricted.yo'.
       Trying implicit prerequisite 'Zsh/RCS/restricted.yo'.
       Trying pattern rule with stem 'restricted.yo'.
       Trying implicit prerequisite 'Zsh/s.restricted.yo'.
       Trying pattern rule with stem 'restricted.yo'.
       Trying implicit prerequisite 'Zsh/SCCS/s.restricted.yo'.
       No implicit rule found for 'Zsh/restricted.yo'.
       Finished prerequisites of target file 'Zsh/restricted.yo'.
      No need to remake target 'Zsh/restricted.yo'; using VPATH name '../../tarball/Doc/Zsh/restricted.yo'.
     Finished prerequisites of target file 'zsh.1'.
     Prerequisite '../../tarball/Doc/zsh.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/version.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/zmacros.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/zman.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/intro.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/metafaq.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/invoke.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/files.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/filelist.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/filelist.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/seealso.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/compat.yo' is older than target 'zsh.1'.
     Prerequisite '../../tarball/Doc/Zsh/restricted.yo' is older than target 'zsh.1'.
    No need to remake target 'zsh.1'.
]]]



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