transitive buffrs resolution corrupts input crates #218
Labels
bug
Reports or fixes associated with bugs in this project
complexity::medium
Issues or ideas which require some discussion, research and more implementation work
component::cli
Everything related to the buffrs cli
docs::book
Adding, rewriting or removing chapters from the buffrs book
docs::project
Documenting the project vision, design decisions etc
integration
Changes and ideas related to integrating buffrs with 3rd-party software or tools
priority::high
Urgent change or idea, please review quickly
Milestone
Suppose I have:
and then we have
Bar
which is in a different repo, depends onFoo
from a registry.What will happen when we run
cargo build
is approximately:$CARGO_HOME/registry/cache/registry_id/foo-client-0.0.0.crate
.$CARGO_HOME/registry/cache/registry_id/foo-client-0.0.0
.Unfortunately, buffrs does not write its output here. Instead it writes down a few more protobuf files into
$CARGO_HOME/registry/cache/registry_id/foo-client-0.0.0
, because it's writing into some subdir of$CARGO_MANIFEST_DIR
.In my case, this is failing because my cargo manifest is in a read only directory.
I think that during Cargo builds, buffrs needs to be writing into $OUT_DIR in the cargo script, not into the source dir. Writing into the source dir makes sense during development, but not for published crates, because if buffrs somehow corrupted an input crate due to a bug (e.g. vendored a proto wrong), this would survive cargo cleaning.
For now I can work around by just not using the buffrs helpers in the cargo code (I have no dependencies) but this seems to be a misuse of Cargo.
The text was updated successfully, but these errors were encountered: