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

Improve graph conflict message when Conan can't show one of the conflicting recipes #13946

Merged
merged 8 commits into from
Jun 13, 2023

Conversation

AbrilRBS
Copy link
Member

@AbrilRBS AbrilRBS commented May 23, 2023

Changelog: Fix: Improve graph conflict message when Conan can't show one of the conflicting recipes.
Docs: Omit

The error now looks like:

ERROR: Version conflict: Conflict between math/1.0.1 and math/1.0 in the graph.
       Conflict originates from ai/1.0
       Run conan graph info ... --format=html to inspect the graph errors.

The graph output with conflict errors now looks like this:

image

Pinging @SSE4

@SSE4
Copy link
Contributor

SSE4 commented May 23, 2023

@RubenRBS can we output graph to the stdout (e.g. json format) instead of asking to run --html? if error happens on CI (e.g. in ConanCenterIndex) it's too hard to debug this way.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --format=html suggestion for conflicts is not useful at the moment, because the html output is not that evident yet. I would add the html changes in this PR too.

return f"Version conflict: " \
f"Conflict between {self.require.ref} and {self.prev_require.ref} in the graph." \
f"{conflicting_node_msg}" \
f"\nRun conan graph info ... --format=html to inspect the graph errors."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would print this --format=html (with redirect > graph.html) in all cases, even the "simple" part of the if

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it print actual arguments here instead of ...? so it could be copy-pasted easily.


c.run("install --requires=engine/1.0 --requires=ai/1.0", assert_error=True)
assert "Conflict between math/1.0.1 and math/1.0 in the graph"
assert "Conflict originates from ai/1.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that --format=html is also suggested

@SSE4
Copy link
Contributor

SSE4 commented May 23, 2023

to execute this suggestion on CI server (e.g. ConanCenterIndex) I would need:

  • modify build script to run --html command (and for CCI, it's out of contributor's control)
  • run one more build and wait (potentially, hours)
  • somehow capture/copy produced .html file
    IMO too much extra burden for users. I would just print JSON graph straight outta stderr.

@memsharded
Copy link
Member

to execute this suggestion on CI server (e.g. ConanCenterIndex) I would need:

The idea is that not all debugging needs to happen in the CI server. Especially something that should have been detected by the developer in their machine while testing locally in the first place. It is not that a version conflict is something that only happens and can be debugged in the CI server.

So the recommended approach is not start modifying the CI, but execute a conan graph info locally, by the developer in the developer machine, not in CI. Even for other platforms and cross build different to the current machine it is completely possible to reproduce a version conflict.

@czoido czoido added this to the 2.0.7 milestone May 24, 2023
@AbrilRBS
Copy link
Member Author

The graph now looks like this
image

@AbrilRBS
Copy link
Member Author

Remove red from UI, change lib link to red

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix broken test (checking for the wrong output message), and can be merged

@czoido czoido merged commit a5adc52 into conan-io:release/2.0 Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants