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
Add component requires information #1682
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would promote this "Components" subsection inside cpp_info
attribute to a dedicated section in the "Creating packages" one, it should contain all the considerations, detailed information, examples, notes, warnings,... and make this reference about cpp_info
more straightforward with a link to the other section.
The section about components will grow with more examples when generators implement their part.
wdyt?
Co-Authored-By: Anonymous Maarten <madebr@users.noreply.github.com>
@@ -933,30 +933,58 @@ Components | |||
|
|||
This is a **experimental** feature subject to breaking changes in future releases. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, I'd remove all this "Components" section and substitute it by a paragraph (if you feel like, move more things to the other section):
"More fine grained control over individual libraries available in a single Conan package can be achieved using components
(LINK). Components allow you define a cpp_info
object per each of those libraries and also requirements between them and to components of other packages:"
Python with example.
"Note that components should declare explicitly that they require other packages...."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of agree. This section still reads a bit like tutorial, not reference. Maybe moving some parts to the other doc, and leaving here just the components fields reference.
.. important:: | ||
|
||
Note that component requires should **explicitly** define requirements to other package (``zlib::zlib``) or other package components | ||
(``openssl::ssl``). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is important and it is not clear enough: "By default components won't link against any other package required by the recipe, the requires
list has to be populated explicitly with the list of components from other packages to use: it can be a single component (example) or the full requirement (example)."
…nto feature/components_deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new section there in "creating packages", good!
@@ -933,30 +933,58 @@ Components | |||
|
|||
This is a **experimental** feature subject to breaking changes in future releases. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of agree. This section still reads a bit like tutorial, not reference. Maybe moving some parts to the other doc, and leaving here just the components fields reference.
self.cpp_info.components["ssl"].includedirs = ["include/headers_ssl"] | ||
self.cpp_info.components["ssl"].libs = ["libssl"] | ||
self.cpp_info.components["ssl"].requires = ["crypto"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at this moment it would be very good to highlight as "important" note, that yes, this is a bit of repeated information of what the package might have in its build scripts, but this is better:
- Not a big deal, typically define it once, not that terrible repetition, and it is nicely explicit and relatively intuitive
- The most important thing: This is generic and can be consumed by other build systems, different ones from the used one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the "important" box at the top as a general message. Please check it and I can move it down here if you want. thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check comments.
And we need a link from the section in reference/conanfile/methods.html#package-info
to the new components' one in package_information_components
reference/conanfile/attributes.rst
Outdated
|
||
The structure of the ``Component`` object is the same as the one used by the ``cpp_info`` object and has **the same default directories**. | ||
dictionary). The information of components is not lost but aggregated to the *global* scope and the usage of components should be | ||
transparent right now to consumers and generators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove this important
and add a link to the package_information_components
. Take into account the seealso
note below, probable both of them can be joined.
Co-authored-by: Javier G. Sogo <jgsogo@gmail.com>
…nto feature/components_deps
Docs for conan-io/conan#6871