-
Notifications
You must be signed in to change notification settings - Fork 306
Description
Commit afb3307 introduced a patched version of the prost and tonic dependencies to support boxing large fields in GRPC messages. This is a Very Good Idea since copying around massive structs is a common Rust pitfall and helps both improve performance and memory use. No objections there!
However, this broke my build of buck2 when using Nix in buck2-nix. In short the error is obtuse and looks like this, but I'm afraid I'm stuck at this point:
error: builder for '/nix/store/0xz81h8scjfgq0yfn3p13mn228wq9z8h-prost-0.11.6.drv' failed with exit code 101;
last 10 log lines:
> error: failed to load manifest for workspace member `/nix/store/wvlsz0nhhyb7kbc6794r6wc36k7ppzqh-prost-90b7e20/tests/single-include`
>
> Caused by:
> failed to load manifest for dependency `prost`
>
> Caused by:
> failed to read `/nix/store/prost/Cargo.toml`
>
> Caused by:
> No such file or directory (os error 2)
For full logs, run 'nix log /nix/store/0xz81h8scjfgq0yfn3p13mn228wq9z8h-prost-0.11.6.drv'.
I believe this is due to the fact that the tests/single-include subdirectory of prost makes a reference to ../.. in order to find the prost package itself, since it's all part of a monorepo. But this won't work in Nix (using buildRustPackage), because it makes the build fully hermetic -- so such "outside project references" to other things are made invalid. There are some other packages that suffer from similar issues.
The normal version of prost works because the packages are downloaded from crates.io, so there is no git repo/monorepo involved at all, in that case.
At the moment, I can instead just manually revert the boxing patch, and thus also revert the changes to Cargo.toml, and that's what I've done, but it continues to get increasingly fiddly with every passing day (or week) and has some annoying edge cases in my build scripts to make it work.
Please note this is roughly stuck, I'm just filing to keep people in the loop; as of right now, this depends on tokio-rs/prost#802 and then hyperium/tonic#1252. Once the prost package has been updated (at minimum) I believe I will be able to work around the rest.