From: Otto Moerbeek Date: Thu, 2 Oct 2025 08:21:03 +0000 (+0200) Subject: rec: we need a usable cargo for sdist so download (and install) rust later X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ef883baca624441f71c4e5e493283533d4fd1b1;p=thirdparty%2Fpdns.git rec: we need a usable cargo for sdist so download (and install) rust later The install is needed for meson setup, which does not run the found executable, so the error of a missing lib was never spotted. Signed-off-by: Otto Moerbeek --- diff --git a/builder-support/dockerfiles/Dockerfile.recursor b/builder-support/dockerfiles/Dockerfile.recursor index 7488a2cad..ef0a69ef3 100644 --- a/builder-support/dockerfiles/Dockerfile.recursor +++ b/builder-support/dockerfiles/Dockerfile.recursor @@ -8,9 +8,6 @@ RUN apk add --no-cache gcc g++ make tar autoconf automake protobuf-dev lua-dev \ COPY . /pdns-recursor WORKDIR /pdns-recursor -#ADD builder-support/helpers/ /pdns/builder-support/helpers/ -RUN cd /pdns-recursor/builder-support/helpers/ && \ - ./install_rust.sh RUN mkdir /sdist @@ -20,4 +17,7 @@ RUN cd /pdns-recursor/pdns/recursordist && \ meson setup /tmp/rec-meson-dist-build && \ meson dist -C /tmp/rec-meson-dist-build --no-tests +RUN cd /pdns-recursor/builder-support/helpers/ && \ + ./install_rust.sh + RUN cp /tmp/rec-meson-dist-build/meson-dist/pdns-recursor-${BUILDER_VERSION}.tar.xz /sdist/ diff --git a/pdns/recursordist/meson-dist-script.sh b/pdns/recursordist/meson-dist-script.sh index 127c040bc..567df937b 100755 --- a/pdns/recursordist/meson-dist-script.sh +++ b/pdns/recursordist/meson-dist-script.sh @@ -1,15 +1,25 @@ #!/bin/sh -e echo Running meson-dist-script +export CARGO="${CARGO:-$_defaultCARGO}" + echo PWD=$(pwd) echo MESON_SOURCE_ROOT=$MESON_SOURCE_ROOT echo MESON_PROJECT_DIST_ROOT=$MESON_PROJECT_DIST_ROOT +echo CARGO=$CARGO if [ -z "${BUILDER_VERSION}" ]; then echo "BUILDER_VERSION is not set" >&2 exit 1 fi +if [ -z "${CARGO}" ]; then + echo PATH=$PATH + ls -l /usr/bin/cargo + export CARGO=/usr/bin/cargo + #exit 1 +fi + cd "$MESON_PROJECT_DIST_ROOT" # Get all symlinks @@ -52,7 +62,9 @@ echo Updating the version of the Rust library to ${BUILDER_VERSION} # Unfortunately we cannot use --offline because for some reason cargo-update wants # to check all dependencies even though we are telling it exactly what to update cd "$MESON_PROJECT_DIST_ROOT"/rec-rust-lib/rust/ -cargo update --verbose --precise ${BUILDER_VERSION} recrust +ls -l /usr/bin/cargo +echo $CARGO update --verbose --precise ${BUILDER_VERSION} recrust +$CARGO update --verbose --precise ${BUILDER_VERSION} recrust cd "$MESON_PROJECT_BUILD_ROOT" # Generate man pages diff --git a/pdns/recursordist/meson.build b/pdns/recursordist/meson.build index 0a6898289..82c7f59c5 100644 --- a/pdns/recursordist/meson.build +++ b/pdns/recursordist/meson.build @@ -11,6 +11,10 @@ project( 'cpp_std=c++17', ], ) + +env = environment() +cargo = find_program('cargo') +env.set('_defaultCARGO', cargo.full_path()) meson.add_dist_script('meson-dist-script.sh') # When running meson dist, the command below produces multiple lines on stderr: