-
Notifications
You must be signed in to change notification settings - Fork 980
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
[bug] requires of a dependency of a dependency in build context not visible #16333
Comments
Thanks for your report. To summarize the graph would be:
I'd like to start with a recommendation: If the intention is that the It would be also good to understand how shared libraries can be used as "tool-requires" ( Thanks very much for your reproducible code, I will use it to make a test, and understand what could be happening. |
Thanks for the quick reply!
Yes, Matlab is a very special case... one might have a model that depends on a Simulink library (like a C++ header-only lib), that depends on a library, ... and at some point there's an sfunction. For building the final model, all of that is needed in the build environment which is where we run Matlab to generate the C++ code.
Yes, essentially that is what we want; however making an explicit tool requirement from
Yes, those libraries will be incompatible (and cross-compiling actually works with |
I have been having a look and so far it seems the |
This is quite challenging, and needs to be considered (small) step by step, defining how build requirements need to propagate when made visible requires some deeper research and careful consider what could be breaking. I am assigning it for 2.5 (2.4 will be soon), to start working on it, but it might take longer time and require a few iterations and releases to move forward. |
Thanks for the feedback! We're happy to test with our use case as soon as that's possible. From having a quick look, could it be that this issues comes from the following lines where conan/conans/model/requires.py Lines 280 to 281 in 36148df
|
Describe the bug
conan 2.3.0
For building Matlab Code with s-functions, certain packages have to be propagated with
build=True, visible=True
traits. It seems however that the dependencies of such packages in build context disappear at some point.As minimal example, we have the following dependency tree:
pkgb
->libpkgb
->libpkgb_dependency
where
pkgb
contains the sfunction which should only reside in build context (think about a cross build scenario, the sfunction has to execute in Matlab only at build time and generates code), this sfunction depends onlibpkgb
(some shared library) and the generated code also depends onlibpgkb
so that one has to be available in both contexts.libpkgb_dependency
(another shared library) is just a dependency oflibpkgb
, so it also has to be available in both contexts.This s-function is then consumed by
pkga
(e.g. a Simulink model) as follows:pkga
(host context) ->libpkgb
pkga
(build context) ->pkgb
withvisible=True
trait.It now seems that the dependencies of
pkgb
in build context disappear whenpkga
is consumed bypkga_consumer
in host context. This makes it impossible to e.g. aggregate Matlab packages with s-functions for opening Matlab inside aVirtualBuildEnv
to e.g. generate code.Please see below zip file for exemplary conanfiles and the requirement traits used (maybe those are also incomplete?).
How to reproduce it
Execute
./create_all.sh
:pkga
haslibpkgb
in its build requirements as expected:pkga_consumer
haslibpkgb
not anymore in its build requirements:dependency_propagation_build.zip
The text was updated successfully, but these errors were encountered: