Conan: Make installation of system packages in system_requirements() optional

Created on 18 Jan 2018  路  5Comments  路  Source: conan-io/conan

Feature request: It would be nice if it would be possible to disable installation of system packages in system_requirements(). An environment variable, e.g. CONAN_DISABLE_SYSREQUIRES, would be handy.

In general this would be helpful when testing packages in environments without sudo-rights where required packages are preinstalled.

All 5 comments

But current SystemPackageTool already does a check if the packages are installed, and that does not require sudo permissions. Am I missing something? Thanks!

The problem is that if you run this in a CI environment and don't have the package installed by accident, sudo gets executed which will hang.

Now, one can disable sudo which makes then the package fail as expected using CONAN_SYSREQUIRES_SUDO, but it will still try to install it which is odd. It would be better if the behavior could be specified in a bit more detailed way:
CONAN_SYSREQUIRES_CHECK="enabled;check_only;disable"

Enabled would be the default and behave like it does now. Check_only would raise a failure if a package is not installed but not attempt to install it (CI). Disable is what the author of the issue proposes, completely disable this as the package could have been hand installed in /usr/local for example. May be make this an option to conan install? conan install --sysrequires=check_only? (poor choice of naming, but I think you get the point)

Yes, yes, I am not opposed to such configuration, I am just trying to understand what are the scenarios, just in case.

I agree with the modes, they seem ok. Regarding the command line argument, I'd say it is something more related to the configuration, the general operating mode for that machine. And the command line is already cluttered with many arguments, so my vote would go for making it a configuration (conan.conf) and environment variable.

I really like the three proposed modes and the implementation as environment variables!!

my colleges also complain that conan recipes install packages to the system, which they want to avoid -they want to control themselves that are installed on their systems, and found it risky if conan recipes downloaded from the internet will start to install stuff into the system without user's permission.
although sudo requires password to enter, there is a chance that sudo was run earlier and in that case conan will start to install stuff without requesting password.
so they prefer if conan just fail and report which packages are required, then carefully install needed packages themselves.

Was this page helpful?
0 / 5 - 0 ratings