Skip to content

Query macros panic if CARGO environment variable is not set #1021

Open

Description

@jplatte

Activity

  1. abonander commented on Jan 27, 2021

    @abonander
    Collaborator

    We also require CARGO_MANIFEST_DIR https://github.com/launchbadge/sqlx/blob/af7f2594457e991fd84a97a2170f79801fbdf1df/sqlx-macros/src/query/mod.rs#L54

    which is where we look for .env.

    I've been told the working dir that proc macros are executed in is always the workspace root, but assuming that is always the case isn't really any better than requiring these env vars to be set.

    We need some way to know the directory to search in for sqlx-data.json (or .sqlx/ later on) and .env. Any suggestions?

  2. added a commit that references this issue on Apr 6, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions