From 83d6d4dbaab5ff3a0f5ba21e3b01b4d58ea9b3f1 Mon Sep 17 00:00:00 2001 From: zjk <1553836110@qq.com> Date: Fri, 14 Aug 2026 16:26:07 +0800 Subject: [PATCH] =?UTF-8?q?CI=EF=BC=9A=E9=95=9C=E5=83=8F=E8=A1=A5=E8=A3=85?= =?UTF-8?q?=20netbase=20=E6=8F=90=E4=BE=9B=20/etc/protocols=EF=BC=88?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20MOOSDB=20getprotobyname=20=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=AF=BC=E8=87=B4=E5=90=AF=E5=8A=A8=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci/Dockerfile | 11 +++++++++-- ci/build-test.sh | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 06c1576..d0aa9a0 100755 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -42,9 +42,7 @@ RUN --mount=type=secret,id=gitea_token \ #----------------------------------------------------------------------- # Build & install MOOS-IvP (bundles MOOS core + essentials + geodesy + ivp) # build-moos.sh -m : skip GUI tools (no FLTK needed) -# --with-proj=off : skip PROJ (its CPM fetch pulls from github) # build-ivp.sh -n : skip GUI apps (no FLTK needed) -# -u : skip UTM (depends on PROJ-backed geodesy) # Installs libMOOS + MOOSConfig.cmake + ivp headers/libs to /usr/local, # matching the layout expected by the project's top-level CMakeLists.txt. #----------------------------------------------------------------------- @@ -56,4 +54,13 @@ RUN ./build-moos.sh -m -j"$(nproc)" && \ make -C build/ivp install && \ ldconfig +#----------------------------------------------------------------------- +# netbase provides /etc/protocols, which MOOS needs at runtime +# (getprotobyname("tcp")). The base image lacks it, so MOOSDB would throw +# XPCException "Could Not Get Protocol By Name" at startup without it. +# Kept as a final layer so the (expensive) MOOS-IvP build stays cached. +#----------------------------------------------------------------------- +RUN apt-get update && apt-get install -y --no-install-recommends netbase \ + && rm -rf /var/lib/apt/lists/* + WORKDIR /src diff --git a/ci/build-test.sh b/ci/build-test.sh index 9fc0818..c647c0f 100755 --- a/ci/build-test.sh +++ b/ci/build-test.sh @@ -69,7 +69,7 @@ getent protocols tcp >/dev/null 2>&1 && echo "getprotobyname(tcp) OK" || echo "g getent hosts localhost >/dev/null 2>&1 && echo "gethostbyname(localhost) OK" || echo "gethostbyname(localhost) FAILED" echo "ulimit -n: $(ulimit -n)" -"${MOOSDB}" -s --moos_suicide_disable --moos_no_colour "${MISSION_FILE}" > /tmp/moosdb_smoke.log 2>&1 & +"${MOOSDB}" --moos_suicide_disable --moos_no_colour "${MISSION_FILE}" > /tmp/moosdb_smoke.log 2>&1 & MOOSDB_PID=$! sleep 3