-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
docs: capture our policy for the options shared
and fPIC
#12281
Conversation
This came as a question on Slack, thought it was worth writting down https://cpplang.slack.com/archives/C41CWV9HA/p1660683315599809
This comment has been minimized.
This comment has been minimized.
IMHO, there is some overlapping between this section and https://github.com/conan-io/conan-center-index/blob/master/docs/packaging_policy.md#options, we can argue that one is targeting reviewers while the other is more for recipe authors... but in the end both are the same people and both sections should contain the same message. Maybe it is time to merge those sections and update them, wdyt? |
Yes. Indeed is a sad situation when you are a newbie knows nothing about it and need a review to discover default values and other stuff. Merging sections sounds good. |
Given I was not able to find these docs... I think it's worth giving it some TLC and combining things together with "how to add package" might be the next step |
This comment has been minimized.
This comment has been minimized.
I've decided to revive this since conference are making my other idea take longer then expected |
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.
LGTM
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.
IMHO, the note about the default value of shared
option for other packages is really important.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
docs/packaging_policy.md
Outdated
if self.options.shared: | ||
try: | ||
del self.options.fPIC | ||
except Exception: |
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.
FYI, Conan 1.53 will bring the new method rm_safe
(also for settings
) so it'll be possible to avoid those try-except structures. It'll look like this:
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
Co-authored-by: Francisco Ramírez <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Thanks for holding my hand 💟 I think I finally captured the important parts
This comment has been minimized.
This comment has been minimized.
|
||
Recipes with such option should include the following in their `package_id` method | ||
|
||
```python | ||
def package_id(self): | ||
if self.options.header_only: | ||
self.info.header_only() | ||
self.info.clear() |
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.
It would be nice adding a note about how it affects self.info.settings
and self.info.options
. Settings is None and settings.compiler
is not make affect for check_min_cppstd
, only when installing the package. Otherwise, it would require validate_build
with self.settings.compiler
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 that should go into the main Conan docs since it's pretty generic.
"For more information about how this affects the package_id
read the documentation here" type of thing?
Co-authored-by: Uilian Ries <[email protected]>
Updating docs! |
Docs!
This came as a question on Slack, thought it was worth writing down
https://cpplang.slack.com/archives/C41CWV9HA/p1660683315599809