Skip to content

ci: Add Linux package builds (DEB + RPM) to CI#6639

Open
legleux wants to merge 12 commits intodevelopfrom
legleux/linux-packages
Open

ci: Add Linux package builds (DEB + RPM) to CI#6639
legleux wants to merge 12 commits intodevelopfrom
legleux/linux-packages

Conversation

@legleux
Copy link
Copy Markdown
Collaborator

@legleux legleux commented Mar 24, 2026

High Level Overview of Change

  • Add DEB and RPM package builds to CI, triggered on PRs, merges to develop, tagged releases, and manual dispatch
  • Packages are built from pre-built binary artifacts — no cmake configure needed in the packaging job
  • DEB produces a main .deb plus a .ddeb debug symbols package; RPM produces a main .rpm plus -debuginfo

Packaging infrastructure:

  • package/build_pkg.sh — single script driving both RPM and DEB builds, stages files from the repo and a pre-built binary
  • package/rpm/xrpld.spec.in — RPM spec template with systemd macros, debug package support, and full compat symlinks
  • package/deb/debian/ — complete Debian packaging (control, rules, links, conffiles, copyright, transitional rippled package)
  • package/shared/ — service file, sysusers, tmpfiles, logrotate, update script, and cron entry
  • cmake/XrplPackaging.cmake — CMake targets (package-deb, package-rpm) for local development builds
  • package/test/ — install smoke test and path validation scripts (for future CTest integration)

CI workflows:

  • reusable-package.yml — reusable workflow called by all triggers
  • manual-package.yml — workflow_dispatch for on-demand builds with version/release overrides
  • Updated on-trigger.yml, on-pr.yml, on-tag.yml to run packaging after build
  • Updated generate.py to include ubuntu-jammy-gcc-12-amd64-release and rhel-9-gcc-12-amd64-release in the minimal matrix

Install layout:

  • Binary: /opt/xrpld/bin/xrpld
  • Config: /opt/xrpld/etc/xrpld.cfg, /opt/xrpld/etc/validators.txt
  • Full compat symlinks for rippled --> xrpld naming transition (/opt/ripple, /usr/bin/rippled, /etc/opt/ripple, etc.)

Test plan

  • DEB builds successfully in CI (ubuntu-jammy container)
  • RPM builds successfully in CI (rhel-9 container)
  • Artifacts uploaded (.deb, .ddeb, .rpm, -debuginfo.rpm)
  • dpkg-deb -c / rpm -qlp show correct file paths
  • Manual dispatch workflow works from GitHub UI

Future Tasks

  • Change xrpld development build naming convention so they sort lexicographically
  • Upload packages to https://conan.ripplex.io/artifactory/generic-local/xrpld/

@legleux legleux added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Mar 24, 2026
@legleux legleux requested review from bthomee and mathbunnyru March 24, 2026 22:52
@legleux legleux removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Mar 24, 2026
Comment thread .github/workflows/reusable-package.yml
@legleux legleux marked this pull request as ready for review March 24, 2026 22:53
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.6%. Comparing base (e2e537b) to head (ac7c4ef).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6639     +/-   ##
=========================================
- Coverage     81.6%   81.6%   -0.0%     
=========================================
  Files         1010    1010             
  Lines        75982   75982             
  Branches      7633    7633             
=========================================
- Hits         61982   61981      -1     
- Misses       14000   14001      +1     

see 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Linux package (DEB + RPM) build support to the repository and CI, producing installable artifacts from pre-built xrpld binaries and introducing local CMake targets + smoke-test tooling to validate package installs.

