Repository navigation
Commit e458517
Withhold Maven pins whose coordinates a profile redefines
Closes the last Maven property false-attestation gap in VEX discovery
after #2020: a <groupId> / <artifactId> written as ${prop} that a
profile's <properties> redefine.
Coordinates were read only with no profile active, so discovery
attested two shapes the build may not resolve:
(a) The declaration carrying the pin names another package whenever a
profile redefining its coordinate property is active; the pin then
no longer applies to the patched GA, which resolves from its other
declarations or transitively, unpinned.
(b) Another declaration (live, or inside a profile whose own properties
retarget it) becomes the patched GA under a profile, at its own
version off the pin.
Both readers now resolve coordinates through #2020's shared helpers
(formats::maven::properties): the groupId and artifactId are joined
with COORDINATE_SEPARATOR (U+0001, which XML 1.0 forbids) so one
profile_combinations walk and one interpolation per combination read
both under the same active profiles, through interpolate_keeping (the
keep-unresolved interpolate_lenient as an Interpolate), and
split_coordinates splits the result.
formats/maven: PomScope::coordinate_alternatives runs the joined text
through resolve_in_build; PomDep carries group_text / artifact_text and
coordinate_alternatives (CoordinateAlternative: group, artifact,
MovedBy), every pair some combination gives other than the no-profile
reading (ScopedDep.group / artifact, unchanged), plus a profile
declaration's own-profile reading. More than 8 relevant profiles or an
unreadable profile fail closed (the text as written, which may_name
reads as any text).
vex/discover/maven: bypasses() runs coordinate_override after
profile_override, reported as MavenProfileUnpatched (detail names the
profiles), for (a) the live main-jar declaration carrying the pin
(build_version == pin) with any alternative, and (b) any declaration
with an alternative that may be the GA's main jar (literal or
may_shadow; pom / sources / javadoc types skipped) at a version other
than the pin among its resolutions(), or literally an executable
classifier copy off the pin or with no version of its own. As in
profile_override, a managed declaration counts only where management
governs the pin, and a versionless main jar takes the live pin. CLI
note and CLI_CONTRACT.md updated.
vendor/jvm/maven_reactor: the v5 planner had the same gap.
interpolate_with and profile_override take the Interpolate to use
(interpolate_strict for versions, as before), and coordinates_elsewhere
reads the joined coordinates in each inheritor and under each profile
combination on the chain through them. (a) The existing
coordinates_overridden check now weighs profiles, not only inheritors.
(b) New warn_moved_coordinates: a declaration that names another
artifact in its pom but may be the GA in an inheritor or under a profile
combination is warned (coordinates_overridden) and, when versioned,
unpins its root and is uncertain, so attestable_checked no longer
attests it. This also covers the inheritor form of (b).
Tests (each fails before this change):
- vex::discover::maven::tests::profile_properties_moving_the_pinned_coordinates_are_not_attested
- vex::discover::maven::tests::profile_properties_turning_a_declaration_into_the_pinned_ga_are_not_attested
- vendor::jvm::maven_reactor::tests::a_profile_moving_the_declared_coordinates_is_left_alone
- vendor::jvm::maven_reactor::tests::a_profile_turning_a_declaration_into_the_patched_artifact_is_weighed
- formats::maven::tests::profile_properties_give_coordinate_alternatives
Guard: vex::discover::maven::tests::unrelated_coordinate_properties_do_not_withhold.
User-property variants (a chain through -D, -D beating the profile) are
in each. The golden corpus is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 854c3f6 commit e458517
6 files changed
Lines changed: 1019 additions & 33 deletions
File tree
- crates
- socket-patch-cli
- src/commands
- socket-patch-core/src
- formats/maven
- vendor/jvm
- vex/discover
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
284 | | - | |
285 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
| |||
91 | 104 | | |
92 | 105 | | |
93 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
94 | 116 | | |
95 | 117 | | |
96 | 118 | | |
| |||
350 | 372 | | |
351 | 373 | | |
352 | 374 | | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
353 | 423 | | |
354 | 424 | | |
355 | 425 | | |
| |||
407 | 477 | | |
408 | 478 | | |
409 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
410 | 483 | | |
411 | 484 | | |
412 | 485 | | |
| |||
425 | 498 | | |
426 | 499 | | |
427 | 500 | | |
| 501 | + | |
| 502 | + | |
428 | 503 | | |
429 | 504 | | |
430 | | - | |
431 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
432 | 513 | | |
433 | 514 | | |
434 | 515 | | |
| |||
473 | 554 | | |
474 | 555 | | |
475 | 556 | | |
476 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
477 | 560 | | |
478 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
479 | 567 | | |
480 | 568 | | |
481 | 569 | | |
| |||
486 | 574 | | |
487 | 575 | | |
488 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
489 | 580 | | |
490 | 581 | | |
491 | 582 | | |
| |||
1245 | 1336 | | |
1246 | 1337 | | |
1247 | 1338 | | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
1248 | 1475 | | |
1249 | 1476 | | |
1250 | 1477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
112 | 133 | | |
113 | 134 | | |
114 | 135 | | |
| |||
0 commit comments