Skip to content

Dealing with include_bytes in dependencies #627

Answered by ipetkov
l-monninger asked this question in Q&A
Discussion options

You must be logged in to vote

Crates are not supposed to depend on/include any files outside of their own directory. This happens to work out for git dependencies because cargo happens to check out the entire repo, but it would not work properly when the crate is published to a registry like crates.io (in which case cargo will only upload the crate's directory and not include any parent files).

There are two basic options to handle this:

  1. Submit a fix for this upstream to not depend on any parent files.
  2. Patch up the sources before they are vendored into the rest of the derivation: https://crane.dev/patching_dependency_sources.html

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@l-monninger
Comment options

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