git-for-windows/git-sdk-32

asciidoctor missing while building mingw-w64-git

dennisameling opened this issue ยท 3 comments

Steps to reproduce:

  • Install Git for Windows SDK 32
  • Open Git SDK Bash
  • git cd MINGW-packages
  • cd mingw-w64-git
  • MINGW_INSTALLS=mingw32 makepkg-mingw -sLf

You'll most likely run into the following error:

ASCIIDOC howto-index.html
/bin/sh: asciidoctor: command not found
make[1]: *** [Makefile:435: howto-index.html] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2571: html] Error 2
make: *** Waiting for unfinished jobs....
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:365: git-add.xml] Error 127
make[1]: *** Waiting for unfinished jobs....
    ASCIIDOC git-am.xml
/bin/sh: line 1: asciidoctor: command not found
make[1]: *** [Makefile:365: git-am.xml] Error 127
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'
make: *** [Makefile:2566: man] Error 2
Could not build (tried 5 times)

Then run pacman -S mingw-w64-i686-asciidoctor to install asciidoctor.

It will very likely still fail with:

XSLTPROC user-manual.html
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"
compilation error: file docbook.xsl line 3 element import
xsl:import : unable to load http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
make[1]: *** [Makefile:393: user-manual.html] Error 5
make[1]: Leaving directory '/usr/src/MINGW-packages/mingw-w64-git/src/git/Documentation'

I had this same issue back in December, then spent a lot of time then trying to get it to work, figured it out in the end, but forgot how I fixed it ๐Ÿ˜…

dscho commented

That's a funny quirk in our setup: MINGW packages -- even the 32-bit ones -- are built in the 64-bit SDK.

XSLTPROC user-manual.html
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"
compilation error: file docbook.xsl line 3 element import
xsl:import : unable to load http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl

Right, we need docbook-xsl-ns, and that's not available in MSYS2 (at least it wasn't when I looked back in the days). We're using a workaround: https://github.com/git-for-windows/build-extra/blob/5c16f456c85f5bcff853fe461e25dbe8eb35203f/please.sh#L4632-L4640

dscho commented

BTW there is absolutely no need to build the entire package to reproduce the issue. Just build the Git wrapper:

make -C src/git -f ../mingw-w64-git.mak git-wrapper.exe

You can then replace, say, cmd/git.exe with that built git-wrapper.exe to reproduce the issue (and to debug).

dscho commented
make -C src/git -f ../mingw-w64-git.mak git-wrapper.exe

Darn. I forgot one important thing: if you want to build it this way, make sure to copy git-wrapper.c to src/ whenever you modify it, as the make command will pick up the copy. In fact, what I often do is something like this:

cp git-wrapper.c src/ && make -C src/git -f ../mingw-w64-git.mak git-wrapper.exe && cp src/git/git-wrapper.exe /path/to/portable/git/bin/git.exe && /path/to/portable/git/bin/git.exe version