conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.25k stars 980 forks source link

[feature] Introduce os.version or os=Ubuntu in profiles #16568

Closed hcw70 closed 4 months ago

hcw70 commented 4 months ago

What is your suggestion?

Profiles should (IMHO MUST) contain the distribution name for Linux based distributions.

Currently only os=Linux is allowed, but no os.version is allowed.

My Ubuntu 24 gives:

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=13
os=Linux

A shared library which is build on Ubuntu 24.04, which will find some system lib packages (i.e. those provided by the libc "dpkg -L linux-libc-dev:amd64"), will most probably be different from that of a Fedora XY revision.

The linked-to headers must match the system shared libs, and the linked-to shared libs must be the same as the shared libs during run, so a app / shared lib is bound to a specific linux distribution in a specific version.

How does conan handle this case if os does not differentiate linux distributions?

Have you read the CONTRIBUTING guide?

memsharded commented 4 months ago

Hi @hcw70

Thanks for your suggestion.

This has already been considered, and the current default is relatively good. We use it to build many thousands of different binaries in ConanCenter that have proven to have good binary compatibility in a variety of Linux systems.

If you want to customize your own settings, this is perfectly possible and very easy, please check:

hcw70 commented 4 months ago

@memsharded Thanks for the hint. Didnt see that in the docs, maybe a link to the examples in the main docs would have helped.

Anyway, i will try and see.

Regards

Hauke