Any advice on patching dependencies? #192
Replies: 2 comments
-
Did you try to engage maintainers and fix things upstream e.g. by some environment variable controlling the behavior? |
Beta Was this translation helpful? Give feedback.
-
Hi @OliverEvans96 thanks for the report! We don't really have a means to customize or patch individual dependency crates (especially when dealing with transitive dependencies), so the best advice I can offer at this moment is:
We might be able to support a form of dependency patching in the future by copying the sources out of the nix store and into the builder working directory, but it feels like trying to put a bandaid on sandbox-unfriendly behavior which ideally should come from upstream |
Beta Was this translation helpful? Give feedback.
-
Hello,
Thanks for the super cool package.
I have a situation where an indirect dependency (mediasoup-sys) of my crate fails to build on NixOS (mainly because it tries to install its own dependencies over the network at build time). After much tinkering, I've finally found a way to patch the dependency using
buildRustPlatform
. My solution is terribly inelegant, but you can see it in my MWE here. Hopefully there's a much easier way that I've failed to discover.I would love to migrate from buildRustPlatform to crane for the caching gains, but I'm worried that it would be quite hard given that crane fetches dependencies outside of the normal cargo mechanisms.
Do you have any general suggestions on the subject, or specific comments on porting my solution?
Thanks!
Oliver
Beta Was this translation helpful? Give feedback.
All reactions