Skip to content

Forward underlying system package manager error messages - #19858

Merged
franramirez688 merged 5 commits into
conan-io:develop2from
perseoGI:pgi/package_manager/check_path
Apr 13, 2026
Merged

franramirez688 merged 5 commits into
conan-io:develop2from
perseoGI:pgi/package_manager/check_path

Conversation

@perseoGI

@perseoGI perseoGI commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Changelog: Fix: Forward underlying system package manager error messages
Docs: omit

Mind that Conan behavior changes a little bit with this PR, by throwing an early exception if the system package manager is not detected by default (and not configured by config) and also, if the package manager is not found in path @memsharded

Close #19854

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Comment thread test/functional/tools/system/package_manager_test.py Outdated
Comment thread test/functional/tools/system/package_manager_test.py Outdated
Comment thread conan/tools/system/package_manager.py Outdated
Comment thread conan/tools/system/package_manager.py Outdated

@memsharded memsharded left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good

Comment thread conan/tools/system/package_manager.py Outdated
Comment thread test/integration/tools/system/package_manager_test.py
@memsharded memsharded added this to the 2.28.0 milestone Apr 10, 2026
Comment thread conan/tools/system/package_manager.py Outdated
@perseoGI
perseoGI marked this pull request as ready for review April 10, 2026 10:40
@perseoGI perseoGI changed the title POC: Check package manager in path Forward underlying system package manager error messages Apr 10, 2026
@franramirez688

Copy link
Copy Markdown
Contributor

@perseoGI could you include a real native log showing the new output in the Changelog? It helps a lot to see a real case instead of the mock ones (which are fine for sure)

@perseoGI

Copy link
Copy Markdown
Contributor Author

@perseoGI could you include a real native log showing the new output in the Changelog? It helps a lot to see a real case instead of the mock ones (which are fine for sure)

@franramirez688 here you have a real example:

image

@AbrilRBS AbrilRBS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks way better now!

@franramirez688

Copy link
Copy Markdown
Contributor

Thanks @perseoGI 👏

IMO, it reads a bit weird:

ERROR: xxxxxx
       xxxxxx
sdterr: xxxxxxx

Wdyt? I was thinking something like:

ERROR: xxxxxx
       xxxxxx
       sdterr: xxxxxxx

Or simply removing the stderr: prefix?

@memsharded

Copy link
Copy Markdown
Member

IMO, it reads a bit weird:

It depends, if you tab the stderr message into the rest of the Conan error message (the ConanException printing), my experience is the opposite, the users will read worse the actual underlying cause of the error (like "pacman" not being installed).

In any case, this is quite an unlikely event, so the formatting is not critical, I am fine with whatever format is used.

@franramirez688
franramirez688 merged commit b2d994b into conan-io:develop2 Apr 13, 2026
16 checks passed
memsharded pushed a commit to memsharded/conan that referenced this pull request Apr 22, 2026
)

* Check package manager in path

* Simplification: just raise the shell message error to user

* Single run invokation

* Fix lint warnings

* Improve output
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.

[question] _SystemPackageManagerTool reports misleading error message

4 participants