Skip to content

findCargoLockfile doesn't follow package.workspace pointers #701

Closed

Description

@goosewobbler

Problem

Cargo lets a crate name its workspace root explicitly with package.workspace = "<path>" instead of being found by walking up the directory tree. findCargoLockfile (packages/core/src/cargo.ts) only walks up, both on main and in #674's version, which otherwise follows cargo's root rule including exclude. So in a pointer layout:

main has the same gap; #674 doesn't introduce it. The layout is rare.

Found during the #674 review (round 4). The reviewer compared findCargoLockfile against cargo metadata's workspace_root in 22 layouts, and this was the only mismatch.

Fix

In findCargoLockfile, read the crate's own package.workspace and, when set, use that directory as the root. It's a few lines on top of #674's TOML read. Add a core test pinned against cargo's choice. #674 notes the gap in the function's JSDoc; remove that note with the fix.

Activity

  1. goosewobbler commented on Oct 23, 2026

    @goosewobbler
    OwnerAuthor

    Fixed by #674: findCargoWorkspaceRoot follows a crate's package.workspace pointer (packages/core/src/cargo.ts), with a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions