-
Notifications
You must be signed in to change notification settings - Fork 1.1k
poc of testing and installing build_requires as build_requires #8627
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
Conversation
conans/client/installer.py
Outdated
@@ -576,7 +577,10 @@ def _propagate_info(self, node, using_build_profile): | |||
|
|||
for n in node_order: | |||
if n not in transitive: | |||
conan_file.output.info("Applying build-requirement: %s" % str(n.ref)) | |||
try: | |||
conan_file.output.info("Applying build-requirement: %s" % str(n.ref)) |
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.
?
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.
The printing of virtual consumers is disabled, because it was very confusing to users, seeing something like (virtual): Applying build-requirement...
. So conanfile.output.info
or any other printing command will raise for RECIPE_VIRTUAL
recipe.
conans/test/integration/build_requires/test_install_test_build_require.py
Show resolved
Hide resolved
conans/client/graph/graph_manager.py
Outdated
@@ -290,11 +304,11 @@ def _recurse_build_requires(self, graph, builder, check_updates, | |||
for node in graph.ordered_iterate(nodes_subset): | |||
# Virtual conanfiles doesn't have output, but conanfile.py and conanfile.txt do | |||
# FIXME: To be improved and build a explicit model for this | |||
if node.recipe == RECIPE_VIRTUAL: | |||
continue | |||
#if node.recipe == RECIPE_VIRTUAL: |
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.
?
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.
Virtual
recipes couldn't have build_requires
so far, only regular requires
. This is opening the door for this possibility.
@@ -306,8 +306,11 @@ def load_virtual(self, references, profile_host, scope_options=True, | |||
conanfile.conf = profile_host.conf.get_conanfile_conf(None) | |||
conanfile.settings = profile_host.processed_settings.copy_values() | |||
|
|||
for reference in references: | |||
conanfile.requires.add_ref(reference) | |||
if is_build_require: |
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.
may they have the same interface? e.g.
if is_build_require:
for reference in references:
conanfile.build_requires.add_ref(reference)
else:
for reference in references:
conanfile.requires.add_ref(reference)
cmd = ". ./activate.sh && mycmake.sh" if platform.system() != "Windows" else \ | ||
"activate.bat && mycmake.bat" | ||
client.run_command(cmd) | ||
system = {"Darwin": "Macos"}.get(platform.system(), platform.system()) |
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.
why this pattern is repeating and needed?
Changelog: Feature: New
conan install <ref> --build-require
andconan create <path> --build-require
(when not usingtest_package
) arguments to explicitly define that the installed or created package has to be abuild-require
, receiving the build profile instead of the host one.Docs: omit
This follows #8787 that added support for the
test_package
.To discuss: Should we use
--build-require
always forconan create
, even if it is defined intest_package/conanfile.py
withtest_type = "build_requires"
?#tags: slow