conan-io / conan

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

[question] Handling different versions of tools for packages #14424

Open maitrey opened 1 year ago

maitrey commented 1 year ago

What is your question?

Dear Conan Folks,

I have a question with respect to tool packages. Our use-case is:

Could you please help me what is the suitable approach for this use case? Thanks!

Have you read the CONTRIBUTING guide?

memsharded commented 1 year ago

Hi @maitrey

It is not very clear what is the effect of the Matlab version in the packages:

maitrey commented 1 year ago

Hi @memsharded

memsharded commented 1 year ago

Still missing some context. Please note that while I have used matlab long time ago, I am not that familiar with the concepts there:

maitrey commented 1 year ago
memsharded commented 1 year ago

It uses different functionality from different matlab versions

Still the source code is exactly the same for the different matlab versions?

1- Use options for the matlab toolbox packages , options for different versions of matlab. However, this leads to all dependnecies upwards to include options in their recipes.

Why adding an option to a tool_requires that is a matlab toolbox package will need the option upstream if the toolbox package is just source code?

maitrey commented 1 year ago
  • Are the .mltbx files compiled files, or source files? They are compiled files.

    It uses different functionality from different matlab versions This I need to double check, as I am only user of the package. Still the source code is exactly the same for the different matlab versions? No the generated code could be different for different matlab versions 1- Use options for the matlab toolbox packages , options for different versions of matlab. However, this leads to all dependnecies upwards to include options in their recipes.

Why adding an option to a tool_requires that is a matlab toolbox package will need the option upstream if the toolbox package is just source code? For example Package A contains options one for matlab 2017 , another for 2018. Package B uses Package A with option as matlab 2017. Package C uses Package A and B. All three must use Package A with matlab 2017. When package A version is specified, it has aversion , 1.0.0@autosar/release for example. In order to download the exact package Id , package B and C must specify the same options as in Package A. Have I misunderstood something ?

memsharded commented 1 year ago

Have I misunderstood something ?

Not sure, it could be. For example the tool_requires do not affect the package_id of the consumers by default. It doesn't matter if the tool_requires is one or other. In Conan 2.0 it is possible to control the effect of tool_requires in packages with more power and flexibility, but it is important to know the relative relations of packages.

In this case, I am trying to understand the different contents (this is why above I was asking about the sources and binaries), but also the relations between packages. It is not the same a tool_requires than a requires regarding many things.

I am starting to think that maybe the most convenient is to add a matlab_compiler to your settings.yml and let packages affected by that version declare that extra setting. That might not be necessary in every package of the graph, but that also depends on the structure and the APIs of the generated code.