You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like the idea but I'm a bit worried about portability with the check for satisfied dependencies. If we could get those where they work reliably, it seems nice to me.
wc -l is POSIX. My use of grep is basic and also POSIX (because no option is used). Actually dpkg -l should only list installed packages, but uninstalled packages with configuration files left over are still counted as “installed packages“.
As a first time user a sudden sudo surely is not what I did expect, and not knowing what is executed feels dangerous. I would love this issue to be addressed (for rpms, you can use rpm -q "${@}" | wc -l).
Reacted by Phil Hansch, Postmodern and Guillaume Déflache
I think we would need to add a separate function that only checked whether one (or maybe more?) dependencies were already installed? The function would need a similar case/esac statement for each package manager. If we could use the simplest command possible to query whether the package was installed or not (avoiding complex grep/sed parsing) I think that would work.
An alternative would be to list the dependencies as "files", not packages, then checking will never require sudo, and will not depend on the package manager (and will work even with packages installed manually.
@eloyesp I think some dependencies (like libyaml and libffi) are libraries, not executables, so they cannot be searched in “path”. I feel that using package manager itself is still easier.
I know that I can skip dependency check with --no-install-deps, but I’m proposing the default behavior to be:
Check whether dependencies are satisfied without super-user permission.
If some dependency is missing, install with super-user permission.
This way we can skip unnecessary sudo without breaking any current behavior.
I’d feel better if this leveraged an explicit --use-sudo or --system-deps flag. As a Hombrew user I would rather see a failure without an explicit flag than bork my real system Ruby. For systems that need root privileges to install packages, snaps, or whatever that’s fine, but a silent switch to sudo, especially for those with NOPASSWD is their sudoers, seems like asking for trouble.
Activity
FranklinYu commentedon Mar 19, 2019
Affected function:
ruby-install/share/ruby-install/package_manager.sh
Lines 32 to 54 in ea2b8bb
For example with APT we can have
In MacPorts
FranklinYu commentedon May 30, 2019
Anyone interested in this? I can make PR if this will be reviewed and merged.
FranklinYu commentedon Jan 8, 2020
Bump. Again, I can make PR.
havenwood commentedon Jan 9, 2020
I like the idea but I'm a bit worried about portability with the check for satisfied dependencies. If we could get those where they work reliably, it seems nice to me.
FranklinYu commentedon Jan 10, 2020
wc -lis POSIX. My use ofgrepis basic and also POSIX (because no option is used). Actuallydpkg -lshould only list installed packages, but uninstalled packages with configuration files left over are still counted as “installed packages“.bloerwald commentedon Sep 9, 2020
As a first time user a sudden
sudosurely is not what I did expect, and not knowing what is executed feels dangerous. I would love this issue to be addressed (forrpms, you can userpm -q "${@}" | wc -l).postmodern commentedon Jan 7, 2022
I think we would need to add a separate function that only checked whether one (or maybe more?) dependencies were already installed? The function would need a similar
case/esacstatement for each package manager. If we could use the simplest command possible to query whether the package was installed or not (avoiding complexgrep/sedparsing) I think that would work.eloyesp commentedon Mar 21, 2022
An alternative would be to list the dependencies as "files", not packages, then checking will never require sudo, and will not depend on the package manager (and will work even with packages installed manually.
FranklinYu commentedon Apr 29, 2022
@eloyesp I think some dependencies (like
libyamlandlibffi) are libraries, not executables, so they cannot be searched in “path”. I feel that using package manager itself is still easier.todd-a-jacobs commentedon Sep 18, 2024
I’d feel better if this leveraged an explicit
--use-sudoor--system-depsflag. As a Hombrew user I would rather see a failure without an explicit flag than bork my real system Ruby. For systems that need root privileges to install packages, snaps, or whatever that’s fine, but a silent switch to sudo, especially for those with NOPASSWD is their sudoers, seems like asking for trouble.