Changes:

  • Introduces packaging infrastructure (RPM spec template, Debian debian/ metadata, shared service/sysusers/tmpfiles/logrotate/update scripts, and install smoke tests).
  • Adds CMake targets (package-deb, package-rpm) and Docker-based CTest fixtures intended to validate package installs.
  • Updates GitHub Actions workflows/matrix generation to build required Release binaries and run packaging on PRs, triggers, and tags (plus a manual dispatch workflow).

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
package/test/smoketest.sh Installs locally built package and runs basic verification + unittests.
package/test/check_install_paths.sh Validates installed paths and compatibility symlinks.
package/shared/xrpld.tmpfiles Adds tmpfiles.d entries for runtime directories.
package/shared/xrpld.sysusers Defines system user for the daemon.
package/shared/xrpld.service Adds systemd unit for running xrpld from packaged layout.
package/shared/xrpld.logrotate Adds logrotate configuration for packaged log paths.
package/shared/update-xrpld.sh Adds an auto-update helper script for DEB/RPM systems.
package/shared/update-xrpld-cron Adds a cron entry to invoke the auto-update script.
package/rpm/xrpld.spec.in Defines RPM package layout, symlinks, and systemd/sysusers/tmpfiles integration.
package/deb/debian/xrpld.links Defines Debian compatibility symlinks for legacy rippled paths.
package/deb/debian/xrpld.install Defines Debian install set for runtime + docs.
package/deb/debian/xrpld.conffiles Marks config files as conffiles for dpkg.
package/deb/debian/source/format Sets Debian source format.
package/deb/debian/rules Debian build rules that stage prebuilt artifacts.
package/deb/debian/copyright Debian copyright metadata.
package/deb/debian/control Debian package metadata incl. transitional rippled.
package/build_pkg.sh Single entry script to build either RPM or DEB from a prebuilt binary.
package/README.md Documents packaging layout, usage, and verification steps.
cspell.config.yaml Adds packaging-related words to spellchecker config.
cmake/XrplPackaging.cmake Adds packaging targets and Docker-based install verification tests.
cmake/XrplInstall.cmake Adjusts config install destinations for packaging layout.
CMakeLists.txt Includes the new packaging CMake module.
.github/workflows/reusable-package.yml Reusable workflow to build DEB/RPM packages from prebuilt artifacts.
.github/workflows/on-trigger.yml Triggers packaging after build on pushes/schedule/dispatch.
.github/workflows/on-tag.yml Builds packages for version tags.
.github/workflows/on-pr.yml Runs packaging on PRs when relevant paths change.
.github/workflows/manual-package.yml Adds workflow_dispatch for on-demand package builds.
.github/scripts/strategy-matrix/generate.py Expands minimal matrix to include required Release builds for packaging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread .github/workflows/manual-package.yml Outdated
Comment thread .github/workflows/reusable-package.yml
Comment thread package/deb/debian/control Outdated
Comment thread package/shared/xrpld.tmpfiles Outdated
Comment thread package/shared/update-xrpld-cron Outdated
Comment thread cmake/XrplPackaging.cmake
Comment thread .github/workflows/on-trigger.yml
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several issues flagged inline: critical CI matrix reduction (on-trigger.yml), a dead artifact_run_id input, unpinned download-artifact action (supply-chain), unvalidated inputs interpolated into shell, missing set -e causing false-pass in smoketest, RPM missing compat symlinks and license file, unquoted variables in a root-running update script, and a stray debug comment in debian/rules.

Review by Claude Opus 4.6 · Prompt: V12

Comment thread package/shared/xrpld.tmpfiles Outdated
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/shared/xrpld.service
Comment thread .github/workflows/reusable-package.yml Outdated
Comment thread .github/workflows/manual-package.yml Outdated
Comment thread package/test/smoketest.sh
Comment thread package/test/smoketest.sh Outdated
Comment thread package/test/smoketest.sh
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several issues flagged inline: wrong tmpfiles paths (correctness), shell injection via unquoted heredoc and sed delimiter, self-hosted runner executing PR code (security), --rm defeating diagnostic container retention, stale temp files masking test failures, and unpinned :latest Docker images.

Review by Claude Opus 4.6 · Prompt: V12

Comment thread package/shared/xrpld.tmpfiles Outdated
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/build_pkg.sh
Comment thread package/test/smoketest.sh
Comment thread package/test/smoketest.sh
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 12 comments.

Comments suppressed due to low confidence (3)

.github/workflows/on-trigger.yml:132

  • container_image is set to a mutable tag (ghcr.io/xrplf/ci/rhel-9:gcc-12). Elsewhere in CI the repo pins container images to immutable *-sha-* tags for reproducibility (e.g. .github/workflows/reusable-build-test.yml:58, .github/workflows/reusable-upload-recipe.yml:43). Consider pinning this packaging image similarly to avoid unexpected CI drift.
    with:
      pkg_type: rpm
      artifact_name: xrpld-rhel-9-gcc-12-amd64-release
      version: ${{ needs.generate-version.outputs.version }}
      container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12

.github/workflows/on-tag.yml:71

  • container_image is set to a mutable tag (ghcr.io/xrplf/ci/rhel-9:gcc-12). Elsewhere in CI the repo pins container images to immutable *-sha-* tags for reproducibility (e.g. .github/workflows/reusable-build-test.yml:58, .github/workflows/reusable-upload-recipe.yml:43). Consider pinning this packaging image similarly to avoid unexpected CI drift.
    uses: ./.github/workflows/reusable-package.yml
    with:
      pkg_type: rpm
      artifact_name: xrpld-rhel-9-gcc-12-amd64-release
      version: ${{ needs.generate-version.outputs.version }}
      container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12

.github/workflows/manual-package.yml:63

  • container_image is set to a mutable tag (ghcr.io/xrplf/ci/rhel-9:gcc-12). Elsewhere in CI the repo pins container images to immutable *-sha-* tags for reproducibility (e.g. .github/workflows/reusable-build-test.yml:58, .github/workflows/reusable-upload-recipe.yml:43). Consider pinning this packaging image similarly to avoid unexpected CI drift.
      pkg_type: rpm
      artifact_name: xrpld-rhel-9-gcc-12-amd64-release
      version: ${{ needs.generate-version.outputs.version }}
      pkg_release: ${{ inputs.pkg_release }}
      container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package/deb/debian/control Outdated
Comment thread package/rpm/xrpld.spec.in
Comment thread package/shared/xrpld.tmpfiles
Comment thread package/test/smoketest.sh
Comment thread package/test/smoketest.sh
Comment thread .github/workflows/on-pr.yml
Comment thread .github/workflows/on-pr.yml
Comment thread .github/workflows/on-trigger.yml
Comment thread .github/workflows/on-tag.yml
Comment thread .github/workflows/manual-package.yml Outdated
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several security issues flagged inline: unvalidated container image input, mutable image tags on privileged containers, missing artifact integrity check, sed delimiter injection via free-form version inputs, world-writable lock dir DoS, and an unsanitized env-var repo override. See inline comments.

Review by Claude Opus 4.6 · Prompt: V12

Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/manual-package.yml Outdated
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/shared/update-xrpld.sh Outdated
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several high-severity issues flagged inline: untrusted PR code running on self-hosted runners, mismatched SHA/version comments on pinned actions, world-writable lock dir DoS, unvalidated REPO env var used in root package install, privileged test containers, and a few correctness/reliability issues in the update script.

Review by Claude Opus 4.6 · Prompt: V12

Comment thread .github/workflows/on-pr.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/shared/update-xrpld.sh Outdated
Comment thread package/shared/update-xrpld.sh
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took a pass through this

Several issues flagged: critical supply-chain risk in the auto-update script (no package signature verification, unvalidated REPO env var injected into root-run yum), unsanitized inputs.version in the workflow, sed delimiter collision, mutable :latest Docker image tags, a 45 GB memory limit that will break on most machines, logrotate config installed to a non-standard path (inactive on all distros), BuildArch misuse in the RPM spec, missing xrpld_version guard in CMake, and a few minor issues. See inline comments.


Review by ReviewBot 🤖

Review by Claude Opus 4.6 · Prompt: V12

Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread package/rpm/xrpld.spec.in Outdated
Comment thread package/rpm/xrpld.spec.in
Comment thread package/deb/debian/xrpld.install
Comment thread package/deb/debian/copyright Outdated
Comment thread package/test/smoketest.sh
@legleux legleux force-pushed the legleux/linux-packages branch from 9871d41 to cf38fc5 Compare March 31, 2026 07:54
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several security and correctness issues flagged inline: bogus action version comments across both workflow files, missing permissions block, no artifact integrity check before packaging, sed delimiter injection, world-writable lock dir in the update script, incomplete yum repo restriction, unguarded xrpld_version in CMake, mutable :latest test images, and --privileged Docker containers. See inline comments for details.

