Bugfix: add test to illustate failure when options differ between requires and build requires#9839
Bugfix: add test to illustate failure when options differ between requires and build requires#9839SSE4 wants to merge 1 commit into
Conversation
… requirements Signed-off-by: SSE4 <tomskside@gmail.com>
|
checked |
|
I was doing a UPD: indeed, it removes the line doing |
|
I have checked this for a second time (sorry for the delay, I checked it some time ago, but didn't finalize report), it really looks like it is impossible to backport any of that from 2.0 to 1.X without breaking. |
|
For anyone arriving at this issue, let's provide a workaround for Conan v1 (see below). Description of the scenarioIf the same recipe name is used in host and build contexts, but those contexts are using different recipes with different options (number or name, not values), for example: name/v1/conanfile.py class Recipe(ConanFile):
name = "name"
version = "v1"
options = {
"opt1": [True, False]
}name/v2/conanfile.py class Recipe(ConanFile):
name = "name"
version = "v2"
options = {
"opt2": [True, False]
}And the consumer: conanfile.txt [requires]
name/v1
[build_requires]
name/v2Conan v1 will compute only one set of options and it will try to apply the same set to both recipes. Conan will raise an error saying that some of those options cannot be found in the recipe (indeed, Workaround for Conan v1The easiest way to workaround this issue is to match the list of options between the two versions, by adding dummy (unused) options to their recipes: name/v1/conanfile.py class Recipe(ConanFile):
name = "name"
version = "v1"
options = {
"opt1": [True, False],
"opt2": [True, False], # <-- not used in this version
}
def package_id(self):
del self.options.opt2 # <-- removed from package-id computationname/v2/conanfile.py class Recipe(ConanFile):
name = "name"
version = "v2"
options = {
"opt1": [True, False], # <-- not used in this version
"opt2": [True, False]
}
def package_id(self):
del self.options.opt1 # <-- removed from package-id computation |
openssl is also a requirement of cmake, so we hit a bug of conan v1 related to a conflict between deleted options of different versions of openssl in requirement & build requirement. see conan-io/conan#9839
openssl is also a requirement of cmake, so we hit a bug of conan v1 related to a conflict between deleted options of different versions of openssl in requirement & build requirement. see conan-io/conan#9839
* modernize * cleanup test package * workaround for CMake bug related to `@rpath` * declarative patches * tvos-watchos patch not suited for 1.1.0k to 1.1.1f this patch has probably never been tested properly in all versions it claimed to support * another workaround for `@rpath` in test package openssl is also a requirement of cmake, so we hit a bug of conan v1 related to a conflict between deleted options of different versions of openssl in requirement & build requirement. see conan-io/conan#9839
|
It will not be possible to provide a fix for 1.X, and this will need to wait until 2.0 for a solution. |
we have found conan client may fail if options are different between requirements and build requirements:
conan-io/conan-center-index#7747 (comment)
I think the cause of the issue is:
conan/conans/client/graph/graph_binaries.py
Line 311 in 6d7642d
Changelog: omit
Docs: omit
developbranch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.