Skip to content

Disabling recursive Cargo.toml search on cargo install --git ... #3935

Closed
@fantoine

Description

@fantoine

I have a bin project which I want to install from a git repository with cargo install --git ....

I have some files named Cargo.toml on my tests. These files are not meant to be used by Cargo but only for my tests, and some of them are intentionally malformed.

Installing from git doesn't work correctly because of this. It looks like Cargo seek to find and interpret all Cargo.toml files on the repository, and then, obviously, it breaks the compilation because of these malformed files.

Strangely, it works correctly if I use cargo install --path ... on a local cloned repository.
By the way, if I change the call to PathSource::new_recursive(..) by PathSource::new(..) on cargo/sources/git/source.rs file, it works correctly for my case.

I looked on Cargo source code, but didn't find why this recursive search is required?
Is there a way to disable it, or at least on tests folder?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions