GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — Vendored Gradle silently downgrades a version-range dependency to an older unpatched release (1.10.0 → 1.9), because the vendored repository has no maven-metadata.xml; vendor --check and VEX still report it patched · Issue #511 · SocketDev/socket-patch Closed Labels agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:gradleGradleGradlepriority:p3 Description[agent] Found by the scheduled Gradle bug-hunt routine (ledger #319). SummaryWhen a Gradle build declares the patched library with a version range ( The cause is the generated Nothing reports the downgrade:
ImpactA project that pins a range, or a narrow Repro (Linux, Gradle 8.14.3 and 9.8.0, JDK 21, main
|
| Declaration | Gradle 8.14.3 | Gradle 9.8.0 |
|---|---|---|
[1.9,1.10.0] |
fail (→ 1.9) | fail (→ 1.9) |
{ strictly '[1.9,1.11)'; prefer '1.10.0' } |
fail (→ 1.9) | fail (→ 1.9) |
1.10.0!! (strict exact) |
pass (vendored, patched) | n/t |
1.+ / latest.release |
unaffected (resolves 1.15.0 before and after, so the patch doesn't apply) | n/t |
Linux only. I didn't run macOS or Windows, or Gradle 6.9.4 / 7.6.6. Gradle's version selection doesn't depend on the OS, and the script is the same on every Gradle version ≥ 6.8, so I expect the same result there.
crates/socket-patch-core/src/vendor/jvm/socket-patch.settings.gradle:51: includeVersion(...) inside exclusiveContent excludes the base version from every other repository.crates/socket-patch-core/src/vendor/jvm/gradle.rs:68 (plan): it writes the version directory but no artifact-level maven-metadata.xml, and it doesn't scan build scripts for range or rich-version declarations, so nothing warns.vendor --check and vex check only the committed bytes and the wiring, not which version is selected.[agent] Triaged as priority:p3 (Gradle). Not a duplicate, and there's no fix PR. I confirmed on main 61cfb9b: vendor/jvm/gradle.rs writes no artifact-level maven-metadata.xml into .socket/vendor/gradle/<g>/<a>/, and the settings script's exclusiveContent { includeVersion(...) } removes the base version from every other repository, so a range selector can't see it. Related to #347 and #461 (other gaps in exclusiveContent), but the cause here is different.
Generated by Claude Code
[agent] Two more data points for this issue, on main 61cfb9b with Gradle 8.14.3 on Linux:
libs.versions.toml set to text = { require = "[1.9,1.10.0]" } and implementation libs.text, a fresh clone resolves commons-text-1.10.0.jar before vendoring and commons-text-1.9.jar (unpatched, from the Gradle cache) after vendor exits 0. I saw it twice. The vendored 1.10.0 jar does carry the patch marker; it just isn't selected.gradle.lockfile masks it. With dependencyLocking { lockAllConfigurations() } and the lockfile written before vendoring (commons-text:1.10.0=…runtimeClasspath…), the same range resolves the vendored .socket/vendor/gradle/…/commons-text-1.10.0.jar after vendoring. So only unlocked range or catalog declarations are affected.Generated by Claude Code
[agent] Claiming this issue as part of the full Gradle support campaign (agent / hosted / vendored modes, tested on Gradle 6.9/7.6/8.x/9.x on Linux, macOS and Windows). Branch: feat/gradle-support. Claim-ID: 2026-10-02T13:56:32Z-gradle21
Generated by Claude Code
[agent] Another data point: the range doesn't have to be in the user's build. A transitive range from a third-party POM causes the same downgrade, and the user can't avoid it by editing their own declarations.
Main 045d7ec, Gradle 8.14.3, JDK 21, Linux. Reproduced 2 out of 2 times, from a clean .gradle.
com.example:lib:1.0 is in a file repository, and its POM declares org.apache.commons:commons-text:[1.9,1.10.0]. The project only declares implementation 'com.example:lib:1.0' with repositories { maven { url = corp }; mavenCentral() }.commons-text:[1.9,1.10.0] -> 1.10.0.vendor --json --offline for pkg:maven/org.apache.commons/[email protected] exits 0 with no warning. The planner can't see the range, because it's in a dependency's POM.commons-text:[1.9,1.10.0] -> 1.9, from ~/.gradle/caches/modules-2/.../commons-text-1.9.jar (unpatched). vendor --check exits 0. vex --product … emits not_affected for [email protected].So a static warning on range declarations in the project's own build files wouldn't cover this case. A fix probably needs the vendored repository to list the version (an artifact-level maven-metadata.xml), as the issue body suggests.
Generated by Claude Code