Compare commits

...

12 Commits

Author SHA1 Message Date
JCW
d1e7fdf329 Address PR comments 2026-06-11 16:06:48 +01:00
JCW
3add486782 Fix PR comments 2026-06-11 15:45:24 +01:00
Jingchen
39b208f902 Update .github/scripts/strategy-matrix/generate.py
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2026-06-11 15:30:33 +01:00
Jingchen
436b18ff82 Update .github/scripts/strategy-matrix/generate.py
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
2026-06-11 15:30:25 +01:00
JCW
1c812e4b9d Fix build error 2026-06-11 14:40:34 +01:00
JCW
af5417d772 Address a PR comment 2026-06-11 14:39:11 +01:00
JCW
5d5124010c Restore temporary changes 2026-06-11 14:32:02 +01:00
JCW
52b79e3ab6 Exclude msvc 2026 until we deploy the runners 2026-06-11 14:30:52 +01:00
JCW
81c896cc3c Fix formatting 2026-06-11 13:50:29 +01:00
JCW
27da3fd0ad Fix the security issue 2026-06-11 13:49:50 +01:00
JCW
365a829d4d Temporarily disable mac and linux 2026-06-11 13:34:13 +01:00
JCW
69aadde85c Update ci pipeline to allow switching between msvc versions 2026-06-11 13:32:03 +01:00
6 changed files with 74 additions and 4 deletions

View File

@@ -22,6 +22,10 @@ inputs:
description: "The sanitizers to enable."
required: false
default: ""
compiler_version:
description: "Override the Conan compiler.version (e.g. msvc '194' or '195'). Leave empty to auto-detect."
required: false
default: ""
runs:
using: composite
@@ -34,9 +38,11 @@ runs:
BUILD_TYPE: ${{ inputs.build_type }}
LOG_VERBOSITY: ${{ inputs.log_verbosity }}
SANITIZERS: ${{ inputs.sanitizers }}
COMPILER_VERSION_SETTING: ${{ inputs.compiler_version != '' && format('--settings:all compiler.version={0}', inputs.compiler_version) || '' }}
run: |
conan install \
--profile:all ci \
${COMPILER_VERSION_SETTING} \
--build="${BUILD_OPTION}" \
--options:host='&:tests=True' \
--options:host='&:xrpld=True' \

View File

@@ -102,6 +102,23 @@ class PlatformConfig:
self.build_type = [self.build_type]
@dataclasses.dataclass
class Toolset:
"""One entry in windows.json's 'toolsets' array (Windows only).
Each toolset selects a Visual Studio version: the CMake generator drives
the configure step, and compiler_version pins the matching Conan msvc
toolset so dependencies are built against the same compiler.
"""
name: str # short config-name suffix, e.g. "vs2022"
generator: str # CMake generator, e.g. "Visual Studio 17 2022"
compiler_version: str = "" # Conan msvc compiler.version, e.g. "194"
# If true, the toolset is skipped entirely. Useful to disable a toolset
# until the runners have the matching Visual Studio version installed.
exclude: bool = False
@dataclasses.dataclass
class PlatformFile:
"""Shape of macos.json and windows.json."""
@@ -109,6 +126,7 @@ class PlatformFile:
platform: str # e.g. "macos/arm64" or "windows/amd64"
runner: list[str] # GitHub Actions runner labels
configs: list[PlatformConfig]
toolsets: list[Toolset] = dataclasses.field(default_factory=list)
@classmethod
def load(cls, path: Path) -> "PlatformFile":
@@ -117,6 +135,7 @@ class PlatformFile:
platform=data["platform"],
runner=data["runner"],
configs=[PlatformConfig(**c) for c in data["configs"]],
toolsets=[Toolset(**t) for t in data.get("toolsets", [])],
)
@@ -144,6 +163,8 @@ class MatrixEntry:
sanitizers: str
image: str = "" # container image; empty for macOS/Windows (runs natively)
compiler: str = "" # compiler name ("gcc" or "clang"); empty for macOS/Windows
generator: str = "Ninja" # CMake generator; defaults to Ninja (Linux/macOS)
compiler_version: str = "" # Conan MSVC compiler.version; empty auto-detects
@dataclasses.dataclass
@@ -247,25 +268,39 @@ def expand_platform_matrix(
) -> list[MatrixEntry]:
"""Expand a PlatformFile (macOS or Windows) into matrix entries.
Configs that exclude the current event are skipped.
Configs that exclude the current event are skipped, as are toolsets that
are marked as excluded.
When toolsets are defined (Windows), the configs are expanded over the
cross-product with the toolsets so each config is built against every
Visual Studio version. Platforms without toolsets (macOS) use a single
implicit toolset that builds with the Ninja generator.
"""
platform_name, arch = pf.platform.split("/")
is_windows = platform_name == "windows"
active_toolsets = [t for t in pf.toolsets if not t.exclude] if pf.toolsets else []
toolsets = (
active_toolsets if active_toolsets else [Toolset(name="", generator="Ninja")]
)
entries: list[MatrixEntry] = []
for cfg in pf.configs:
for toolset, cfg in itertools.product(toolsets, pf.configs):
if not runs_on_event(cfg.exclude_event_types, event):
continue
for build_type in cfg.build_type:
name_parts = [platform_name, arch, toolset.name, build_type.lower()]
entries.append(
MatrixEntry(
config_name=f"{platform_name}-{arch}-{build_type.lower()}",
config_name="-".join(p for p in name_parts if p),
cmake_args=get_cmake_args(build_type, cfg.extra_cmake_args),
cmake_target="install" if is_windows else "all",
build_only=cfg.build_only,
build_type=build_type,
architecture=Architecture(platform=pf.platform, runner=pf.runner),
sanitizers="",
generator=toolset.generator,
compiler_version=toolset.compiler_version,
)
)
return entries

View File

@@ -1,6 +1,19 @@
{
"platform": "windows/amd64",
"runner": ["self-hosted", "Windows", "devbox"],
"toolsets": [
{
"name": "vs2022",
"generator": "Visual Studio 17 2022",
"compiler_version": "194"
},
{
"name": "vs2026",
"generator": "Visual Studio 18 2026",
"compiler_version": "195",
"exclude": true
}
],
"configs": [
{ "build_type": "Release" },
{

View File

@@ -63,6 +63,17 @@ on:
type: string
default: ""
generator:
description: "The CMake generator to use (Linux/macOS use Ninja)."
required: true
type: string
compiler_version:
description: "Override the Conan compiler.version (Windows Visual Studio toolset). Leave empty to auto-detect."
required: false
type: string
default: ""
secrets:
CODECOV_TOKEN:
description: "The Codecov token to use for uploading coverage reports."
@@ -150,15 +161,17 @@ jobs:
# amount of logs. For other OSes, the "verbose" logs are more useful.
log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
sanitizers: ${{ inputs.sanitizers }}
compiler_version: ${{ inputs.compiler_version }}
- name: Configure CMake
working-directory: ${{ env.BUILD_DIR }}
env:
BUILD_TYPE: ${{ inputs.build_type }}
CMAKE_ARGS: ${{ inputs.cmake_args }}
GENERATOR: ${{ inputs.generator }}
run: |
cmake \
-G '${{ runner.os == 'Windows' && 'Visual Studio 17 2022' || 'Ninja' }}' \
-G "$GENERATOR" \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
${CMAKE_ARGS} \

View File

@@ -50,5 +50,7 @@ jobs:
config_name: ${{ matrix.config_name }}
sanitizers: ${{ matrix.sanitizers }}
compiler: ${{ matrix.compiler || '' }}
generator: ${{ matrix.generator }}
compiler_version: ${{ matrix.compiler_version || '' }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -105,6 +105,7 @@ jobs:
# amount of logs. For other OSes, the "verbose" logs are more useful.
log_verbosity: ${{ runner.os == 'Windows' && 'quiet' || 'verbose' }}
sanitizers: ${{ matrix.sanitizers }}
compiler_version: ${{ matrix.compiler_version || '' }}
- name: Log into Conan remote
if: ${{ github.repository == 'XRPLF/rippled' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}