Skip to content

Walk path repository until dependency is found rather than requiring it to be at the repository root as done for git #13360

@jpedrick

Description

@jpedrick

Problem

Currently, packages specified by git repositories will search the git project for sub-packages. The following will correctly find bevy_math

[dependencies]
bevy = { path = "/Users/jpedrick/Development/bevy", default-features = false }
bevy_math = { git = "https://github.com/bevyengine/bevy.git" }

However, with path specified packages this doesn't work:

[dependencies]
bevy = { path = "/Users/jpedrick/Development/bevy", default-features = true }
bevy_math = { path = "/Users/jpedrick/Development/bevy" }

Instead, bevy_math needs to be explicitly targeted with the path

[dependencies]
bevy_math = { path = "/Users/jpedrick/Development/bevy/crates/bevy_math/" }

I found this a bit confusing, as I expected crate imports with path to work the same as git.

Proposed Solution

The following would find the bevy_math package in /Users/jpedrick/Development/bevy/crates/bevy_math/ by searching for the Cargo.toml with package.name == "bevy_math"

[dependency]
bevy_math = { path = "/Users/jpedrick/Development/bevy" }

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crate-dependenciesArea: [dependencies] of any kindC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions