Skip to content

Commit 9a3ab75

Browse files
author
Grok Compression
committed
CI: fix build
1 parent c970fa6 commit 9a3ab75

4 files changed

Lines changed: 266 additions & 39 deletions

File tree

tests/nonregression/CMakeLists.txt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,37 @@ function(add_decoder_test EXE_NAME ARGS INPUT_FILENAME OUTPUT_FILENAME TEST_NUM
198198
else()
199199
if(NOT IS_CORE_DEC)
200200
# MD5 Check: Verify the decoded output against registered md5 checksums
201-
# Build a platform key: e.g. "Linux", "Linux-static", "Darwin", "Windows"
201+
# Build a platform key matching the CI matrix naming convention:
202+
# ubuntu-dynamic, ubuntu-static, macos-dynamic, macos-static,
203+
# windows-dynamic, windows-static
204+
# The canonical md5refs.txt is ubuntu-dynamic, so that combo gets an
205+
# empty key (no platform override file needed).
206+
set(_os_key "")
207+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
208+
set(_os_key "ubuntu")
209+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
210+
set(_os_key "macos")
211+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
212+
set(_os_key "windows")
213+
else()
214+
set(_os_key "${CMAKE_SYSTEM_NAME}")
215+
endif()
202216
if(BUILD_SHARED_LIBS)
203-
set(_md5_platform "${CMAKE_SYSTEM_NAME}")
217+
set(_link_key "dynamic")
218+
else()
219+
set(_link_key "static")
220+
endif()
221+
# ubuntu-dynamic is canonical — no platform key needed
222+
if(_os_key STREQUAL "ubuntu" AND _link_key STREQUAL "dynamic")
223+
set(_md5_platform "")
204224
else()
205-
set(_md5_platform "${CMAKE_SYSTEM_NAME}-static")
225+
set(_md5_platform "${_os_key}-${_link_key}")
206226
endif()
207227
add_test(NAME NR-DEC-${INPUT_FILENAME_NAME}-${TEST_NUM}-decode-md5
208228
COMMAND ${CMAKE_COMMAND}
209229
-DREFFILE:STRING=${CMAKE_CURRENT_SOURCE_DIR}/md5refs.txt
210230
-DOUTFILENAME:STRING=${OUTPUT_FILENAME}
211-
-DSYSTEM_NAME:STRING=${_md5_platform}
231+
-DPLATFORM_KEY:STRING=${_md5_platform}
212232
-P ${CMAKE_CURRENT_SOURCE_DIR}/checkmd5refs.cmake)
213233
set_tests_properties(NR-DEC-${INPUT_FILENAME_NAME}-${TEST_NUM}-decode-md5
214234
PROPERTIES DEPENDS NR-DEC-${INPUT_FILENAME_NAME}-${TEST_NUM}-decode)

tests/nonregression/checkmd5refs.cmake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,20 @@
3535
# This script expects:
3636
# REFFILE: Path to the canonical md5refs.txt file
3737
# OUTFILENAME: The name of the generated file to check
38-
# SYSTEM_NAME: (optional) CMAKE_SYSTEM_NAME — used to select a platform-specific
39-
# md5refs-<SYSTEM_NAME>.txt that overrides REFFILE when it exists.
40-
# This lets Linux/macOS/Windows carry different checksums for
41-
# floating-point-sensitive codecs (e.g. 9/7 wavelet) without
38+
# PLATFORM_KEY: (optional) Platform key string (e.g. "ubuntu-dynamic",
39+
# "macos-static") used to select a platform-specific
40+
# md5refs-<PLATFORM_KEY>.txt that overrides REFFILE when it exists.
41+
# This lets each OS ⨉ linkage combination carry its own checksums
42+
# for floating-point-sensitive codecs (e.g. 9/7 wavelet) without
4243
# requiring separate branches.
4344

4445
# Resolve the active reference file: prefer platform-specific override.
4546
set(ACTIVE_REFFILE "${REFFILE}")
46-
if(SYSTEM_NAME)
47+
if(PLATFORM_KEY)
4748
get_filename_component(_refdir "${REFFILE}" DIRECTORY)
4849
get_filename_component(_refname "${REFFILE}" NAME_WE)
4950
get_filename_component(_refext "${REFFILE}" EXT)
50-
set(_platform_reffile "${_refdir}/${_refname}-${SYSTEM_NAME}${_refext}")
51+
set(_platform_reffile "${_refdir}/${_refname}-${PLATFORM_KEY}${_refext}")
5152
if(EXISTS "${_platform_reffile}")
5253
set(ACTIVE_REFFILE "${_platform_reffile}")
5354
message(STATUS "Using platform-specific MD5 refs: ${_platform_reffile}")

tests/nonregression/collect_ci_md5refs.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@
2323

2424
# Maps artifact name pattern -> platform key for update_md5refs.py
2525
# Artifact names: test-results-<os>-shared_<ON|OFF>
26+
# Platform keys follow CI matrix naming: <os>-<dynamic|static>
27+
# ubuntu-dynamic is canonical (md5refs.txt) — no platform override needed.
2628
ARTIFACT_PLATFORM_MAP = {
27-
("macos-latest", "ON"): "Darwin",
28-
("macos-latest", "OFF"): "Darwin-static",
29-
("windows-latest","ON"): "Windows",
30-
("windows-latest","OFF"): "Windows-static",
29+
("macos-latest", "ON"): "macos-dynamic",
30+
("macos-latest", "OFF"): "macos-static",
31+
("windows-latest","ON"): "windows-dynamic",
32+
("windows-latest","OFF"): "windows-static",
3133
("ubuntu-latest", "ON"): None, # canonical md5refs.txt — skip
32-
("ubuntu-latest", "OFF"): "Linux-static",
34+
("ubuntu-latest", "OFF"): "ubuntu-static",
3335
}
3436

3537

@@ -69,6 +71,10 @@ def main():
6971
parser.add_argument("--repo", default=REPO)
7072
parser.add_argument("--dry-run", action="store_true",
7173
help="Show what would be done without modifying md5refs files")
74+
parser.add_argument("--data-dir", metavar="DIR", action="append",
75+
help="Pass --data-dir to update_md5refs.py for lossy verification")
76+
parser.add_argument("--no-verify", action="store_true",
77+
help="Pass --no-verify to update_md5refs.py to skip lossy check")
7278
args = parser.parse_args()
7379

7480
# Check gh is available
@@ -131,6 +137,11 @@ def main():
131137
print(f"\n--- {name} -> platform key: {platform_key} ---")
132138
cmd = [sys.executable, str(SCRIPT_DIR / "update_md5refs.py"),
133139
"--platform", platform_key, str(log_path)]
140+
if args.data_dir:
141+
for d in args.data_dir:
142+
cmd.extend(["--data-dir", d])
143+
if args.no_verify:
144+
cmd.append("--no-verify")
134145
if args.dry_run:
135146
print(f" [dry-run] would run: {' '.join(cmd)}")
136147
else:

0 commit comments

Comments
 (0)