]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: we need a usable cargo for sdist so download (and install) rust later
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 2 Oct 2025 08:21:03 +0000 (10:21 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 2 Oct 2025 09:03:27 +0000 (11:03 +0200)
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 <otto.moerbeek@open-xchange.com>
builder-support/dockerfiles/Dockerfile.recursor
pdns/recursordist/meson-dist-script.sh
pdns/recursordist/meson.build

index 7488a2cad8815d648f9cac60d75a09fa7e68e2fa..ef0a69ef374a82ddd260d99c9501880684bbe4df 100644 (file)
@@ -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/
index 127c040bcae6b62252e9498c55d8fb04033323e5..567df937b5b2268cc9aadcb3620732c5cab60e92 100755 (executable)
@@ -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
index 0a6898289d5ad689f27cd3069f0bdf0854d26d1c..82c7f59c5d3b5a8ce2af7ab10f2633fbf8c26456 100644 (file)
@@ -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: