Skip to content
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

[feature] Manage shared, fPIC and header_only options automatically #14194

Merged
merged 23 commits into from
Jul 11, 2023

Conversation

danimtb
Copy link
Member

@danimtb danimtb commented Jun 29, 2023

Changelog: Feature: Manage shared, fPIC, and header_only options automatically.
Changelog: Feature: Manage package ID for header-library package type automatically.
Docs: conan-io/docs#3296

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

@danimtb danimtb self-assigned this Jun 29, 2023
@uilianries
Copy link
Member

Is it possible to add a new recipe attribute later, only working with Conan 2.x, that could be a shortcut to those new methods?

Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a comment about the Conan private methods, to see what you all think, but otherwise it is looking great so far :)

conans/client/conanfile/configure.py Outdated Show resolved Hide resolved
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far!

conan/tools/options/helpers.py Outdated Show resolved Hide resolved
conans/client/conanfile/configure.py Outdated Show resolved Hide resolved
conans/model/conan_file.py Outdated Show resolved Hide resolved
conans/model/options.py Outdated Show resolved Hide resolved
conans/test/unittests/tools/options/test_options_tools.py Outdated Show resolved Hide resolved
@danimtb danimtb changed the title [feature] Manage shared, fPIC and header_options automatically [feature] Manage shared, fPIC and header_only options automatically Jul 4, 2023
@danimtb danimtb marked this pull request as ready for review July 4, 2023 11:18
@danimtb
Copy link
Member Author

danimtb commented Jul 4, 2023

Is it possible to add a new recipe attribute later, only working with Conan 2.x, that could be a shortcut to those new methods?

@uilianries I think we already discussed this before starting the implementation and preferred not to bother with attributes as it will be less intuitive. Maybe in the future, we change our minds, but at the moment it is very straightforward to just declare the options or package type

conans/client/conanfile/configure.py Outdated Show resolved Hide resolved
conans/test/integration/options/test_configure_options.py Outdated Show resolved Hide resolved
conans/model/options.py Outdated Show resolved Hide resolved
conans/model/options.py Outdated Show resolved Hide resolved
Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great, good job @danimtb! Thanks for taking the initiative on it and implementing it :)

I have two minor questions besides the reviews that everyone else has already done, the rest looks great, congrats!



def handle_common_package_id_options(conanfile):
if conanfile.options.get_safe("header_only") or conanfile.package_type == PackageType.HEADER:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking that if by the point this gets executed the package type has already been properly computed, why rely on the option? I don't actually know if having it is better or worse, so happy to hear your opinion :)

conans/client/graph/compute_pid.py Outdated Show resolved Hide resolved
conan/tools/options/helpers.py Outdated Show resolved Hide resolved
conans/client/graph/compute_pid.py Outdated Show resolved Hide resolved
danimtb and others added 2 commits July 6, 2023 10:14
Co-authored-by: James <memsharded@gmail.com>
Copy link
Member

@AbrilRBS AbrilRBS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :)

conans/test/utils/mocks.py Outdated Show resolved Hide resolved
danimtb and others added 3 commits July 10, 2023 10:17
Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
@danimtb danimtb assigned memsharded and unassigned danimtb Jul 11, 2023
@danimtb danimtb added this to the 2.0.8 milestone Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants