Skip to content

Fix archive verification on Linux and Windows - #28

Merged
cb1kenobi merged 9 commits into
mainfrom
chris/fix-probe-cxx20-and-windows-paths
Oct 9, 2026
Merged

cb1kenobi merged 9 commits into
mainfrom
chris/fix-probe-cxx20-and-windows-paths

Conversation

@cb1kenobi

@cb1kenobi cb1kenobi commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

⊙ Problem

The first real dispatch of the two-variant prebuild (run 37855264608, v11.8.1-perf-context-test) passed both macOS targets and failed the other eight, all in the Verify release archive step that #27 added. build.yml runs only on schedule and workflow_dispatch, so no PR can exercise that step and both defects reached main.

The feature itself was fine on all ten targets. windows-arm64 shows the whole mechanism working: vcpkg remove, both variants built from the one portfile, the portfile guard firing in both directions, byte-identical headers, and correct Windows naming. Only the checker was broken.

❓ Your call: This fixes the failures as they stand. The deeper issue is that a step which can only run post-merge got merged on the strength of a single-platform local run. A dry-run branch with the release job disabled gives all ten targets as workflow artifacts without publishing anything, and would have caught both of these. Worth making that a standard step before merging anything that touches the build or verification scripts?

💡 Solution

Two independent causes, both in code added by #27.

The probe did not compile on GCC or MSVC. tools/perf-context-probe/CMakeLists.txt pinned CMAKE_CXX_STANDARD to 17. RocksDB builds itself at 20 and its installed headers use C++20 constructs — a defaulted operator== in compression_type.h, a using-declaration naming a scoped enumerator in db.h — but it exports no target_compile_features, so nothing communicates that to a consumer. AppleClang accepts those headers at 17, which is exactly why the macOS targets passed and the local testing was green. The probe now asks for 20, matching what RocksDB compiled.

tar cannot open a Windows backslash path. GITHUB_WORKSPACE is D:\a\..., and extraction failed with tar: D\:\a\...: Cannot open. That is before the probe runs, which is why the two targets with run_probe: false failed as well. #27 converted paths only where they were handed to CMake, on the assumption that git-bash tolerates backslashes elsewhere; it does for test and mkdir, not for tar. Each path is now rewritten ahead of its first reader — and only on a Windows shell, since a backslash is an ordinary filename character everywhere else.

🔧 Changes

File What changed
tools/perf-context-probe/CMakeLists.txt CMAKE_CXX_STANDARD 17 → 20, the standard RocksDB built its own headers with.
.github/scripts/verify-prebuild-archive.sh A one-time shell check decides whether backslashes mean separators here, and ARCHIVE is rewritten under it before the existence check that previously read an unconverted path. PROBE_DIR and SCRATCH follow once their defaults resolve. The per-call cmake_path helper is removed as redundant.

✅ Verification

Route: local rebuild and archive verification on darwin-arm64, plus targeted path cases. The platforms that actually failed cannot be reproduced locally — that is the point of the judgment call above.

  • Full rebuild of both variants and archive verification pass with the C++20 probe: counter-name markers 1 vs 0, nm references 59 vs 0, probe user_key_comparison_count 40,959 vs 0.
  • A forced-Windows run with backslashes in both ARCHIVE and SCRATCH converts and verifies, covering the ordering defect the review found.
  • An archive under a directory literally named back\slash-test is found and verified. Under the unconditional rewrite the review caught, it resolved to /tmp/back/slash-test/… and exited 2.
  • A missing archive still reports no such archive: … rather than failing obscurely.
  • An ordinary Unix path is unaffected.
  • shellcheck clean.

Not verified here: MSVC, Alpine GCC and real Windows tar. The next dispatch is the first execution of all three. The /Z7 CodeView marker-count reasoning in verify-prebuild-archive.sh is also still unproven, because every Windows job died at extraction before reaching it.

🤖 Generated by Claude (Anthropic); posted via @cb1kenobi.

Related PRs: #27 overlaps (this repairs the verification step it added; merged), #26 overlaps (merged; its own changes contain neither defect)
Complexity: medium

Review-Coverage: authored=claude; ran=cursor-composer,codex,gemini,cursor-muse; adjudicated=domain; declined=cursor-grok,cursor-kimi; rounds=8; full=2 @ 98e1fc9

Review-Attention: read ~3m (decisions: cxx20-at-consumer, release-time-proof, document-not-convert-extra-args) @ 98e1fc9

cb1kenobi and others added 3 commits October 8, 2026 23:25
The first real dispatch of the two-variant build passed both macOS
targets and failed the other eight, in the verification step this
repository has no way to exercise before merge. Two independent causes.

The probe pinned CMAKE_CXX_STANDARD to 17. RocksDB builds itself at 20
and its installed headers use C++20 constructs - a defaulted operator==,
a using-declaration naming a scoped enumerator - but it exports no
target_compile_features, so nothing tells a consumer. AppleClang accepts
those headers at 17, which is why only macOS passed; GCC and MSVC reject
them. The probe now asks for 20, matching what RocksDB compiled.

GITHUB_WORKSPACE is a backslash path on Windows runners, and tar cannot
open one: all four Windows targets failed at extraction, before the
probe, which is why the two with run_probe: false failed too. Paths were
previously converted only where they were passed to CMake. They are now
converted once, on entry, for every tool that receives them.

Verified on darwin-arm64: a full rebuild of both variants and archive
verification pass with the C++20 probe, and a deliberately
backslash-separated SCRATCH, which tar cannot open unconverted, now
extracts and verifies. The Linux and Windows paths remain exercisable
only by a workflow run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The existence check ran on the unconverted path. It passed on the failing
run because MSYS's test resolves a backslash path, which is the same
accident that made the old tar call look safe. Conversion now happens on
entry, ahead of every read.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
xz opens the archive; tar only receives the extraction directory, which
is the path it actually refused.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors path handling in .github/scripts/verify-prebuild-archive.sh to convert Windows backslash paths to Unix-style forward slashes on entry, and updates the C++ standard to 20 in tools/perf-context-probe/CMakeLists.txt. The review feedback suggests optimizing the path conversion in the shell script by using native Bash parameter expansion directly instead of a helper function and command substitution, which avoids subshell overhead.

Comment thread .github/scripts/verify-prebuild-archive.sh Outdated
Comment thread .github/scripts/verify-prebuild-archive.sh Outdated
cb1kenobi and others added 6 commits October 9, 2026 00:07
A helper that only wraps ${var//\\//} put a subshell between each path and its
one use. Gemini raised it on #28.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both blocks narrated the change that introduced them. Keep the lasting part:
Windows workspace paths need converting before xz, tar and CMake read them,
and RocksDB's installed headers require C++20 without exporting it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This repo builds whatever RocksDB tag the dispatch asks for, defaulting to the
latest release, so naming one goes stale on the next build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A backslash is an ordinary filename character on Linux and macOS, so the
unconditional rewrite turned a legal path into one that does not exist.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PROBE_CMAKE_ARGS reaches cmake unexamined, so a caller spelling a path value
with backslashes would get CMake escapes. Nothing in the matrix passes a path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The case list also matches Cygwin, MinGW and win32.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cb1kenobi
cb1kenobi marked this pull request as ready for review October 9, 2026 05:50
@cb1kenobi
cb1kenobi merged commit 7b1b587 into main Oct 9, 2026
@cb1kenobi
cb1kenobi deleted the chris/fix-probe-cxx20-and-windows-paths branch October 9, 2026 05:55
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.

1 participant