3

I'm trying to compile Tor from source on the latest version of Raspbian on a Raspberry Pi Model B according to the instructions on the Tor Project website.

I started compilation with debuild -rfakeroot -uc -us and everything went swimmingly for the first half-hour of compilation with ~100% CPU usage, until this happened.

gcc  -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -fwrapv
--param ssp-buffer-size=1 -fPIE -Wall -fno-strict-aliasing  -pie -z relro -z now
 -o src/tools/tor-checkkey src/tools/tor-checkkey.o src/common/libor.a src/commo
n/libor-crypto.a src/common/libcurve25519_donna.a -lm -lz -lssl -lcrypto  -lrt -
ldl
../doc/asciidoc-helper.sh man /usr/bin/a2x ../doc/tor.1.in
a2x: ERROR: "xmllint" --nonet --noout --valid "/home/server/debian-packages/tor-
0.2.4.20/doc/tor.1.xml" returned non-zero exit status 4
==================================
You need a working asciidoc installed to be able to build the manpage.

a2x is installed, but for some reason it isn't working.  Sometimes
this happens because required docbook support files are missing.
Please install docbook-xsl, docbook-xml, and xmlto (Debian) or
similar. If you use homebrew on Mac OS X, install the docbook formula
and add "export XML_CATALOG_FILES=/usr/local/etc/xml/catalog" to your
.bashrc

Alternatively, to build without manpages, use the --disable-asciidoc
argument when calling configure.
==================================
make[2]: *** [doc/tor.1.in] Error 1
make[2]: Leaving directory `/home/server/debian-packages/tor-0.2.4.20/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/server/debian-packages/tor-0.2.4.20/build'
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -D -us -uc failed

I checked that I had asciibook, docbook-xsl, docbook-xml, and xmlto installed and ran it again, with the exact same results. Does anyone know what might be causing this? Has anyone ran into this before?

Alex Ryan
  • 191
  • 6

2 Answers2

3

The error message says:

Alternatively, to build without manpages, use the --disable-asciidoc argument when calling configure.

When you use debuild you can't just enter configure --disable-asciidoc. You'll have to edit the file debian/rules. On line 22 of the file there is a section which deals with configure options:

override_dh_auto_configure:
    ! [ -e debian/micro-revision.i ] || cp debian/micro-revision.i src/or/micro-revision.i
    dh_auto_configure -- \
        $(confflags) \
        --prefix=/usr \
        --mandir=\$${prefix}/share/man \
        --infodir=\$${prefix}/share/info \
        --localstatedir=/var \
        --sysconfdir=/etc \
        --disable-silent-rules

You'll need to add a backslash (\) at the end of the last line and insert --disable-asciidoc as a new line:

        --disable-silent-rules \
        --disable-asciidoc

Now your compile run should succeed.

Another way to resolve this error is to install the package asciidoc. When it is installed the compile will run without errors.

Jens Kubieziel
  • 8,630
  • 5
  • 35
  • 116
0

Well, it turned out to be as simple as reinstalling docbook-xsl, docbook-xml, and xmlto with the command sudo apt-get --reinstall install docbook-xsl docbook-xml xmlto

After doing that, everything compiled as expected. It's likely there was simply some network or disk error during the installation of one of those packages, resulting in one or more of them becoming silently corrupted and failing to work as expected during compilation.

Alex Ryan
  • 191
  • 6