Repository navigation
Stop the second vcpkg racing the first one's exit - #31
Merged
Merged
Conversation
On a fresh clone there is nothing to remove, so `vcpkg remove` returned in milliseconds and the install behind it hit "another vcpkg may be running against the same directory": the telemetry uploader vcpkg forks as it exits inherits the lock on the installed tree. The installed set is now read from disk, so the common case runs no vcpkg at all, and metrics are off so no invocation leaves a child holding the lock. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
compgen -G globs the whole string, so a Windows-spelled VCPKG_ROOT would have its backslashes read as escapes and the gate would never fire there. find takes the directory as an operand, the way every other path in this script reaches the filesystem. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request disables vcpkg metrics telemetry to prevent lock inheritance issues and optimizes the RocksDB removal step by checking for its existence on disk before running the remove command. The reviewer pointed out that using the find command can fail on Windows runners if the native Windows find.exe takes precedence in the PATH, and suggested replacing it with a native Bash glob loop that normalizes path separators for better compatibility and performance.
`find` is one of the few names that collides with a System32 executable, and the workflow's bash runs with --noprofile --norc, so nothing guarantees MSYS's comes first; a native find.exe would reject the arguments and be swallowed. Normalizing the separators first makes a plain glob safe on every runner. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⊙ Problem
linux-x64-glibcfailed in run 37985294418, 1.4 seconds intoBuild RocksDB:The
vcpkg remove#27 added has nothing to do on a fresh clone, so it returns in milliseconds; vcpkg forks a telemetry uploader as it exits, that child inherits the lock on the installed tree, and the install behind it reports a concurrent vcpkg rather than waiting.The race is timing-dependent — the previous dispatch cleared the same sequence — so it has been latent since #27 rather than new.
💡 Solution
Two changes, each addressing one half.
Nothing is removed on a fresh tree, so do not run vcpkg to discover that. The installed set is read from
installed/vcpkg/info/, which costs no process and removes this failure mode from the case that hit it. Warm trees and re-runs keep the protection #27 added.Metrics off, so no invocation leaves a child holding the lock. This is the half that covers the two installs running back to back, which the gate does not.
🔧 Changes
.github/scripts/build-rocksdb-variants.shVCPKG_DISABLE_METRICS=1for every invocation, and the removal step runs only when something is installed.✅ Verification
set -euo pipefail: a warm tree names the installed.listand removes, the same tree under another triplet skips, and a nonexistent tree skips without trippingset -e.arm64-osx-statictaking the removal path: both variants built, public headers identical, both libraries staged.nm59 vs 0, probeuser_key_comparison_count40,959 vs 0.shellcheckclean.The gate first used
compgen -G, which review caught would never fire on a Windows-spelledVCPKG_ROOT:compgenglobs the whole string and\ais an escape.findtakes the directory as an operand, the way every other path in this script reaches the filesystem. Confirmed withprintf-displayed paths thatcompgen -Gmatches a forward-slash path and not a backslash one.Not verified here: the race itself, which is timing-dependent and did not reproduce locally; and the gate on Windows, where
findrelies on the MSYS path translation macOS does not have. If the gate ever answers wrongly the build fails loudly rather than shipping the wrong library — the staged libraries must differ, which is the check that caught the original superset bug.🤖 Generated by Claude (Anthropic); posted via @cb1kenobi.
Related PRs: #27 overlaps (added the removal step this races with; merged), #30 overlaps (merged)
Complexity: medium
Review-Coverage: authored=claude; ran=codex,gemini,cursor-composer,cursor-muse; adjudicated=domain; blocked=cursor-grok(failed); declined=cursor-kimi; rounds=2; full=2 @ f9e6f08
Review-Attention: study ~12m (critical: build-rocksdb-variants.sh; decisions: remove-gate, metrics-opt-out-layer) @ f9e6f08