From 36f1cd6193dd0599939962a94b818100d14d2b0f Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 19 Jul 2026 09:33:07 +0900 Subject: [PATCH] sync-versions: exclude git-fetched upstream sources from Cat 1 sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cat 1 discovery treated every local/recipes/*\/source/Cargo.toml as an in-house crate, including git-fetched upstream sources like brush (git = github.com/reubeno/brush). Rewriting upstream crate versions to the branch version broke upstream-internal version requirements (brush-shell was forced to 0.3.1 while brush required ^0.4.0 — 'failed to select a version for the requirement brush-shell = ^0.4.0'). Guard: skip any crate whose Cargo.toml is not tracked by the parent repo. In-house crates are tracked trees (no independent .git); fetched sources are gitignored and untracked. Restores correct classification: 75 crates checked (12 fetched-source crates now excluded), drift 0, brush cooks successfully again. --- local/scripts/sync-versions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/local/scripts/sync-versions.sh b/local/scripts/sync-versions.sh index c2178098dc..2633811c4c 100755 --- a/local/scripts/sync-versions.sh +++ b/local/scripts/sync-versions.sh @@ -104,6 +104,16 @@ should_exclude() { [[ "$path" == *"$ex"* ]] && return 0 done + # Skip git-fetched upstream sources. Fetched recipe sources (e.g. brush + # from github) live in gitignored, untracked source/ trees; their crate + # versions belong to upstream, not to the Cat 1 in-house branch-version + # policy. Rewriting them breaks upstream-internal version requirements + # (this happened: brush-shell was forced to 0.3.1 while brush required + # ^0.4.0, breaking the build). In-house crates are tracked trees. + if ! git ls-files --error-unmatch "$path" >/dev/null 2>&1; then + return 0 + fi + return 1 }