You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e02358f
Browse filesBrowse the repository at this point in the historyBrowse files
Stop vendored Gradle liveness attesting a version the lockfile overrides (#2004)
* Stop vendored Gradle liveness attesting a version the lockfile overrides
Vendored Gradle keeps the original GAV and leaves lock files unchanged,
but neither its planner nor its VEX liveness (`wired`, which re-plans)
read any lock file. A `gradle.lockfile` pinning the patched GA at another
version makes Gradle resolve that version (or fail lock validation), yet
vendored liveness still attested the patch.
The planner now reads every lock file of every project of the build with
the shared `gradle::locks` reader (per-project, buildscript, settings and
legacy `gradle/dependency-locks/` files, via `ScriptGraph::lockfile_paths`)
and degrades with `gradle_lock_overrides_vendored` when any of them locks
the patched GA at a version other than the vendored one, or is not UTF-8.
A custom `lockFile` location is degraded with `gradle_custom_lock_file`.
Since `wired` requires a re-plan with no degraded warning, both withhold
VEX attestation; vendoring itself still applies.
Mapping from hosted: hosted pins a suffixed version (below-base lock is
invalid, above-base unattested); vendored serves only its own version, so
any other locked version is unattested. Hosted rejects every settings
classpath lock because its script runs too late; vendored wires that
classpath with an in-block exclusiveContent entry, so a settings lock at
the vendored version is served.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review: route-checked settings locks, shared lock inventory
Review findings on the vendored Gradle lock check:
- A settings-classpath lock is accepted only when that build's settings
script holds the in-block exclusiveContent entry for the GAV in every
block that needs one. Liveness (`wired`) now re-plans with
`Committed::Only`, so it counts only the committed entry, never one a
re-plan would write; vendoring counts the entry it writes. Otherwise
`gradle_settings_lock_unrouted`, as hosted rejects it.
- A lock at another version of the GA that the vendored index also
serves is not an override, so two vendored versions of one GA no
longer degrade each other.
- A listed lock file that cannot be read as UTF-8 text (I/O error,
refused symlink, non-UTF-8) fails closed with its own reason,
`gradle_lock_unreadable`, instead of being skipped.
- A custom `lockFile` set as a literal `file(...)` (or
`"$projectDir/..."`) in a project's own build script, inside the
checkout, is read and checked like any lock (missing fails closed);
only an unfollowable one is `gradle_custom_lock_file`.
- One lock inventory: `ScriptGraph::read_locks` (and
`custom_lock_files`), used by hosted discovery and the vendored check;
`is_settings_lock` moves to `gradle::locks`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Judge vendored Gradle liveness on committed wiring only
`wired` re-plans over the committed tree but ignored the re-plan's
writes, so wiring a re-plan would add again stood in for wiring missing
from the checkout. With no settings lock, a settings classpath on the
patched module whose in-block exclusiveContent entry was removed still
attested, and so did every other pending write.
The liveness re-plan (`Committed::Only`) now degrades with
`gradle_wiring_uncommitted` when it would still write any wiring file:
- settings files: in-block `buildscript` / `pluginManagement` entries
(a settings `plugins{}` block added since vendoring included) and the
apply line of every wired build (`buildSrc`, included builds; only the
root's was checked by `references`);
- the index (a row whose hash no longer matches the tree);
- the derived `maven-metadata.xml`;
- `gradle/verification-metadata.xml` (missing patched hashes);
- the script (already checked by `is_ours`).
Tree files (rebuilt from the committed bytes, hashes checked against
the index by the script) and the git hygiene files (`.gitattributes`,
`.gitignore`, which Gradle never reads) do not count. Vendoring's own
first run is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Treat project(...) blocks with long argument lists as foreign
The project(...) exclusion only looked up to 7 tokens ahead for the
block's '{', so a named-argument call such as
project(path: ':a', configuration: 'x') { lockFile = file(...) } was
read as this project's own followable lock and resolved against the
wrong directory. Skip the whole argument list, then look for the
block. Addresses the Bugbot finding on gradle/graph.rs.
Co-Authored-By: Claude <noreply@anthropic.com>
* Follow configure() and hook blocks; keep regenerated verification live
Second review round on vendored Gradle lock liveness.
- FALSE ATTESTATION: "configure" in the foreign-block list never
matched (`all_blocks` wants `name {`, Gradle's form is
`configure(<projects>) { … }`), and per-project hooks
(`gradle.beforeProject`, `afterProject`) were not listed, so a
`lockFile` set there was followed against the root's own directory
and the configured projects' locks were never read. Every foreign
block now skips its argument list and must open right there (or after
one `.method`), which also fixes the converse: a project DEPENDENCY
(`implementation(project(':lib'))`) followed by the script's own
`dependencyLocking` block no longer marks it foreign.
- Liveness counted any byte difference in verification-metadata.xml as
uncommitted wiring, so after `./gradlew --write-verification-metadata`
(the remedy the planner itself names) rewrote the jar entry in
Gradle's form, a working vendoring was dead. The write no longer
counts when the committed file already pins the patched jar's sha256.
- A followed custom `lockFile` equal to an already-listed lock is
checked once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: crates/socket-patch-cli/CLI_CONTRACT.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2633,7 +2633,7 @@ with `reason: <reason>: `:
2633
2633
|---|---|---|
2634
2634
| `vendor_jvm_shape_unsupported` | refusal, nothing written | `gradle_below_6_8`, `android_or_kmp` (also `available-at` module redirects), `gradle_exclusive_content_conflict` (a user rule claiming the module, in any script), `gradle_range_excludes_vendored` (no declared selector admits the vendored version), `gradle_verification_unparseable`, `gradle_index_unreadable`, `build_file_unreadable` (including a non-UTF-8 settings file), `build_file_outside_root`, `not_build_root` (run from a directory an ancestor settings file includes or may include, from a project with no settings file of its own below one, or below an ancestor settings file that is not UTF-8; `repair` refuses there too), `no_build_file` (no `pom.xml`, Gradle, sbt or scala-cli build at the root), `legacy_maven_root` (the root's ledger still holds a pre-v5 single-POM `maven_pom_repository` entry; the whole root is refused until `vendor --revert`, then vendor again) |
2635
2635
| `vendor_jvm_upstream_unavailable` | refusal | `classifier_unavailable` (a declared classifier jar no cache or registry has), `module_unavailable` (the pom declares Gradle module metadata that cannot be sourced), `pom_unavailable`, `verification_metadata_unavailable` |
2636
-
| `vendor_jvm_degraded` | applied, VEX withheld | `gradle_unscanned_build_logic`, `unwired_build_logic` (a nonliteral included build), `settings_plugins_unwired`, `classifier_unpatched_copy` (a classifier jar carries an unpatched copy of a patched member), `verification_parent_chain_unhandled`, `conflicting_managed_version` / `management_unresolved` (Maven reactor: an imported BOM or an out-of-checkout parent manages the artifact at another version, or its POM is unavailable; that local root is not pinned) |
2636
+
| `vendor_jvm_degraded` | applied, VEX withheld | `gradle_unscanned_build_logic`, `unwired_build_logic` (a nonliteral included build), `settings_plugins_unwired`, `classifier_unpatched_copy` (a classifier jar carries an unpatched copy of a patched member), `verification_parent_chain_unhandled`, `gradle_lock_overrides_vendored` (a dependency lock of the build, buildscript and settings classpath locks included, pins the module at a version no vendored row serves), `gradle_settings_lock_unrouted` (a `settings-gradle.lockfile` locks the module but that build's settings script does not hold the in-block repository entry for it), `gradle_lock_unreadable` (a lock file, or a followed custom `lockFile`, is missing, unreadable, outside the checkout or not UTF-8), `gradle_custom_lock_file` (a `lockFile` location that cannot be followed statically: anything but a literal `file(…)` in a project's own build script), `gradle_wiring_uncommitted` (VEX liveness only, never reported by `vendor`: the committed settings files, index, derived `maven-metadata.xml`, script or verification file lack wiring a re-plan would write, such as a removed apply line or in-block entry; the git hygiene files do not count), `conflicting_managed_version` / `management_unresolved` (Maven reactor: an imported BOM or an out-of-checkout parent manages the artifact at another version, or its POM is unavailable; that local root is not pinned) |
2637
2637
| `vendor_jvm_note` | applied, informational | `range_declared` (a range, prefix or rich selector lists versions from the derived `maven-metadata.xml`), `ide_sources_unavailable` |
2638
2638
| `vendor_jvm_upstream_unverified` | warning | Upstream metadata was taken offline and not authenticated against registry checksums. |
0 commit comments