Comments (3)
Thanks for your report.
To summarize the graph would be:
pkga_consumer -(requires)-> pkga(shared) --------(requires)--------->libb(shared) -(requires)-> libb_dep(shared)
\--(build-require) ->pkgb(shared)-->/
I'd like to start with a recommendation: build=True, visible=True
will be really discouraged in most cases. I have already had some experience trying it, and I would advice against this.
If the intention is that the pkga_consumer
needs some tool-requires
for itself, because it needs such tool requires to build itself, then that means that pkgb
(shared-library) should be a direct dependency for pkga_consumer
and it shouldn't be inherited from pkga
It would be also good to understand how shared libraries can be used as "tool-requires" (build=True
), as this puts such libraries in the "build" context, so the binaries might actually be incompatible (cross-compilation) or inconsistent/incorrect (building for debug will still bring Release for the build context by default).
Thanks very much for your reproducible code, I will use it to make a test, and understand what could be happening.
from conan.
Thanks for the quick reply!
I'd like to start with a recommendation:
build=True, visible=True
will be really discouraged in most cases. I have already had some experience trying it, and I would advice against this.
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.
If the intention is that the
pkga_consumer
needs sometool-requires
for itself, because it needs such tool requires to build itself, then that means thatpkgb
(shared-library) should be a direct dependency forpkga_consumer
and it shouldn't be inherited frompkga
Yes, essentially that is what we want; however making an explicit tool requirement from pkga_consumer
to the sfunction is hard as the name, version etc. of that sfunction would need to stay in sync with a possibly long dependency tree in between. We would like to give Matlab developers the possibility to depend on a library which might come with such sfunction in some place without explicitly having to specify that sfunction.
It would be also good to understand how shared libraries can be used as "tool-requires" (
build=True
), as this puts such libraries in the "build" context, so the binaries might actually be incompatible (cross-compilation) or inconsistent/incorrect (building for debug will still bring Release for the build context by default).
Yes, those libraries will be incompatible (and cross-compiling actually works with pkga
as root). The sfunction in pkgb
might need libpkgb
to generate code (but it's a normal requires of pkgb
-> to my understanding, it should land in build context as soon as pkg
is put in build context in that case) while the generated code links against libpkgb
for possibly a different architecture.
from conan.
I have been having a look and so far it seems the build=True
trait has higher priority than the visible=True
one, so build-requires are still not being fully propagated. I will keep investigating tomorrow if it is possible to do this propagation without risks of breaking.
from conan.
Related Issues (20)
- [bug] test_package_folder attribute doesn't work HOT 1
- [question] Limitations of `CMakeToolchain` wrt legacy generators HOT 4
- [bug] Github actions fail when set `tools.system.package_manager:mode` HOT 2
- [question] How to depend on a specific Git commit or branch of a project HOT 7
- [bug] build_requires with different #RREV are not used correctly HOT 2
- [question] What is the correct way of exposing PATH when packaging library type? HOT 2
- [bug] CMakeToolchain changes the value of string variables unexpectedly/incorrectly HOT 6
- [feature] [question] Support the Tricore-gcc toolchain and arch
- Incorrect generation of file conanvcvars.ps1 HOT 2
- [question] Conan centre package rereleases HOT 9
- [question] Should Visual Studio 17.10 require a profile update to 194? HOT 31
- [bug] Multiple `--build=missing:~foo` does not work HOT 3
- [bug] Conan setting `CMAKE_FIND_ROOT_PATH_MODE_*=BOTH` fundamentally breaks cross-compilation HOT 4
- [feature] Add a --skip-generator option HOT 4
- [feature] Allow multiline blocks and inline comments in profiles HOT 1
- [question] Handling package that is platform and variant agnostic but not the tests in the package HOT 30
- [question] Install from local recipes index with user/channel HOT 9
- [question] How to modify global.conf HOT 10
- [bug] conan.tools.build.check_min_cppstd does infer default cppstd as documented HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conan.