Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
aec131b
ci: Use ccache to cache build objects for speeding up building
bthomee Dec 3, 2025
30d2f70
Print ccache statistics
bthomee Dec 3, 2025
89ea91a
Update CI images
bthomee Dec 3, 2025
5ca0577
Cache the ccache dir
bthomee Dec 3, 2025
efd2a33
Use env var for the ccache dir
bthomee Dec 3, 2025
ac71a5f
Update name of step
bthomee Dec 3, 2025
73ef462
Merge branch 'develop' into bthomee/ccache
bthomee Dec 4, 2025
a07399d
Merge branch 'develop' into bthomee/ccache
bthomee Dec 4, 2025
22ee2f5
Merge branch 'develop' into bthomee/ccache
bthomee Dec 4, 2025
6942b03
Merge branch 'develop' into bthomee/ccache
bthomee Dec 5, 2025
b38c500
Merge branch 'develop' into bthomee/ccache
bthomee Dec 8, 2025
b343926
Tweaks
bthomee Dec 8, 2025
ac96150
Add include(Ccache) to CMakeLists.txt
bthomee Dec 8, 2025
dd3c7d5
Improve build-test-config, enable ccache for MSVC
bthomee Dec 9, 2025
9cb4b78
Define stats log within a step
bthomee Dec 9, 2025
22517d6
Remove log stats as it segfaults on Debian, improve ccache command on…
bthomee Dec 9, 2025
a5b944a
Use multiple COMMAND statements for pipes
bthomee Dec 9, 2025
a621f02
Remove OUTPUT_QUIET and temporarily only run on Windows
bthomee Dec 9, 2025
4fed8fd
Debug
bthomee Dec 9, 2025
4efef6a
Debug
bthomee Dec 9, 2025
5570cc3
Use bash to extract ccache target on Windows
bthomee Dec 10, 2025
4f2b96f
Debug
bthomee Dec 10, 2025
1ada914
Debug
bthomee Dec 10, 2025
d1b928b
Move ccache include statements before compilers are defined
bthomee Dec 11, 2025
d3f1bbd
Merge branch 'develop' into bthomee/ccache
bthomee Dec 11, 2025
dde20ec
Debug
bthomee Dec 11, 2025
9c6fb66
Enable all OSes again in matrix
bthomee Dec 11, 2025
e18eb78
Merge branch 'develop' into bthomee/ccache
bthomee Dec 11, 2025
e234117
Simplify Ccache.cmake
bthomee Dec 11, 2025
a724ef4
Use redis as remote cache for windows only at the moment
bthomee Dec 12, 2025
40516a4
Fix prepare-runner path
bthomee Dec 12, 2025
2c9556c
Merge branch 'develop' into bthomee/ccache
bthomee Dec 12, 2025
7d7e774
Remove unavailable conditional
bthomee Dec 12, 2025
69fc941
Set redis endpoint
bthomee Dec 12, 2025
d426525
Improve log message
bthomee Dec 13, 2025
9e4f769
Use HTTP storage backend
bthomee Dec 15, 2025
9a91e42
Use HTTP storage backend
bthomee Dec 15, 2025
a423a18
Merge branch 'develop' into bthomee/ccache
bthomee Dec 15, 2025
2e218fb
Enable macOS and verbose cache stats
bthomee Dec 15, 2025
0adec9c
Enable linux
bthomee Dec 15, 2025
543e023
Update secret name
bthomee Dec 15, 2025
b1478f8
Improve comments and trigger
bthomee Dec 16, 2025
b2c896e
Use DNS name for cache endpoint
bthomee Dec 16, 2025
163faa7
Use log file for ccache to debug issues
bthomee Dec 16, 2025
40cbe13
Fix url suffix
bthomee Dec 16, 2025
f54db31
Move ccache log file into temp directory
bthomee Dec 16, 2025
8c0543f
Use runner.xxx instead of github.xxx
bthomee Dec 16, 2025
923e44d
The runner.xxx is only available in steps
bthomee Dec 16, 2025
e260a4f
The runner.xxx is only available in steps
bthomee Dec 16, 2025
364f04f
Add sloppiness to increase cache hits
bthomee Dec 16, 2025
bc70a96
Improve comments describing the ccache env vars
bthomee Dec 16, 2025
d387880
Improve ccache enabled statement
bthomee Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/scripts/strategy-matrix/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
f"-{architecture['platform'][architecture['platform'].find('/') + 1 :]}"
)
config_name += f"-{build_type.lower()}"
if "-Dcoverage=ON" in cmake_args:
config_name += "-coverage"
if "-Dunity=ON" in cmake_args:
config_name += "-unity"

Expand Down
56 changes: 28 additions & 28 deletions .github/scripts/strategy-matrix/linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,196 +15,196 @@
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "gcc",
"compiler_version": "15",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "16",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "17",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "18",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "19",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "bookworm",
"compiler_name": "clang",
"compiler_version": "20",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "gcc",
"compiler_version": "15",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "clang",
"compiler_version": "20",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "debian",
"distro_version": "trixie",
"compiler_name": "clang",
"compiler_version": "21",
"image_sha": "0525eae"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "8",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "8",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "9",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "10",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "rhel",
"distro_version": "10",
"compiler_name": "clang",
"compiler_version": "any",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "ubuntu",
"distro_version": "jammy",
"compiler_name": "gcc",
"compiler_version": "12",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "gcc",
"compiler_version": "13",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "gcc",
"compiler_version": "14",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "16",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "17",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "18",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
},
{
"distro_name": "ubuntu",
"distro_version": "noble",
"compiler_name": "clang",
"compiler_version": "19",
"image_sha": "e1782cd"
"image_sha": "ca4517d"
}
],
"build_type": ["Debug", "Release"],
Expand Down
52 changes: 43 additions & 9 deletions .github/workflows/reusable-build-test-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,31 @@ jobs:
container: ${{ inputs.image != '' && inputs.image || null }}
timeout-minutes: 60
env:
ENABLED_VOIDSTAR: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
ENABLED_COVERAGE: ${{ contains(inputs.cmake_args, '-Dcoverage=ON') }}
# Enable ccache only for PR commits, merge_group, most pushes, and
# scheduled builds in the XRPLF organization. We do not enable ccache for
# PRs from forks as they do not have access to our remote cache storage.
# We further do not enable ccache for push events to the master or a
# release branch, to protect against the rare case that the output
# produced by ccache is not identical to a regular compilation.
CCACHE_ENABLED: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'pull_request' || github.event_name == 'merge_group' || ( github.event_name == 'push' && !(github.base_ref == 'master' || startsWith(github.base_ref, 'release'))) || github.event_name == 'schedule') }}
# Use a namespace to keep the objects separate for each configuration.
CCACHE_NAMESPACE: ${{ inputs.config_name }}
# Ccache supports both Redis and HTTP endpoints.
# * For Redis, use the following format: redis://ip:port, see
# https://github.com/ccache/ccache/wiki/Redis-storage. Note that TLS is
# not directly supported by ccache, and requires use of a proxy.
# * For HTTP use the following format: http://ip:port/cache when using
# nginx as backend or http://ip:port|layout=bazel when using Bazel
# Remote Cache, see https://github.com/ccache/ccache/wiki/HTTP-storage.
# Note that HTTPS is not directly supported by ccache.
CCACHE_REMOTE_ONLY: true
CCACHE_REMOTE_STORAGE: http://cache.dev.ripplex.io:8080|layout=bazel
# Ignore the creation and modification timestamps on files, since the
# header files are copied into separate directories by CMake, which will
# otherwise result in cache misses.
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime
COVERAGE_ENABLED: ${{ contains(inputs.cmake_args, '-Dcoverage=ON') }}
VOIDSTAR_ENABLED: ${{ contains(inputs.cmake_args, '-Dvoidstar=ON') }}
steps:
- name: Cleanup workspace (macOS and Windows)
if: ${{ runner.os == 'macOS' || runner.os == 'Windows' }}
Expand All @@ -79,7 +102,11 @@ jobs:
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@2ece4ec6ab7de266859a6f053571425b2bd684b6
with:
disable_ccache: false
disable_ccache: ${{ env.CCACHE_ENABLED == 'false' }}

- name: Set ccache log file
if: ${{ env.CCACHE_ENABLED == 'true' && runner.debug }}
run: echo "CCACHE_LOGFILE=${{ runner.temp }}/ccache.log" >> "${GITHUB_ENV}"

- name: Print build environment
uses: ./.github/actions/print-env
Expand Down Expand Up @@ -129,14 +156,21 @@ jobs:
--parallel "${BUILD_NPROC}" \
--target "${CMAKE_TARGET}"

- name: Show ccache statistics
if: ${{ env.CCACHE_ENABLED == 'true' }}
run: |
ccache --show-stats -vv
if [ '${{ runner.debug }}' = '1' ]; then
cat "${CCACHE_LOGFILE}"
curl ${CCACHE_REMOTE_STORAGE%|*}/status
fi

- name: Upload the binary (Linux)
if: ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
env:
BUILD_DIR: ${{ inputs.build_dir }}
with:
name: xrpld-${{ inputs.config_name }}
path: ${{ env.BUILD_DIR }}/xrpld
path: ${{ inputs.build_dir }}/xrpld
retention-days: 3
if-no-files-found: error

Expand All @@ -153,7 +187,7 @@ jobs:
fi

- name: Verify presence of instrumentation (Linux)
if: ${{ runner.os == 'Linux' && env.ENABLED_VOIDSTAR == 'true' }}
if: ${{ runner.os == 'Linux' && env.VOIDSTAR_ENABLED == 'true' }}
working-directory: ${{ inputs.build_dir }}
run: |
./xrpld --version | grep libvoidstar
Expand Down Expand Up @@ -188,7 +222,7 @@ jobs:
netstat -an

- name: Prepare coverage report
if: ${{ !inputs.build_only && env.ENABLED_COVERAGE == 'true' }}
if: ${{ !inputs.build_only && env.COVERAGE_ENABLED == 'true' }}
working-directory: ${{ inputs.build_dir }}
env:
BUILD_NPROC: ${{ steps.nproc.outputs.nproc }}
Expand All @@ -201,7 +235,7 @@ jobs:
--target coverage

- name: Upload coverage report
if: ${{ github.repository_owner == 'XRPLF' && !inputs.build_only && env.ENABLED_COVERAGE == 'true' }}
if: ${{ github.repository_owner == 'XRPLF' && !inputs.build_only && env.COVERAGE_ENABLED == 'true' }}
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
with:
disable_search: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-conan-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Prepare runner
uses: XRPLF/actions/prepare-runner@2ece4ec6ab7de266859a6f053571425b2bd684b6
with:
disable_ccache: false
disable_ccache: true

- name: Print build environment
uses: ./.github/actions/print-env
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ elseif(MSVC)
add_compile_options(/wd4068) # Ignore unknown pragmas
endif()

# Enable ccache to speed up builds.
include(Ccache)

# make GIT_COMMIT_HASH define available to all sources
find_package(Git)
if(Git_FOUND)
Expand Down
Loading
Loading