Repository navigation
Fix Maven parent relativePath naming a dir (#534) - #1789
Mikola Lysenko (mikolalysenko) merged 6 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
vex and vendor --check refused a correctly vendored Maven reactor when a module's <parent><relativePath> named a directory (.., ../corp-parent): the reactor read the bare path before <dir>/pom.xml and the project reader counted the directory (or the empty path for ..) as a failed read. Both commands exited 1 although the build used the patched jar. The parent is now located like a <module>: <dir>/pom.xml first, then the path itself, never the empty path. A probe that runs through a regular file (pom.xml/pom.xml) reads as missing instead of failing. Fixes #534 Assisted-by: Claude Code:claude-opus-5-5
The capstone's module b names its parent with a directory relativePath (../corp-parent). Without the reactor fix, vex on that vendored tree printed "corp-parent is not a regular file", dropped the patch and exited 1. Assert it attests not_affected now. Refs #534 Assisted-by: Claude Code:claude-opus-5-5
Review follow-up: only project reads treat a path that runs through a regular file as missing. Writes, reverts and the created-dir scan still refuse it before anything is written, as they did before. Also share the <module>/<relativePath> pom lookup between both call sites, and parse a local parent from a single read. Refs #534 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Windows reports a path through a regular file as not found rather than not-a-directory, so resolve() lets it through there just as it did before this PR. Only assert the up-front refusal on Unix. Refs #534 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 273eef7. Configure here.
|
Ready for review at
Generated by Claude Code |
Final review briefWhat it does Risk: low. Read-side only: writes, reverts and the created-dir scan still go through the strict Look here
Verified
Changes I made: none. Auto-merge is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Fixes #534
Summary
vexrefused a correctly vendored Maven reactor when a module's<parent><relativePath>named a directory (../corp-parentor..). It printed "cannot establish JVM wiring: corp-parent: … is not a regular file" (orunsafe path ""for..), left the patch out of the VEX document and exited 1. Maven itself reads a directoryrelativePathas<dir>/pom.xml, so the build was patched the whole time.Root cause
maven_reactor::local_parent_ofprobed the barerelativePathbefore<path>/pom.xml. Duringvendora directory read simply misses, so thepom.xmlcandidate wins.vexliveness (apply::entry_wired_checked) reads throughProjectReader, and that reader records a directory read, or the empty path..normalizes to, as a read error. That error withholds liveness.Fix
local_parent_ofnow looks the parent up the same wayresolve_modulelooks up a<module>:<path>/pom.xmlfirst, then the path itself, and never the empty path. The two call sites share onepom_candidateshelper, and the parent pom is parsed from a single read.ProjectReader::readnow treats a probe that runs through a regular file (pom.xml/pom.xml, whenrelativePathnames the file) as missing instead of a read error. Without this, the reordered probe would break the common../pom.xmlform. Writes, reverts and the created-dir scan still refuse such a path up front (resolveis unchanged for them).Scope notes
main,vendor --checkno longer reproduces the refusal:check_entry's Maven path doesn't consult the reader's read error. The capstone now asserts bothvexandvendor --check.relativePathnaming a directory that has nopom.xmlstill reads the directory and records a read error. Maven would fall back to the repository there. It is rare, and fixing it means changing what a directory read means for every JVM planner caller, so I left it out of this PR.Test evidence (red → green)
<relativePath>..</relativePath>vendor::jvm::tests::parent_relative_path_naming_a_directory_stays_checkableErr("unsafe path \"\"")<relativePath>../corp-parent</relativePath>Err("corp-parent: … is not a regular file")buses../corp-parent)e2e_vendor_jvm_build -- --ignored maven_reactor(now runsvex+vendor --check)vex: "corp-parent … is not a regular file", "omitting … vendor_jvm_shape_unsupported", exit 1vendor::jvm::apply::tests::a_path_through_a_file_reads_as_missingcannot inspect …/pom.xml/pom.xml: Not a directoryCommands run locally:
cargo fmt --all -- --check: cleancargo clippy --workspace --all-features -- -D warnings: cleancargo test -p socket-patch-core --all-features --lib: 6864 passed, 4 failed. All 4 are chmod-based failure-injection tests (copy_tree::relax_loop_must_not_traverse_symlinked_root,vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry,pypi_poetry::wire_write_failure_…,pypi_requirements::wire_failure_rolls_back_…). They can't fail as root, which this container runs as, and they're unrelated to this diff.cargo test -p socket-patch-cli --all-features --test vendor_jvm_cli --test maven_sidecar_cli: 28 + 51 passedcargo test -p socket-patch-cli --all-features --test e2e_vendor_jvm_build -- --ignored maven_reactor(Maven 3.9, real Central): 2 passedcargo test --workspace --all-featuresran out of the container's disk allowance while building test binaries, so CI covers the remaining suites./code-review highran on the diff. Fixed: write-path leniency (resolvestays strict for writes), the duplicated candidate list, and the double read of the parent pom. Not fixed: the directory-without-pom.xml case (above), plus two pre-existing nits outside this change (a redundantgroup_commit::readcall, and the created-dir scan's handling of a file prefix, which is no longer reachable now that writes refuse paths through files).https://claude.ai/code/session_011f9aeRjLPKxKCvazRF8Ean
Generated by Claude Code