fix(vendor): Read the version upstream main would stamp, and refuse a shallow clone - #2683
Open
krlmlr wants to merge 1 commit into
Open
fix(vendor): Read the version upstream main would stamp, and refuse a shallow clone#2683krlmlr wants to merge 1 commit into
main would stamp, and refuse a shallow clone#2683krlmlr wants to merge 1 commit into
Conversation
… a shallow clone `vendor-one.sh` probes the version the upstream clone would stamp so that a clone which cannot produce a real one is refused before it vendors anything. The probe imported `package_build.get_git_describe` by name. Upstream keeps that resolver under two names: `get_git_describe()` on the release branches, and `git_dev_version()` on `main`, which no longer describes tags at all and composes `scripts/ci/release_version.txt` with the commit count instead. So on `main` the import raised, the probe answered empty, and the guard stopped guarding the busiest series -- behind a warning that fired on every vendor run and therefore said nothing. The probe now takes whichever name the clone exposes. Its placeholder check is unchanged, and still only fires for `get_git_describe()`'s `v0.0.0-0-gdeadbeeff`: `git_dev_version()` has no placeholder, because a shallow clone counts its own grafted subset and answers a plausible wrong number. That half is closed directly instead, by refusing a shallow clone -- the condition the placeholder was only ever a proxy for, and the one that holds on every branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HQgZFwtbUFw3XR6fbWzwGy
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.
scripts/vendor-one.shprobes the version the upstream clone would stamp, so that a clone which cannot produce a real one is refused before it vendors anything. A tree stamped with a placeholder builds, installs and passes the glue gate, and then 404s on every extension download — one whole CI cycle later, wearing the shape of an engine failure.The probe imported
package_build.get_git_describeby name. Upstream keeps that resolver under two names now:get_git_describe()on the release branches, andgit_dev_version()onmain, which no longer describes tags at all and composesscripts/ci/release_version.txtwith the commit count instead.What that costs today
On the
mainline the import raises, the probe answers empty, and the guard is inert — behind a warning that fires on every vendor run againstmainand therefore says nothing:The same probe answers on
v1.4-andium(v1.4.5-2-g6fc5718088), which is why this went unnoticed: four of the six live series still resolve.mainandmain-fwdare the two that vendor most often.The fix
The probe takes whichever name the clone exposes:
which is exactly what
main-build's vendored tree carries today (src/duckdb/src/function/table/version/pragma_version.cpp), so the probe is again reading the number that will be stamped.The placeholder check is unchanged and still only fires for
get_git_describe()'sv0.0.0-0-gdeadbeeff.git_dev_version()has no placeholder to match: a shallow clone counts its own grafted subset and answers a plausible wrong-devN, which is worse thanv0.0.0because nothing looks wrong. So that half is closed directly, by refusing a shallow clone — the condition the placeholder was only ever a proxy for, and the one that holds on every branch.Checked
Four cases, with
main's tree and this script:main— resolves viagit_dev_version, no warning, vendors on.v1.4-andium— resolves viaget_git_describe, no warning, vendors on.git clone --no-tags(full history, no tags) — the original guard fires,exit 6.git clone --depth 5— the new guard fires,exit 6.Found by the 2026-09-06 series-loop firing, which ran stage 1 against all six series and saw the warning on
mainandmain-fwdand nothing on the other four. Nothing was vendored — upstream had not moved — so no workaround was needed and none was applied.🤖 Generated with Claude Code
https://claude.ai/code/session_01HQgZFwtbUFw3XR6fbWzwGy
Generated by Claude Code