Skip to content

Differences between using a local copy of a lib and fetching from git #222

Answered by ipetkov
4JX asked this question in Q&A
Discussion options

You must be logged in to vote

Nix builds derivations in a writable sandbox. This is where the derivation's source is copied to, and presumably where other operations such as applying patches or running other scripts on the source. When you copy other crates into your own source directory (also sometimes called local vendoring) those files make it to the same writable directory and why the build script can happily write to src/protos.

When crates are pulled in via Cargo.toml (whether they come from crates.io or a git repository) they are vendored into the Nix store which is readonly. So you are correct, this issue is because the build script is trying to write into the directory of where its sources are contained. (If …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ipetkov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants