Skip to content

[sqlx-cli] prepare unable to find queries if cargo target-dir is set in config.toml #1706

Open
@sedrik

Description

@sedrik

I generally use the following ~/.cargo/config.toml

[build]
      target-dir = "/home/sedrik/.cargo/target"

But having this setup and a lib crate with binaries in it caused cargo sqlx prepare -- --lib --all-features to fail to find any new queries even if I did a cargo clean and removed the target directory. I also noted that sqlx's outputs files into the projects target directory but removing those as well did not help.

Removing the config for target-dir made prepare work again.

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