conan-clion-plugin
conan-clion-plugin copied to clipboard
Linux: tools.system.package_manager:mode install doesn't work
Conan complains a lot about not being able to install system packages on linux and asks to set tools.system.package_manager:mode
from 'check' to 'install', however when that is done it fails to install anything because on Ubuntu apt install
requires root (sudo).
Hi @etodanik
Thanks for your report. This doesn't look like a bug. Conan will not inject sudo automatically to anything, unless the user explicitly says so. There are configurations to manage that too:
$ conan config list | grep package_manager
tools.system.package_manager:mode: Mode for package_manager tools: 'check', 'report', 'report-installed' or 'install'
tools.system.package_manager:sudo: Use 'sudo' when invoking the package manager tools in Linux (False by default)
tools.system.package_manager:sudo_askpass: Use the '-A' argument if using sudo in Linux to invoke the system package manager (False by default)
tools.system.package_manager:tool: Default package manager tool: 'apk', 'apt-get', 'yum', 'dnf', 'brew', 'pacman', 'choco', 'zypper', 'pkg' or 'pkgutil'
Seems like you want to activate tools.system.package_manager:sudo=True
too
If I do sudo = True it complains that there is no terminal. I do think it's a 'bug' insomuch that something like this should be anticipated (whole Linux userbase would suffer) and provided as a more coherent instruction / error.
Right now it looks like this plugin won't be able to install any packages because it doesn't run in an interactive terminal.
If I do sudo = True it complains that there is no terminal.
Ok, that would be something I was not aware and need to be investigated. Pinging @czoido and @RubenRBS for feedback about this.