From 396a23d275dc61beea0331689224be695aa55a83 Mon Sep 17 00:00:00 2001 From: raldone01 Date: Wed, 8 Jan 2025 22:49:02 +0100 Subject: [PATCH] Suppress error warnings to ensure builds succeed. Fix `nprocs` should be `nproc`. Update urls for the version scripts to point to the new gitlab instance of the torproject. --- Dockerfile | 26 +++++++++++++++++--------- last_tor_version.sh | 2 +- last_torsocks_version.sh | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9c17298..1744bc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,8 @@ ARG torsocks_version ENV HOME /var/lib/tor ENV POETRY_VIRTUALENVS_CREATE=false -RUN apk add --no-cache git bind-tools cargo libevent-dev openssl-dev gnupg gcc make automake ca-certificates autoconf musl-dev coreutils libffi-dev zlib-dev && \ +RUN set -ex; \ + apk add --no-cache git bind-tools cargo libevent-dev openssl-dev gnupg gcc make automake ca-certificates autoconf musl-dev coreutils libffi-dev zlib-dev && \ mkdir -p /usr/local/src/ /var/lib/tor/ && \ git clone https://git.torproject.org/tor.git /usr/local/src/tor && \ cd /usr/local/src/tor && \ @@ -15,43 +16,50 @@ RUN apk add --no-cache git bind-tools cargo libevent-dev openssl-dev gnupg g git checkout tor-$TOR_VERSION && \ ./autogen.sh && \ ./configure \ + --enable-fatal-warnings=no \ --disable-asciidoc \ --sysconfdir=/etc \ --disable-unittests && \ - make -j$(nprocs) && make install && \ + make -j$(nproc) && make install && \ cd .. && \ rm -rf tor && \ pip3 install --upgrade pip poetry && \ apk del git libevent-dev openssl-dev gnupg cargo make automake autoconf musl-dev coreutils libffi-dev && \ apk add --no-cache libevent openssl -RUN apk add --no-cache git gcc make automake autoconf musl-dev libtool && \ +RUN set -ex; \ + apk add --no-cache git gcc make automake autoconf musl-dev libtool && \ git clone https://git.torproject.org/torsocks.git /usr/local/src/torsocks && \ cd /usr/local/src/torsocks && \ TORSOCKS_VERSION=${torsocks_version=$(git tag | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)} && \ git checkout $TORSOCKS_VERSION && \ ./autogen.sh && \ - ./configure && \ - make -j$(nprocs) && make install && \ + ./configure \ + --enable-fatal-warnings=no && \ + make -j$(nproc) && make install && \ cd .. && \ rm -rf torsocks && \ apk del git gcc make automake autoconf musl-dev libtool -RUN mkdir -p /etc/tor/ +RUN set -ex; \ + mkdir -p /etc/tor/ COPY pyproject.toml /usr/local/src/onions/ -RUN cd /usr/local/src/onions && apk add --no-cache openssl-dev libffi-dev gcc libc-dev && \ +RUN set -ex; \ + cd /usr/local/src/onions && apk add --no-cache openssl-dev libffi-dev gcc libc-dev && \ poetry install --only main --no-root && \ apk del libffi-dev gcc libc-dev openssl-dev COPY onions /usr/local/src/onions/onions COPY poetry.lock /usr/local/src/onions/ -RUN cd /usr/local/src/onions && apk add --no-cache gcc libc-dev && \ +RUN set -ex; \ + cd /usr/local/src/onions && apk add --no-cache gcc libc-dev && \ poetry install --only main && \ apk del gcc libc-dev -RUN mkdir -p ${HOME}/.tor && \ +RUN set -ex; \ + mkdir -p ${HOME}/.tor && \ addgroup -S -g 107 tor && \ adduser -S -G tor -u 104 -H -h ${HOME} tor diff --git a/last_tor_version.sh b/last_tor_version.sh index f46c1c2..b8993d5 100755 --- a/last_tor_version.sh +++ b/last_tor_version.sh @@ -1,2 +1,2 @@ #!/bin/bash -git ls-remote --tags https://git.torproject.org/tor.git | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1 +git ls-remote --tags https://gitlab.torproject.org/tpo/core/tor.git/ | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1 diff --git a/last_torsocks_version.sh b/last_torsocks_version.sh index aacc547..50d1d46 100755 --- a/last_torsocks_version.sh +++ b/last_torsocks_version.sh @@ -1,2 +1,2 @@ #!/bin/sh -git ls-remote --tags https://git.torproject.org/torsocks.git | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1 +git ls-remote --tags https://gitlab.torproject.org/tpo/core/torsocks.git/ | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1