Skip to content

Deprecated - node.dependencies -> node.edges #212

@choose-name

Description

@choose-name

Hello
In conan 2.21+, the internal field of the dependency graph node.dependencies was renamed to node.edges. When attempting to create an SBOM with the command

conan sbom:cyclonedx --format 1.4_json

at the “Computing dependency graph” stage, the script terminates with the error “WARN: deprecated: Node.dependencies is private and shouldn't be used. It is now node.edges. Please fix your code, Node.dependencies will be removed in future versions” which causes the final sbom to lack transitive dependencies and a dependency graph.

This problem can be fixed by renaming dep.dependencies in the file “extensions/commands/sbom/cmd_cyclonedx.py”

before

for dep in deps_graph.nodes:
    if filter_context(dep):
        bom.register_dependency(components[dep], [components[dep_dep.dst] for dep_dep in dep.dependencies if filter_context(dep_dep.dst)])
return bom

after

for dep in deps_graph.nodes:
    if filter_context(dep):
        bom.register_dependency(components[dep], [components[dep_dep.dst] for dep_dep in dep.edges if filter_context(dep_dep.dst)])
return bom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions