From 40e70a7bacceb500d87f51bbe7f86e71d3ed767c Mon Sep 17 00:00:00 2001 From: Michael Legleux Date: Thu, 2 Apr 2026 11:14:29 -0700 Subject: [PATCH] PR comments and more tweaks --- .github/workflows/reusable-package.yml | 2 ++ cmake/XrplPackaging.cmake | 19 ++++++++++--------- package/deb/debian/control | 8 ++++---- package/shared/update-xrpld.sh | 2 +- package/test/check_install_paths.sh | 4 ---- package/test/smoketest.sh | 3 ++- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/reusable-package.yml b/.github/workflows/reusable-package.yml index bc3a569ccc..821efabc54 100644 --- a/.github/workflows/reusable-package.yml +++ b/.github/workflows/reusable-package.yml @@ -36,6 +36,8 @@ env: jobs: package: name: ${{ inputs.pkg_type }} (${{ inputs.version }}) + permissions: + contents: read runs-on: ["self-hosted", "Linux", "X64", "heavy"] container: ${{ inputs.container_image }} timeout-minutes: 30 diff --git a/cmake/XrplPackaging.cmake b/cmake/XrplPackaging.cmake index 9ccf4c1519..ee407d1081 100644 --- a/cmake/XrplPackaging.cmake +++ b/cmake/XrplPackaging.cmake @@ -11,10 +11,15 @@ if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/opt/xrpld") return() endif() -# Generate the RPM spec from template (substitutes @xrpld_version@, @pkg_release@). if(NOT DEFINED pkg_release) set(pkg_release 1) endif() +if(NOT DEFINED xrpld_version OR xrpld_version STREQUAL "") + message( + FATAL_ERROR + "xrpld_version must be set (e.g. -Dxrpld_version=2.4.0)" + ) +endif() configure_file( ${CMAKE_SOURCE_DIR}/package/rpm/xrpld.spec.in ${CMAKE_BINARY_DIR}/package/rpm/xrpld.spec @@ -42,7 +47,7 @@ if(DPKG_BUILDPACKAGE_EXECUTABLE) package-deb COMMAND ${CMAKE_SOURCE_DIR}/package/build_pkg.sh deb ${CMAKE_SOURCE_DIR} - ${CMAKE_BINARY_DIR} ${xrpld_version} + ${CMAKE_BINARY_DIR} ${xrpld_version} ${pkg_release} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Building Debian package" VERBATIM @@ -74,7 +79,7 @@ foreach(PKG deb rpm) set(IMAGE ${RPM_TEST_IMAGE}) endif() - # Fixture: start container + # This image runs systemd for full testing xrpld.service add_test( NAME ${PKG}_container_start COMMAND @@ -82,12 +87,11 @@ foreach(PKG deb rpm) "docker rm -f xrpld_${PKG}_install_test 2>/dev/null || true && \ docker run -d \ --name xrpld_${PKG}_install_test \ - --memory=45g --memory-swap=45g \ - --privileged \ --cgroupns host \ --volume '${CMAKE_SOURCE_DIR}:/root:ro' \ --volume /sys/fs/cgroup:/sys/fs/cgroup:rw \ - --tmpfs /tmp --tmpfs /run --tmpfs /run/lock \ + --tmpfs /tmp --tmpfs /run \ + --tmpfs /run/lock \ ${IMAGE} \ /usr/sbin/init" ) @@ -96,7 +100,6 @@ foreach(PKG deb rpm) PROPERTIES FIXTURES_SETUP ${PKG}_container LABELS packaging ) - # Fixture: stop container # On CI: always stop. Locally: leave running on failure for diagnosis. add_test( NAME ${PKG}_container_stop @@ -114,7 +117,6 @@ foreach(PKG deb rpm) PROPERTIES FIXTURES_CLEANUP ${PKG}_container LABELS packaging ) - # Install package and run smoke test add_test( NAME ${PKG}_install COMMAND @@ -130,7 +132,6 @@ foreach(PKG deb rpm) TIMEOUT 600 ) - # Validate install paths and compat symlinks add_test( NAME ${PKG}_install_paths COMMAND diff --git a/package/deb/debian/control b/package/deb/debian/control index 19ba147026..ff05e40a3d 100644 --- a/package/deb/debian/control +++ b/package/deb/debian/control @@ -1,7 +1,7 @@ Source: xrpld Section: net Priority: optional -Maintainer: XRPL Foundation +Maintainer: XRPL Foundation Rules-Requires-Root: no Build-Depends: debhelper-compat (= 13) @@ -18,6 +18,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends} Description: XRP Ledger daemon - xrpld is the reference implementation of the XRP Ledger protocol. - It participates in the peer-to-peer XRP Ledger network, processes - transactions, and maintains the ledger database. + Reference implementation of the XRP Ledger protocol. Participates + in the peer-to-peer network, processes transactions, and maintains + a local ledger copy. diff --git a/package/shared/update-xrpld.sh b/package/shared/update-xrpld.sh index 83773614eb..cf5cef6ffb 100755 --- a/package/shared/update-xrpld.sh +++ b/package/shared/update-xrpld.sh @@ -67,7 +67,7 @@ if [ "$can_update" = true ] ; then set -e apply_update systemctl daemon-reload - systemctl restart xrpld.service + systemctl restart xrpld.service || { echo "$(date -u) xrpld daemon restart FAILED"; exit 1; } echo "$(date -u) xrpld daemon updated." else echo "$(date -u) no updates available" >> "$UPDATELOG" diff --git a/package/test/check_install_paths.sh b/package/test/check_install_paths.sh index 11cb496991..56878fc917 100755 --- a/package/test/check_install_paths.sh +++ b/package/test/check_install_paths.sh @@ -11,10 +11,6 @@ check_resolves_to() { [ "$actual" = "$2" ] || { echo "FAIL: $1 resolves to $actual, expected $2"; exit 1; } } -# var dirs (compat symlinks) -check -L /var/log/rippled -check -L /var/lib/rippled - # compat directory symlinks — existence and resolved target check -L /opt/ripple check_resolves_to /opt/ripple /opt/xrpld diff --git a/package/test/smoketest.sh b/package/test/smoketest.sh index c67dd3f11f..ad9ddd451c 100755 --- a/package/test/smoketest.sh +++ b/package/test/smoketest.sh @@ -6,6 +6,7 @@ set -o pipefail set -x +rm -f /tmp/test_failed /tmp/unittest_results trap 'test $? -ne 0 && touch /tmp/test_failed' EXIT install_from=$1 @@ -47,7 +48,7 @@ elif [ "${pkgtype}" = "rpm" ] ; then echo "No .rpm files found" exit 1 fi - rpm -i "${rpms[@]}" + rpm -i "${rpms[@]}" || { echo "RPM install failed"; exit 1; } fi # Verify installed version