You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running conan create to build a specific package (given input profiles, options, etc), there are some circumstances in which the package may be created, but test_package can fail, some examples:
when the test_package has a self.requires()and a self.tool_requires() on self.tested_reference_str. In some circumstances this can lead to two different package IDs being required for a successful test package, for example:
--profile:build and --profile:host are different when cross compiling - the test package will fail if the package for the build profile does not previously exist.
-o "*:shared=True" - the option only applies to the host context, but not the build context (the package ID resolved for the tool require) - here we are NOT cross building but it would still fail, unless the same options and settings were passed to both build and host contexts.
when the package is always used as a tool_requires, and the test package has self.tool_requires() on the tested reference - in this case, the options and settings will apply to what is being created, but a different package ID will be required when testing. In these instances, --build-require should be passed to the command line when invoking conan create - but this requires external knowledge that the tool is used as a tool requirement.
For the first scenario, knowledge of this situation is required in order to derive a correct build order, or alternatively one may want to silence the test package (-tf=""). For the second scenario, one must know that the package is (exclusively?) used as a tool requirement to pass --build-require when invoking conan create.
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
Today I stumbled upon a similar/same issue but found out that not even --build=missing helps, even if applied to conan test only.
I'm generally OK with the fact that conan create creates only a single package ID, but a subsequent conan test should be able to build its missing packages by dependency, even if it's executed as part of conan create (and yes, that would mean that multiple package IDs are created with single conan create call).
#14347 has changed this, adding the --build-test=xxx alternative (that defaults to --build) that allows to control what is being built. conan create . --build=missing will also build missing binaries for test_package and conan create . --build-test=missing will do the same, but guaranteeing that no packages in the "main" tested graph are being built from source. It will be in 2.0.10
What is your question?
For discussion / look into.
When running
conan create
to build a specific package (given input profiles, options, etc), there are some circumstances in which the package may be created, buttest_package
can fail, some examples:when the
test_package
has aself.requires()
and aself.tool_requires()
onself.tested_reference_str
. In some circumstances this can lead to two different package IDs being required for a successful test package, for example:--profile:build
and--profile:host
are different when cross compiling - the test package will fail if the package for the build profile does not previously exist.-o "*:shared=True"
- the option only applies to the host context, but not the build context (the package ID resolved for the tool require) - here we are NOT cross building but it would still fail, unless the same options and settings were passed to both build and host contexts.when the package is always used as a
tool_requires
, and the test package hasself.tool_requires()
on the tested reference - in this case, the options and settings will apply to what is being created, but a different package ID will be required when testing. In these instances,--build-require
should be passed to the command line when invokingconan create
- but this requires external knowledge that the tool is used as a tool requirement.For the first scenario, knowledge of this situation is required in order to derive a correct build order, or alternatively one may want to silence the test package (
-tf=""
). For the second scenario, one must know that the package is (exclusively?) used as a tool requirement to pass--build-require
when invokingconan create
.Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: