Building libtorrent in Docker for arm32v7 on x86 host fails with (error: Unknown target type EXE)

210 views Asked by At

I'm trying to build a static python binding for libtorrent for the RPi 4. I wrote a Dockerfile which works (although extremely slow) on the RPi 4. however, if I try to build the same Dockerfile on ubuntu with qemu-user-static or Windows 10 with Docker Desktop I get this error

Step 25/26 : RUN b2 -j1 libtorrent-link=static boost-link=static stage_module
 ---> Running in be922d0723d7
/root/boost_1_74_0/tools/build/src/build/type.jam:158: in type.validate from module type
error: Unknown target type EXE
(builtin):-1: in sequence.transform from module sequence
/root/boost_1_74_0/tools/build/src/build/generators.jam:239: in generator.__init__ from module object(installed-exe-generator)@4
/root/boost_1_74_0/tools/build/src/tools/stage.jam:568: in class@installed-exe-generator.__init__ from module object(installed-exe-generator)@4
/root/boost_1_74_0/tools/build/src/kernel/class.jam:90: in new from module class
/root/boost_1_74_0/tools/build/src/tools/stage.jam:596: in load from module stage
/root/boost_1_74_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/root/boost_1_74_0/tools/build/src/tools/builtin.jam:27: in load from module builtin
/root/boost_1_74_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/root/boost_1_74_0/tools/build/src/build-system.jam:12: in load from module build-system
/root/boost_1_74_0/tools/build/src/kernel/modules.jam:295: in import from module modules
/root/boost_1_74_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build from module
/root/boost_1_74_0/tools/build/boost-build.jam:8: in module scope from module

The command '/bin/sh -c b2 -j1 libtorrent-link=static boost-link=static stage_module' returned a non-zero code: 1

this is the Dockerfile I'm using

FROM arm32v7/ubuntu:latest

# this part so that tzdata does not ask for user input during the building process
ENV TZ=Europe/Kiev
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

WORKDIR /root
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -y build-essential git wget python3.6 python3.6-dev libpython3.6-dev
RUN wget --no-check-certificate https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gz
RUN git clone --recurse-submodules https://github.com/arvidn/libtorrent.git
ENV CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/usr/include/python3.6m"
RUN tar -xzf boost_1_74_0.tar.gz
WORKDIR /root/boost_1_74_0/tools/build
RUN ./bootstrap.sh
RUN cp src/engine/b2 /usr/local/bin/b2
ENV BOOST_ROOT=/root/boost_1_74_0/
ENV BOOST_BUILD_PATH=/root/boost_1_74_0/tools/build/
WORKDIR /root
RUN echo "using gcc : : : <cxxflags>-std=c++14 ;" > user-config.jam
RUN echo "using python : 3.6 : /usr/bin/python3.6 ;" >> user-config.jam
WORKDIR /root/libtorrent
RUN git checkout RC_1_2
WORKDIR /root/libtorrent/bindings/python
RUN b2 -j1 libtorrent-link=static boost-link=static stage_module
0

There are 0 answers