Skip to content
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

[bug] conan2 Assertion error when using override in downstream package in specific scenario #13630

Closed
nicosmd opened this issue Apr 5, 2023 · 2 comments · Fixed by #13631
Closed
Assignees
Labels
Milestone

Comments

@nicosmd
Copy link
Contributor

nicosmd commented Apr 5, 2023

Environment details

  • Operating System+version: Ubuntu 22.04
  • Compiler+version: gcc 11.3.0
  • Conan version: conan 2.0.3
  • Python version: 3.10.9

Steps to reproduce

  1. follow the instructions on: https://github.com/nicosmd/conan2-missing-override-bug

Logs

conan create .

======== Exporting recipe to the cache ========
libc/0.1: Exporting package recipe: /home/user/dev/conan2-missing-override-bug/libc/conanfile.py
libc/0.1: Copied 1 '.py' file: conanfile.py
libc/0.1: Exported to cache folder: /home/user/.conan2/p/libc131a61a3214d9/e
libc/0.1: Exported: libc/0.1#423a07067eef81c2ee8b320fd2cb100c (2023-04-05 19:50:45 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=10
os=Linux
[options]
opencv*:with_ffmpeg=False
opencv*:with_gtk=False
[conf]
tools.cmake.cmake_layout:build_folder_vars=['settings.arch']

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=10
os=Linux
[options]
opencv*:with_ffmpeg=False
opencv*:with_gtk=False
[conf]
tools.cmake.cmake_layout:build_folder_vars=['settings.arch']


======== Computing dependency graph ========
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/cli.py", line 272, in main
    cli.run(args)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/cli.py", line 171, in run
    command.run(self._conan_api, self._commands[command_argument].parser, args[0][1:])
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/command.py", line 157, in run
    info = self._method(conan_api, parser, *args)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/cli/commands/create.py", line 69, in create
    deps_graph = conan_api.graph.load_graph_requires(requires, tool_requires,
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/api/subapi/graph.py", line 123, in load_graph_requires
    deps_graph = self.load_graph(root_node, profile_host=profile_host,
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conan/api/subapi/graph.py", line 172, in load_graph
    deps_graph = builder.load_graph(root_node, profile_host, profile_build, lockfile)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph_builder.py", line 53, in load_graph
    new_node = self._expand_require(require, node, dep_graph, profile_host,
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph_builder.py", line 100, in _expand_require
    node.propagate_closing_loop(require, prev_node)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph.py", line 82, in propagate_closing_loop
    prev_node.propagate_downstream(transitive.require, transitive.node, self)
  File "/home/user/miniconda3/envs/conan2/lib/python3.10/site-packages/conans/client/graph/graph.py", line 86, in propagate_downstream
    assert node is not None
AssertionError

ERROR:
@memsharded
Copy link
Member

Thanks very much @nicosmd for your report, and specially for the detailed minimal repro case.

It was super helpful to quickly investigate and reproduce the issue. It was exactly the bad coincidence of having an override defined in the package that is a node in the graph that is closing a typical "diamond" structure, and this is why it doesn't happen for the other (majority) of cases when using overrides.

I have already been able to submit a fix in #13631 for next 2.0.4.

@nicosmd
Copy link
Contributor Author

nicosmd commented Apr 6, 2023

Thanks @memsharded , I'm very glad that I could help :) I'm closing the issue then since the fix is already submitted.

@nicosmd nicosmd closed this as completed Apr 6, 2023
AbrilRBS added a commit that referenced this issue Apr 11, 2023
Changelog: Bugfix: Fix crash when ``override`` is used in a node of the
graph that is also the closing node of a diamond.
Docs: Omit

Close #13630
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants