Fix standalone setup.cmake version resolution to avoid invalid vX.Y.Z checkout#21
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/stlab/cpp-library/sessions/3f8652a3-2a74-48f7-94f1-7102987d4f18 Co-authored-by: sean-parent <2279724+sean-parent@users.noreply.github.com>
Agent-Logs-Url: https://github.com/stlab/cpp-library/sessions/3f8652a3-2a74-48f7-94f1-7102987d4f18 Co-authored-by: sean-parent <2279724+sean-parent@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix initialization failure in quick start setup
Fix standalone May 19, 2026
setup.cmake version resolution to avoid invalid vX.Y.Z checkout
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dcab025. Configure here.
- Updated regex to exclude pre-release tags from version extraction. - Introduced a new function to assert the correct CPM specification format. - Added tests to validate the setup.cmake version resolution logic and ensure proper handling of release and branch references. This improves the robustness of version handling in the project setup.
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.

Quick-start usage of downloaded
setup.cmake(curl ... && cmake -P setup.cmake) could not resolve a local git tag, emittedX.Y.Z, and generatedCPMAddPackage("gh:stlab/cpp-library@X.Y.Z"), which fails at checkout. This change makes standalone setup resolve a valid ref instead of producing an unusable placeholder.Version resolution in
setup.cmakegit describe --tags --abbrev=0).stlab/cpp-library, extract semver tags, and select the latest version.TIMEOUT 10) to avoid hanging on restricted networks.X.Y.Ztomainas a safe last resort.Regression coverage for quick-start path
tests/setup/test_setup_version_resolution.cmaketo exercise the standalone-script flow.@X.Y.Z@<semver>or@mainCI integration
Note
Medium Risk
Moderate risk because it changes version/ref selection logic in
setup.cmakeand introduces a network-dependent fallback (git ls-remote, timeout 10s) that could behave differently across environments.Overview
Fixes standalone
setup.cmakegeneration so it no longer emits an unusableCPMAddPackage("...@X.Y.Z")placeholder when no local git tags are available.setup.cmakenow resolves the cpp-library ref by preferring localgit describe, otherwise querying remote tags and selecting the latest semver (excluding prerelease tag substrings), and finally falling back to#main; it also switches CPM usage to@<semver>for releases and#<ref>for branches/commits. Adds a newtests/setup/test_setup_version_resolution.cmakeregression test and runs it in CI.Reviewed by Cursor Bugbot for commit a2b55bb. Bugbot is set up for automated code reviews on this repo. Configure here.