-
Notifications
You must be signed in to change notification settings - Fork 1k
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 implements attribute in ConanFile to provide opt-in automatic management of some options and settings. #14320
Merged
czoido
merged 8 commits into
conan-io:release/2.0
from
czoido:add_opt_in_for_default_option_handling
Jul 19, 2023
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aed5b01
add options_auto_handle to auto handle options
czoido c81a24f
add with_options_auto_handle
czoido 69e5ae1
minor changes
czoido 65f4303
review
memsharded 4904b75
implement implements
czoido 8e0bb02
fix comment
czoido fd8d81f
review
czoido 3437b90
unused import
czoido File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -10,7 +10,7 @@ def run_configure_method(conanfile, down_options, profile_options, ref): | |||||||
if hasattr(conanfile, "config_options"): | ||||||||
with conanfile_exception_formatter(conanfile, "config_options"): | ||||||||
conanfile.config_options() | ||||||||
else: | ||||||||
elif conanfile.activate_default_behaviors: | ||||||||
default_config_options(conanfile) | ||||||||
|
||||||||
# Assign only the current package options values, but none of the dependencies | ||||||||
|
@@ -20,7 +20,7 @@ def run_configure_method(conanfile, down_options, profile_options, ref): | |||||||
if hasattr(conanfile, "configure"): | ||||||||
with conanfile_exception_formatter(conanfile, "configure"): | ||||||||
conanfile.configure() | ||||||||
else: | ||||||||
elif conanfile.activate_default_behaviors: | ||||||||
default_configure(conanfile) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
self_options, up_options = conanfile.options.get_upstream_options(down_options, ref, | ||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Don't love the name, but challenging to find a better one. Some ideas:
auto_configuration = True
manage_options = True
auto_manage_library_type_configuration = True
auto_manage_library_configuration = True
auto_library_configuration = True
library_type_defaults = True
Generic list of things?
auto_manage = ["library_type_configuration", "app_type_configuration"]
auto_manage = ["library_configuration", "app_configuration"]
auto = ["library_configuration", "app_configuration"]
policies = ["auto_shared_fpic", "auto_header_only", "auto_cmake"]
auto_manage = ["shared_fpic", "header_only"]
rules, auto, defaults, implicits, auto_behaviors, mods, builtins, mixin, recipe_auto, recipe_defaults, config_templates
implements = ["auto_shared_fpic", "cmake_template"]
applies = [
sidecar = ["auto_shared_fpic", ]
recipe_presets = [
salt_and_pepper = ["auto_shared_fpic"
pre-cooked = ["auto_shared_
build_policy = "missing", upload_policy = "skip"
The language case would be a different one most likely:
languages = "C", "C++", "fortran"
Maybe "configuration" and "options" should be in the var name?
FINAL DECISION:
implements = ["auto_shared_fpic", "auto_header_only"]
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 agree. We should think of another shorter one if possible.