Should ruby-build check for dependencies? #2489
Replies: 1 comment
-
That's a good question! The short answer is: Ruby has a quite complex build system (which I'm not overly familiar with) that has been growing over the last ~20 years, supports a wide range of platforms, and keeps being tweaked with each new Ruby version. If ruby-build attempts to detect system dependencies, then we'd have to replicate parts of Ruby's build system. Worse yet, if we fail to detect a system dependency being installed, but Ruby itself would have discovered it, then we sabotage what would otherwise be a successful build. However, I absolutely agree with you that it's a shame that a lot of users seem to be first attempting to use ruby-build, then run into cryptic build failures such as the ill-named "psych", then need to end up in our Issues/Discussions section or on the wiki: https://github.com/rbenv/ruby-build/wiki#suggested-build-environment. A better user experience would have helped the user without them having to search the Web for straightforward solutions. Should ruby-build scan build logs for typical failures like failing to build the "openssl" or "psych" extensions and recommend solutions so that the user doesn't have to search? |
Beta Was this translation helpful? Give feedback.
-
I had to run the "build failure due to libyaml" gauntlet earlier. It was quite obtuse: I was using mise, which calls out to ruby-build, which simply gives a cryptic error about "psych". No part of the error message made it clear to me that I was missing dependencies. In my mind, tools that aid in building and installing things exist in part so that I don't have to manually check and verify and install dependencies before I proceed.
The README helpfully notes:
My question is: Why not? Surely the experience of installing Ruby via ruby-build would be greatly improved if the tool first checked for such dependencies before attempting to proceed with the build. A great many support tickets downstream of ruby-build would be prevented; there are at least 4 discussions on mise where baffled users can't understand why Ruby is failing to install, a direct consequence of ruby-build neither checking for deps first nor making it clear why the failure occurred (at a human-readable level; "there was a problem with psych" is not as clear as "you are missing required dependencies, please see link/to/docs/deps").
I'm trying to think of some counter-arguments here, but I'm struggling lol. Clearly that means my argument is waterproof, and is not a sign of insufficient understanding on my part.
Beta Was this translation helpful? Give feedback.
All reactions