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?

2
  • Also, for anyone who's in a hurry, this Github repo is a good resource for precompiled Tor .deb's that although not the newest, are much newer than what's in the main Raspbian repos.
    – Alex Ryan
    Commented Jan 21, 2014 at 20:40
  • That link no longer works, is there another one?
    – skarz
    Commented Sep 28, 2019 at 15:42

2 Answers 2

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.

6
  • Thank you! That's exactly what I couldn't figure out yesterday - I saw the --disable-asciidoc flag, but I had no idea where to put it. The package asciidoc was already installed though, which is concerning. Let me try to compile after making that change to debian/rules and see how it works!
    – Alex Ryan
    Commented Jan 22, 2014 at 1:30
  • Darn...that didn't work. I edited debian/rules and the compilation failed like this: debian/rules:64: warning: overriding commands for target override_dh_auto_confi gure' debian/rules:23: warning: ignoring old commands for target ``override_dh_auto_con figure' dh_install --fail-missing cp: cannot stat ``debian/tmp/usr/share/doc': No such file or directory dh_install: cp -a debian/tmp/usr/share/doc debian/tor//usr/share/ returned exit code 1
    – Alex Ryan
    Commented Jan 22, 2014 at 6:09
  • I corrected my entry. There was a section with configure options in the middle of the file. Commented Jan 22, 2014 at 8:50
  • Damn. I still got the cp: cannot stat 'debian/tmp/usr/share/doc': No such file or directory dh_install: cp -a debian/tmp/usr/share/doc debian/tor//usr/share/ returned exit code 1 error. I'm going to try to uninstall and reinstall asciidoc and see if that helps.
    – Alex Ryan
    Commented Jan 23, 2014 at 3:02
  • Reinstalling asciidoc didn't help, got the same error...now to reinstall docbook-xsl, docbook-xml, and xmlto, and see if that helps.
    – Alex Ryan
    Commented Jan 23, 2014 at 4:14
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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .