[bug] build_id broken in 2.0-beta
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: Ubuntu 20.04 (docker)
- Compiler+version: gcc9
- Conan version: 2.0-beta2
- Python version: 3.8.10
Steps to reproduce (Include if Applicable)
I have a use case where I want to create multiple versions of a package that takes a while to build. I use the build_id function so that I only have to build once. The different versions have different options and different dependencies (some of the options effect the requirements). Here is some code that worked just fine in conan 1.x
def build_id(self):
# We don't want the option or the requirement to impact the build_id
self.info_build.options.with_zeromq = "Any"
if self.options.with_zeromq:
self.info_build.requires.remove("zeromq")
In the 2.0-beta, the remove
fails with a KeyError
. I was able to trace the error to conans/model/dependencies.py::delitem.
def __delitem__(self, name):
r = self.get(name)
del self._data[r]
self.get
returns a conans.model.info.RequirementInfo
object and the self._data
keys are conans.model.requires.Requirement
objects. Thus the del self._data[r]
command fails with a KeyError.
Logs (Executed commands with output) (Include/Attach if Applicable)
ERROR: test_package/1.0.0: Error in build_id() method, line 378 self.info_build.requires.remove(“zeromq”) KeyError: <conans.model.info.RequirementInfo object at 0x7f75b69d9ac0>
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks. You guys are so responsive.
Closed by https://github.com/conan-io/conan/pull/12019 to be relased in beta3