Skip to content

Commit

Permalink
Set CARGO_TARGET_DIR when compiling the prepare queries (launchbadge#…
Browse files Browse the repository at this point in the history
…1910)

* Move compiled query data

I did try to set rustc's --out-dir but encountered a strange error
stating that it can not be set more than once (even though I am unable
to deduce what else is setting it).

This enabled me to set a custom CARGO_TARGET_DIR and still be able to
prepare queries.

* Set CARGO_TARGET_DIR in the rustc invocation
  • Loading branch information
sedrik authored and JoeyMckenzie committed Jul 13, 2022
1 parent 7c854a9 commit ed8ecdd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sqlx-cli/src/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ hint: This command only works in the manifest directory of a Cargo package."#
))
.env("SQLX_OFFLINE", "false")
.env("DATABASE_URL", url)
.env("CARGO_TARGET_DIR", metadata.target_directory.clone())
.status()?
};

Expand Down

0 comments on commit ed8ecdd

Please sign in to comment.