-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Approach for system requirements #641
Comments
for the reference, I am copying here problems/disadvantages/limitations caused by system requirements we previously faced on bincrafters: System Requirements in conan known to cause lots of various issues, they are hard to maintain, and don't scale well. some problems with System Requirements:
right now, the following conan packages are heavily based on system requirements: OpenGL-related: GLU, GLUT, GLEW, GLFW, GLM, etc. |
my two cents:
if it's easy and straightforward - yes, that should be the first choice (as we did with libalsa, for instance)
I'd say that's much better than system requirements, and should be the second choice
such things sometimes are needed, e.g. OpenGL support might be abstracted away in conan (on Windows, you have to link with opengl32.lib, on Mac you have to link with OpenGL.framework, and on Linux you need some system libraries such as libGL.so). this also applies to few other things which are system-specific (e.g. Python, OpenCL, Vulkan, CUDA, etc.). it would be much simpler for other recipes to just include opengl-support conan package and don't worry about system specifics and system requirements. in such case, we delegate all baby-sitting and complexity to single recipe, rather copying ugly fragile conditions to every recipe which requires OpenGL. |
I agree with the ''proxy recipes'' concept. Take the case of CUDA, they ship it with an EULA which makes it nearly impossible to be packaged by conan (If I remember well, the only redistribution allowed is via docker image). Also, you don't want to make an installer package because not only it requires sudo and downloads several GBs, but also installs some kernel modules which could be a big NO if the user is not informed previously. |
they do require changes in hooks - in practice, such proxy recipe may contain no files at all (no headers or libraries copied), but it only may have package_info method specifying platform-specific includes and libraries. however, currently our hooks complain if no files are copied. but that should be an easy change (or we can simply white-list such packages). |
@SSE4 pretty much summarized it and I agree: system_requirements should be avoided whenever possible. In the specific case of At Bincrafters we slowly create packages for the system_requirements in our recipes. This sometimes takes an awful lot of time, but I don't see any reason to loose patient now just because we have the Conan Center Index. At first glance it might save a lot of time because you don't need to create all of these packages, but precisely because of all the downsides @SSE4 summarized I believe that the time in supporting users and for adding workarounds for specific issues will cost much more time long term. And quality wise it is much more better to have Conan packages anyway (again; see @SSE4 summary). That said, I support conan-io/hooks#112 to make sure that nothing slips through review. We can add specific packages to a whitelist if we -absolutely- have to at some point. |
In the end, it seems that for the case of |
I started working on wayland : https://github.com/bincrafters/conan-wayland. The package is quite self-contained, and ubuntu distro seems to build it "vanilla". Also, wayland is just the implementation of a protocol (named wayland too...), and I don't know of another implementation. |
I think you definitely want the option of using proxies for system level dependencies like that, regardless of whether it's technically a good idea. The end decision should be up to the application developer/stakeholders. |
I will print this and put it on a board |
Should this approach be added to the docs? |
Yes! I think it's a good reference. I usually send its link when users ask for system requirements. |
Hi! I have a question regarding this: How can a package specify that it needs the "-dev" system package for building and the non-dev version is enough for installing it as a dependency (i.e., because it is a "private" shared library dependency)? |
@jpfeuffer All dependencies are always listed, there is a private attribute, but we don't allow in CCI. In case you only need to use a system package when building a package, then it should be considered a tool_requires |
Ok, thank you. I am asking because I have the feeling that having Qt as a dependency (even if it exists pre-built on an index) will always try to install all those libx*-dev packages although they are not necessary. |
@jpfeuffer You can customize Qt package by disabling its options. Of course, you will need to build from source, but you can use a free Artifactory instance and push your Qt package there. |
Not sure if we are talking about the same thing. Qt always has xorg as a dependency on Linux. I don't think it can be deactivated. But what I would want is that it only installs xorg instead of xorg-dev on my machine when I set Qt as dependency and it comes prebuilt. |
@jpfeuffer In that case you can't customize without changing the recipe directly and re-building the package. It's not possible removing a dependency by a Conan command, let's say. |
Hi everyone, My journey started with the following goal:
So i've started using YoctoProjects Toolchains that does have the compiler and some basic libraries (libdrm, opengl and so on), as i was familiar with it.
I've managed to build libraries like boost effortlessly, but when dealt with Qt, my struggle begun. I believe that those */system packages should be replaced with the actual compilation, as Yocto does, for instance for OpenGL to build from Mesa git. On my trials and attemps, i had to perform the following actions
Here an example of the above point.
I've also tried to use Linaro Toolchain, that ships with just the compiler, so i could get familiar with it as it represents a good candidate, and to challenge myself a little bit.
Sorry for the lenghty post, but i needed to share my experience and i'm looking forward to get to know what do you think about it. Any advice would be great. |
There are some recipes that may need to install tools that can be considered as system requirements.
There are already some recipes in the index that check for system tools installed but do not install them. Others like
libusb
do install system requirements aslibudev
.We feel it is intrusive and risky to install system requirements when using a Conan dependency and we want to avoid this in Conan (specially asking for sudo permissions 😩).
The question here is what approach should be taken when packaging recipes that require any kind os system requirement:
Feedback please!
The text was updated successfully, but these errors were encountered: