Replies: 1 comment 1 reply
-
Hi @git-girl ! I think what you might be after is You can swap |
Beta Was this translation helpful? Give feedback.
-
Hi @git-girl ! I think what you might be after is You can swap |
Beta Was this translation helpful? Give feedback.
-
Hey :)
I am trying to set up a rust project and mostly everything works. I followed the tutorial and API docs to get a decent setup. I am building with sqlx however, which mean adding a preBuild and postBuild and also for the checks as a commonArgs. I really wasn't a big fan of the prospect of always running the migrations on every iteration, so I thought I'd add a derivation that takes the cargo sqlx prepare output add that as a dependency for the crane cargo calls, that would be quite a bit more efficient.
I ran into the issue of cargo-sqlx wanting to check cargo metadata (it runs it as a
Command::new.args("").output()
).That wants to have network, but also fails when building with --no-sandbox.
When I add the cargo metadata that fails complaining about not getting any network.
I tried inspecting why the cargo sqlx, cargo metadata command fails, but I didnt find anything that is very conclusive. So most likely the same thing that just calling cargo metadata runs into.
I have a reproduction at https://github.com/git-girl/min_repro_metadata
nix run github:git-girl/min_repro_metadata
It would be really kind if you know how I could set this up to give me some tips.
I'm kinda out of ideas (except writing a custom sqlx command but I suffered last time I tried doing that for cargo watch and now I'm scared).
Since in this repro I'm not overriding the scope i don't think it's related to #353.
I didn't see how this could be related to nix stripping file stat data. Cargo handles that okay otherwise as well, afaik. It seems quite connected to the metadata cargo invocation and I wanted to get around that by providing artifacts to it which didn't work.
I also haven't checked a workaround like this one:
cargo +nightly metadata -Z unstable-options -Zconfig-include --config config.toml --offline
from nix-community/crate2nix#148
(cargo metadata would have to then be smart enough not to try and make the request even if invoked without those flags again by sqlx though)
Best Regards
Beta Was this translation helpful? Give feedback.
All reactions