I am using conan
in an enterprise environment where the operating system is rather old and has an old version of glibc
(2.11). As a result, a lot of the pre-built binaries on conan.io
do not end up working in my environment. However, conan
doesn't know that and will happily download and install them on my system, resulting in link-time errors.
I have found that if I build from source I can get the libraries to work.
My desired behavior would be as follows:
- The first time using
conan install
to install the library (e.g. it is not in my cache) thenconan
will build from source and place it in my cache, then use it. - On subsequent invocations of
conan install
,conan
finds the cached library and uses that without having to rebuild from source. - I am invoking
conan install
as part of an automated build script, so I would like to not have to modify the invocation depending on if this is the first time the library is installed or not (but modifying a configuration file is fine).
I have had troubles obtaining this behavior in practice. Here are the challenges I have run into:
- If I use
conan install --build=thelibrary
thenconan
will rebuild that library from source every time I invokeconan install --build=thelibrary
, even if it is already present in my cache. - If I use
conan install --build=missing
, then Ican trickconan
into building the library by setting some build options that do not have a pre-built binary associated with them.- This is fragile, as it only works for projects with enough build options that it is not tractable to create pre-built options for all combinations.
- It also doesn't work if all the build options I need correspond to a pre-built binary.
Here is what I am looking for (and I assume exists but am not able to find):
- Some setting I can place in my
conanfile.txt
(or some other configuration file) that tellsconan
to ignore pre-built binaries for a given library or libraries and instead build from source, but use the cached version if it is available.- This ideally should work without me having to tinker with build options.
- I don't necessarily want to build all libraries from source, just the ones that won't run on my ancient OS, but if I have to settle for "all-or-nothing" I will take "all".
Is this possible with conan
?