Review by Claude Opus 4.6 · Prompt: V12

Comment thread .github/workflows/manual-package.yml Outdated
Comment thread .github/workflows/manual-package.yml Outdated
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package/build_pkg.sh
Comment thread cmake/XrplPackaging.cmake
Comment on lines +41 to +49
add_custom_target(
package-deb
COMMAND
${CMAKE_SOURCE_DIR}/package/build_pkg.sh deb ${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR} ${xrpld_version}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Building Debian package"
VERBATIM
)
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package-deb CMake target passes ${xrpld_version} but not ${pkg_release} into build_pkg.sh, so locally built DEBs will always use the default release 1 even when -Dpkg_release=... is set. Pass pkg_release through to keep DEB and RPM release numbers consistent.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did that actually work?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPM path — pkg_release works:

  1. CMake configure_file (line 23-27) substitutes @pkg_release@ into xrpld.spec.in → xrpld.spec
  2. package-rpm (line 34-35) calls build_pkg.sh rpm — only 3 args, no version/release passed
  3. build_pkg.sh:build_rpm() copies the already-configured spec file (line 36), so %{pkg_release} in the spec is already baked in from step 1
  4. The spec uses it at line 11: Release: %{?ver_suffix:0.%{ver_suffix}.}%{pkg_release}%{?dist}

RPM is fine — it gets pkg_release via configure_file, not via the shell argument.

DEB path — pkg_release works:

  1. package-deb (line 49-50) calls build_pkg.sh deb ${xrpld_version} ${pkg_release} — 5 args
  2. build_pkg.sh:17 picks up PKG_RELEASE="${5:-1}"
  3. build_pkg.sh:72 writes the changelog: xrpld (${deb_version}-${PKG_RELEASE}) unstable; ...

DEB is fine — it gets pkg_release via the 5th argument.
Both paths correctly propagate -Dpkg_release=N. The RPM gets it at configure time through the spec template; the DEB gets it at build time through the shell argument. The PR comment's concern was already
addressed in the current code.

Comment thread cmake/XrplPackaging.cmake
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package/test/smoketest.sh Outdated
Comment thread package/test/check_install_paths.sh Outdated
Comment thread cmake/XrplPackaging.cmake Outdated
Comment thread package/build_pkg.sh
Comment thread package/deb/debian/xrpld.links
Comment thread package/rpm/xrpld.spec.in
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several issues flagged inline: two high-severity security concerns (untrusted PR code on self-hosted runners, suspicious action SHAs that don't match known versions), a container breakout risk from --privileged + writable cgroupfs, an RPM build breakage when run outside CMake, missing RPM compat symlinks that will fail check_install_paths.sh, and a handful of medium/low correctness and hardening issues across the shell scripts and CMake.

Review by Claude Opus 4.6 · Prompt: V12

Comment thread .github/workflows/on-pr.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml
Comment thread cmake/XrplPackaging.cmake
Comment thread package/test/smoketest.sh Outdated
Comment thread package/test/smoketest.sh
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/on-trigger.yml Outdated
pkg_type: rpm
artifact_name: xrpld-rhel-9-gcc-12-amd64-release
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This RPM packaging job uses a mutable container tag (ghcr.io/xrplf/ci/rhel-9:gcc-12). The repo generally pins Linux container images to immutable *-sha-* tags (see .github/workflows/reusable-build-test.yml:58). Please pin this image as well.

Suggested change
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12-sha-<pin-to-the-exact-immutable-tag-used-elsewhere-for-this-image>

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bthomee @mathbunnyru How do you want to specify the image used for packaging?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think specifying the exact SHA of the image is a reasonable thing to do, especially considering we already pin everything else that can be pinned.

Comment thread .github/workflows/on-tag.yml Outdated
pkg_type: rpm
artifact_name: xrpld-rhel-9-gcc-12-amd64-release
version: ${{ needs.generate-version.outputs.version }}
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This RPM packaging job uses a mutable container tag (ghcr.io/xrplf/ci/rhel-9:gcc-12). For reproducibility, please switch to the same *-sha-* pinning convention used by other workflows (e.g. .github/workflows/reusable-build-test.yml:58).

Suggested change
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12
container_image: ghcr.io/xrplf/ci/rhel-9:gcc-12-sha-<replace-with-the-exact-pinned-tag-used-elsewhere>

Copilot uses AI. Check for mistakes.
Comment thread package/test/check_install_paths.sh
Comment thread package/shared/update-xrpld.sh
Comment thread package/shared/update-xrpld.sh
Comment on lines +102 to 104
# - 9 using GCC 12: Debug and Release on linux/amd64
# (Release is required for RPM packaging).
# - 10 using Clang: Release on linux/amd64.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid introducing an additional configuration, I propose to switch RHEL 9 to release only, and RHEL 10 to debug.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both Release and Debug builds include debug symbols, so either works for packaging purposes. I'd suggest we drop the overrides to CMake defaults here and figure out what configurations we actually need in a separate discussion — that's a broader question than this PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathbunnyru any thoughts here? Maybe the point is moot given the effort to consolidate to a single recent GCC and Clang per distro.


# Ubuntu:
# - Jammy using GCC 12: Debug on linux/arm64.
# - Jammy using GCC 12: Debug on linux/arm64, Release on
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, can switch Jammy to release only instead of introducing an additional config.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Comment thread .github/workflows/on-pr.yml
Comment thread .github/workflows/on-pr.yml

generate-version:
needs: should-run
if: ${{ needs.should-run.outputs.go == 'true' }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For PRs, should we add an additional condition to limit on a label, e.g. contains(github.event.pull_request.labels.*.name, 'Package')? Right now this will run on each commit, which is probably overkill.

If we want to control .deb and .rpm separately then the condition can be moved into the separate packaging jobs below, using e.g. PkgDeb and PkgRpm or so.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The packaging jobs download a pre-built binary and run dpkg-buildpackage/rpmbuild. Since there's no compilation step, it's quick. Gating on a label adds process overhead that people will forget and we'll end up either building it or forgetting and allow packaging regressions for negligible time savings.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much storage space is this going to require per commit? I'm concerned this is going to consume a lot of disk = $$$.

Can the packages be overwritten at least, so that we only produce and upload one .deb and one .rpm per PR? (this includes avoiding creating packages with the same name but with different version suffixes like -1 and -2)

description: "Package release number. Increment when repackaging the same executable."
required: false
type: string
default: "1"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have the very first package not use a release number, or at least to not include it in the package name? I think the rippled-1 package is just silly.

Since this is numeric, you should consider using the number type instead of string.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trust me, I wanted to kill the -1 too. But after wrestling with both RPM and DEB packaging systems and their very opinionated tooling, I came around: the release number is a load-bearing convention baked into decades of Linux packaging. It exists so you can increment to -2 when repackaging the same upstream version (dependency rebuild, config fix, etc.) without bumping the version itself. dpkg, rpm, apt, yum — they all expect it, sort by it, and make upgrade decisions based on it. Fighting that buys us nothing and costs us compatibility with every tool in the ecosystem.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boo, ok it is what it is.

Comment thread .github/workflows/reusable-package.yml
Comment thread .github/workflows/reusable-package.yml Outdated
Comment thread .github/workflows/reusable-package.yml
- name: Upload package artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: xrpld-${{ inputs.pkg_type }}-${{ inputs.version }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be a benefit to also including the ${{ inputs.pkg_release }} here in the name? All three values are used to build the package in the step above.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release number only changes when repackaging the same upstream version — a manual, exceptional operation. In normal flow, every commit produces a different version string, so pkg_release is always 1. Adding it to the artifact name would imply automated tracking of "have we already released this version?" which doesn't exist and is out of scope here. If repackaging is ever needed, that's a manual workflow with an explicit pkg_release override.

Comment thread cmake/XrplPackaging.cmake
Comment thread package/README.md
Comment thread cmake/XrplPackaging.cmake
Comment on lines +41 to +49
add_custom_target(
package-deb
COMMAND
${CMAKE_SOURCE_DIR}/package/build_pkg.sh deb ${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR} ${xrpld_version}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Building Debian package"
VERBATIM
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did that actually work?

Comment thread cmake/XrplPackaging.cmake
Comment thread cmake/XrplPackaging.cmake Outdated
return()
endif()

set(DEB_TEST_IMAGE "geerlingguy/docker-ubuntu2204-ansible:latest")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legleux you stated in another comment that testing on the latest release is the point, but why exactly?

If we're ready to push out a release and a new version of one of these Docker images just got published that breaks the tests, then what are we supposed to do? If it's an urgent fix release, I don't think we'll want to spend a few hours or longer figuring out how to get the test image to play nice again.

Comment thread cmake/XrplPackaging.cmake Outdated
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@legleux legleux requested a review from bthomee April 8, 2026 21:25
@legleux legleux force-pushed the legleux/linux-packages branch from 7bc0e61 to b23b325 Compare April 8, 2026 22:07
@legleux legleux added CI Continuous Integration Functionality and removed CI Continuous Integration Functionality labels Apr 8, 2026
Copy link
Copy Markdown
Collaborator

@bthomee bthomee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not reviewed the contents of package/ as I'm not familiar with any of that. While I'd love to review it now, time off is calling. I can attempt to review (and learn) when I'm back or otherwise I defer to @mathbunnyru.

Comment on lines +102 to 104
# - 9 using GCC 12: Debug and Release on linux/amd64
# (Release is required for RPM packaging).
# - 10 using Clang: Release on linux/amd64.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathbunnyru any thoughts here? Maybe the point is moot given the effort to consolidate to a single recent GCC and Clang per distro.


generate-version:
needs: should-run
if: ${{ needs.should-run.outputs.go == 'true' }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much storage space is this going to require per commit? I'm concerned this is going to consume a lot of disk = $$$.

Can the packages be overwritten at least, so that we only produce and upload one .deb and one .rpm per PR? (this includes avoiding creating packages with the same name but with different version suffixes like -1 and -2)

uses: ./.github/workflows/reusable-package.yml
with:
pkg_type: deb
artifact_name: xrpld-ubuntu-jammy-gcc-12-amd64-release
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up then on my other comment above, if we can overwrite packages, then using the PR number would be preferred over the shortened commit hash, so we don't get a storage explosion.

Although PR numbers are increasing, there's no guarantee that they are merged in that order. I don't have a good suggestion offhand to make them sortable in that case.

If we don't use PR numbers, then prefixing a (shortened) timestamp would at least help...

Comment on lines +26 to +38
build-test:
if: ${{ github.repository == 'XRPLF/rippled' }}
uses: ./.github/workflows/reusable-build-test.yml
strategy:
fail-fast: true
matrix:
os: [linux]
with:
ccache_enabled: false
os: ${{ matrix.os }}
strategy_matrix: minimal
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathbunnyru do you have a preference?

description: "Package release number. Increment when repackaging the same executable."
required: false
type: string
default: "1"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boo, ok it is what it is.

Comment thread .github/workflows/reusable-package.yml
Comment on lines +63 to +64
sed -e "s/@xrpld_version@/${PKG_VERSION}/" \
-e "s/@pkg_release@/${PKG_RELEASE}/" \
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legleux both AI reviewers raise similar concerns. Do you want to add any escaping or other kind of protection/sanitization here?

@legleux legleux force-pushed the legleux/linux-packages branch from b23b325 to ac7c4ef Compare April 13, 2026 21:16
Copy link
Copy Markdown
Contributor

@xrplf-ai-reviewer xrplf-ai-reviewer bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues.

Review by Claude Opus 4.6 · Prompt: V14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants