Skip to content

fix(vendor): Read the version upstream main would stamp, and refuse a shallow clone - #2683

Open
krlmlr wants to merge 1 commit into
mainfrom
claude/gallant-edison-i2kneb
Open

fix(vendor): Read the version upstream main would stamp, and refuse a shallow clone#2683
krlmlr wants to merge 1 commit into
mainfrom
claude/gallant-edison-i2kneb

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

scripts/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. 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_describe by name. Upstream keeps that resolver under two names now: 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.

What that costs today

On the main line the import raises, the probe answers empty, and the guard is inert — behind a warning that fires on every vendor run against main and therefore says nothing:

$ VENDOR_REPO=<main-build worktree> scripts/vendor-one.sh --commits 1 <full upstream clone>
Warning: could not read the version duckdb would stamp
$ cd <fresh clone of duckdb/duckdb at 154c2c8d5f>
$ python3 -c 'import sys; sys.path.insert(0, "scripts"); from package_build import get_git_describe'
ImportError: cannot import name 'get_git_describe' from 'package_build'

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. main and main-fwd are the two that vendor most often.

The fix

The probe takes whichever name the clone exposes:

git_dev_version -> v2.1.0-dev83387

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()'s v0.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 than v0.0.0 because 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:

  • full clone at upstream main — resolves via git_dev_version, no warning, vendors on.
  • full clone at upstream v1.4-andium — resolves via get_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 main and main-fwd and 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

… 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
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.

2 participants