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] EndeavourOS not among list of distros listed for pacman support #11970

Closed
cchulo opened this issue Aug 27, 2022 · 6 comments · Fixed by #11971
Closed

[bug] EndeavourOS not among list of distros listed for pacman support #11970

cchulo opened this issue Aug 27, 2022 · 6 comments · Fixed by #11971
Assignees
Milestone

Comments

@cchulo
Copy link
Contributor

cchulo commented Aug 27, 2022

Environment Details (include every applicable attribute)

  • Operating System+version: EndeavourOS 2022.06.23
  • Compiler+version: Clang 14.0.6
  • Conan version: 1.51.3
  • Python version: 3.10.6

Steps to reproduce (Include if Applicable)

In a python interpreter

>>> from conans import tools
>>> tools.os_info.with_pacman
False
>>>tools.os_info.is_linux
True
>>> tools.os_info.linux_distro
'endeavouros'

We need to add endeavouros to this line

Logs (Executed commands with output) (Include/Attach if Applicable)

As a result of the above, OpenGL recipe doesn't know how to install itself, xorg/system also fails to install some dependencies as well

opengl/system: Package installed 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
opengl/system: Downloaded package revision 0
xorg/system: Retrieving package 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 from remote 'conancenter' 
Downloading conanmanifest.txt completed [0.06k]                                          
Downloading conaninfo.txt completed [0.16k]                                              
Downloading conan_package.tgz completed [0.06k]                                          
Decompressing conan_package.tgz completed [0.00k]                                        
xorg/system: Package installed 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
xorg/system: Downloaded package revision 0
opengl/system: WARN: Don't know how to install OpenGL for your distro.
ERROR: xorg/system: Error in package_info() method, line 79
        pkg_config.fill_cpp_info(
        ConanException: pkg-config command ['pkg-config', '--print-provides', 'xvmc', '--print-errors'] failed with error: Command 'pkg-config --print-provides xvmc --print-errors' returned non-zero exit status 1.
Package xvmc was not found in the pkg-config search path.
Perhaps you should add the directory containing `xvmc.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xvmc', required by 'virtual:world', not found
@cchulo
Copy link
Contributor Author

cchulo commented Aug 27, 2022

imo, it feels a bit cumbersome to have to list out distros, couldn't it use shutil instead?

The check could be something like:

import shutil

# ...

@property
    def with_pacman(self):
        if self.is_linux:
            return shutil.which('pacman') != None
        # ...

This will then take care of any flavor of Arch in the future, only requirement is shutil is only available in python 3.3+, if there is a need for compatibility with all of python3, you could add a custom which command as found here

@memsharded memsharded self-assigned this Aug 27, 2022
@memsharded
Copy link
Member

memsharded commented Aug 27, 2022

Hi @cchulo

There is a difference in a tool being installed in the system, and users really wanting to run that tool. It is not impossible to have a pacman executable in your Linux system that is the pacman videogame (for other distros), for example.

Also Conan will try in general not having to guess. So what it has is defined a common default mapping of OS-system package managers. If you want to add EndeavourOS to that list, pull requests are welcome! Note that we are talking about the new tooling in https://docs.conan.io/en/latest/reference/conanfile/tools/system/package_manager.html, not the legacy ones you are referring above, that will not be changed now that we are already in 2.0-beta.

Also in the meantime, it is simple to define that you want to run pacman, if you check that doc, you can see that the conf tools.system.package_manager:tool allows you to define pacman, and everything should work.

@cchulo
Copy link
Contributor Author

cchulo commented Aug 27, 2022

@memsharded ah that is a good point, I had not considered that

Your proposed solution should work, I will try it. I will create a pull request anyway to include this string addition.

@memsharded
Copy link
Member

@memsharded ah that is a good point, I had not considered that

Yeah, we have learned from experience, some distros containing more than one system package manager, and then everything was a mess, distros with matching applications that were no system package managers... the only way was to allow users to explicitly define the tool they want (besides a hardcoded default for most common distros)

@cchulo
Copy link
Contributor Author

cchulo commented Aug 27, 2022

@memsharded thank you very much for the guidance, running my installation script worked with these additional options:

tools.system.package_manager:tool=pacman
tools.system.package_manager:mode=install
tools.system.package_manager:sudo=True

memsharded pushed a commit that referenced this issue Sep 5, 2022
#11971)

* Added endeavouros to the list of pacman distros

* reverted previous change and instead added 'endeavouros' to package_manager.py
@memsharded memsharded added this to the 1.53 milestone Sep 5, 2022
@memsharded
Copy link
Member

Closed by #11971, will be in 1.53. Thanks very much for the fix!

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

Successfully merging a pull request may close this issue.

2 participants