eddelbuettel / rprotobuf

R Interface to Protocol Buffers
71 stars 25 forks source link

User-friendly suggestion for missing-dependency configure failure #105

Closed Fifis closed 4 months ago

Fifis commented 4 months ago

Obviously RProtoBuf depends on Protobuf being available on the system. Usually, installing the corresponding -dev library on Debian-based system works. However, installing libprotobuf-dev and protobuf-compiler is not sufficient in this case. One has to check file lists for various packages to find that it is libprotoc-dev that provides google/protobuf/compiler/code_generator.h.

Suggestion: it is considered good user experience to list the dependencies as a suggestion if configure fails, e.g.:

Make sure that the development headers and other Protobuf dependencies are installed.
For Debian-based systems: apt install libprotobuf-dev protobuf-compiler libprotoc-dev

That should save time for the users who are wondring why doing libprotobuf-dev did not change anything.

eddelbuettel commented 4 months ago

This is an R package, and R packages usually communicate this via the SystemRequirements field in file DESCRIPTION:

https://github.com/eddelbuettel/rprotobuf/blob/ba788142263a2cad1829d40d4c0dc425b23f96c7/DESCRIPTION#L18-L21

Fifis commented 4 months ago

Thank you, I did not know this. Some popular packages handle configure errors at the time of installation, which is why I thought that it would be a good idea. Another reason was, there is a similar answer on SO that does not list libprotoc-dev for a different package that also relies on protobuf. Closing the issue.

eddelbuettel commented 4 months ago

Your point is entirely reasonable, but such declarations of dependencies is in fact a weak point of the R package system, see eg here https://mastodon.social/@jdblischak@rstats.me/112756888153973401 for a recent thread in which I participated.

And with all due respect (and the fact that I have been a Debian Developer for nearly 30 years) trying to detect where configure runs and emiting appropriate errors is ... not a winning proposition. We have umpteen Linux distro, brew/homebrew, Conda, macports, ... It is impossible to follow (and likely why CRAN cannot declare dependencies 'universally') so failing when building is, I fear, the best we can do. I agree that here especially it is hard given the multiple dependencies but such is life.