Skip to content

Conversation

jens-erdmann
Copy link
Contributor

Conan v1 and v2 return 'Conan version X.XX' when called with '--version' parameter. To properly determine which variant of the Conan handler to be used, the full prefix has to be checked, otherwise ConanV2Handler will always be used.

For reference the outputs of Conan v1 and v2 from Docker image version 61.0.0:

ort@e3e6081438c0:~$ conan --version
Conan version 1.66.0

ort@e3e6081438c0:~$ conan2 --version
Conan version 2.14.0

Conan v1 and v2 return 'Conan version X.XX' when called with '--version'
parameter. To properly determine which variant of the Conan handler to
be used, the full prefix has to be checked, otherwise ConanV2Handler
will always be used.

Signed-off-by: Jens Erdmann <[email protected]>
@jens-erdmann jens-erdmann requested a review from a team as a code owner June 17, 2025 18:20
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.75%. Comparing base (23a177b) to head (0271f55).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #10493   +/-   ##
=========================================
  Coverage     56.75%   56.75%           
  Complexity     1644     1644           
=========================================
  Files           337      337           
  Lines         12480    12480           
  Branches       1177     1177           
=========================================
  Hits           7083     7083           
  Misses         4945     4945           
  Partials        452      452           
Flag Coverage Δ
test-ubuntu-24.04 41.04% <ø> (ø)
test-windows-2022 41.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


private val handler by lazy {
if (command.getVersion().startsWith("1.")) {
if (command.getVersion().startsWith("Conan version 1.")) {
Copy link
Member

Choose a reason for hiding this comment

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

Removing this prefix is already done in line 77, so I don't think it's necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I missed that one.
Then I am running out of ideas. I am still running into the issue that ConanV2Handler is used in combination with Conan version 1:

14:12:24.377 [DefaultDispatcher-worker-1] WARN  org.ossreviewtoolkit.plugins.packagemanagers.conan.ConanV2Handler - Failed to list remotes.
14:12:25.568 [DefaultDispatcher-worker-1] ERROR org.ossreviewtoolkit.analyzer.PackageManager - Conan failed to resolve dependencies for path 'conanfile.py': IOException: Running 'conan graph info -f json --out-file /tmp/ort-ConanV2Handler12215941369031907775/info.json -s compiler=gcc -s compiler.libcxx=libstdc++ -s compiler.version=11.1 conanfile.py' in '/builds/Jens.Erdmann/mflstd-impl' failed with exit code 1:
ERROR: Unknown command 'graph'

Copy link
Member

Choose a reason for hiding this comment

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

Maybe @nnobelis can help here. But please move the discussion to, well, GitHub discussions or to Slack then.

Copy link
Member

Choose a reason for hiding this comment

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

As a side note, #10127 might be of interest to you, @jens-erdmann.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Sorry for the noise

@sschuberth sschuberth closed this Jun 18, 2025
@jens-erdmann
Copy link
Contributor Author

@sschuberth I have found the issue and a fix for it. Should we reopen this or should I file a new PR?

@sschuberth
Copy link
Member

@sschuberth I have found the issue and a fix for it. Should we reopen this or should I file a new PR?

It depends a bit on how different the solution (commit titles and code) would be, but I'd have a tendency for opening a new PR in this case.

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.

2 participants