extism / cli

The extism CLI is used to generate plugin scaffolding and manage Extism installations
BSD 3-Clause "New" or "Revised" License
21 stars 7 forks source link

cli installation: better handling of sudo #99

Open G4Vi opened 3 weeks ago

G4Vi commented 3 weeks ago

Currently the installation invoke sudo if the user is not root and $out_prefix is not in $HOME. This heuristic has a lot of false positives, all of the failures I looked at http://matrix.cpantesters.org/?dist=Alien-libextism%20v0.1.1 appear to be the cli install script attempting sudo in a scenario where it shouldn't.

If we insist on installing with sudo, rather that attempting to detect when it's needed, we should try without, and on permission error retry with sudo.

However, instead I think we should make two changes:

nilslice commented 3 weeks ago

SGTM! @zshipko may have some thoughts / direction to add. But please do make any improvements you have in mind.

Will only add that if it impacts the install process, that we update the README and docs throughout the extism.org site etc.

zshipko commented 3 weeks ago

Yeah, I think either of those solutions sound good - it sounds like the first option is a little more automatic, but both are common patterns people will be used to. We should just make sure to test all the edge cases before updating all the docs - I'm happy to help with that when you're ready.