You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cargo fix cannot be used with sqlx offline mode #1229
Hi,
Running cargo fix on a project that uses sqlx::query! in offline mode panics while compilation.
error: proc macro panicked
...
= help: message: Invalid `cargo metadata` output: Error("EOF while parsing a value", line: 1, column: 0)
= note: this error originates in the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info)
It look like calling cargo metadata under cargo fix has different behavior. It expects to receive additional argument if __CARGO_FIX_PLZ is set.
I'd be happy to submit a PR but I dont know what would be the best fix to that.
Reacted by Palmik, Ryan Shao, YuanPei Li, kangalio, Pedro Morello Abbud, Will Johnson and Joe Grund
Activity
Palmik commentedon Jun 28, 2021
I am having the same issue, but only when building within Docker. Did you find a workaround?
frxstrem commentedon Jul 29, 2021
I don't know if it's the best way to solve this, but it seems like the following patch is sufficient to get
cargo fixto work with offline mode:jplatte commentedon Jul 29, 2021
You should probably just create a PR for that :)
Sounds like a fine workaround to me until this is (hopefully) fixed in cargo.
abonander commentedon Aug 20, 2021
Closed by #1352