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] tools.os_info.with_yum does not detect AlmaLinux (CentOS replacement) #9460

Closed
daravi opened this issue Aug 21, 2021 · 3 comments · Fixed by #9463
Closed

[bug] tools.os_info.with_yum does not detect AlmaLinux (CentOS replacement) #9460

daravi opened this issue Aug 21, 2021 · 3 comments · Fixed by #9463
Assignees
Milestone

Comments

@daravi
Copy link
Contributor

daravi commented Aug 21, 2021

AlmaLinux is the CentOS successor. Similar to CentOS it uses yum or dnf. However, with_yum in system_requirement fails:

e.g.

opengl/system: WARN: Don't know how to install OpenGL for your distro.
opengl/system: ERROR: while executing system_requirements(): local variable 'packages' referenced before assignment
ERROR: Error in system requirements

I am not sure if this is a bug in Conan or AlmaLinux. I can do further debugging as requested.

Environment Details (include every applicable attribute)

  • Operating System+version: AlmaLinux 8.4 (Electric Cheetah)
  • Compiler+version: LLVM 10.0.1
  • Conan version: 1.38.0
  • Python version: 3.9.6
@memsharded
Copy link
Member

Hi @daravi

yes, please, can you verify you have the latest revision of opengl/system installed? I see:

def system_requirements(self):
        packages = []
        if tools.os_info.is_linux and self.settings.os == "Linux":
            if tools.os_info.with_yum:
                if tools.os_info.linux_distro == "fedora" and tools.os_info.os_version >= "32":
                    packages = ["libglvnd-devel"]
                else:
                    packages = ["mesa-libGL-devel"]
            elif tools.os_info.with_apt:
                ubuntu_20_or_later = tools.os_info.linux_distro == "ubuntu" and tools.os_info.os_version >= "20"
                debian_11_or_later = tools.os_info.linux_distro == "debian" and tools.os_info.os_version >= "11"
                pop_os_20_or_later = tools.os_info.linux_distro == "pop" and tools.os_info.os_version >= "20"
                if ubuntu_20_or_later or debian_11_or_later or pop_os_20_or_later:
                    packages = ["libgl-dev"]
                else:
                    packages = ["libgl1-mesa-dev"]
            elif tools.os_info.with_pacman:
                packages = ["libglvnd"]
            elif tools.os_info.with_zypper:
                packages = ["Mesa-libGL-devel"]
            else:
                self.output.warn("Don't know how to install OpenGL for your distro.")
        elif tools.os_info.is_freebsd and self.settings.os == "FreeBSD":
            packages = ["libglvnd"]
        if packages:
            package_tool = tools.SystemPackageTool(conanfile=self, default_mode='verify')
            for p in packages:
                package_tool.install(update=True, packages=p)

So it shouldn't fail with the above message (it could fail not installing anything, of course).

Then, it could be failing because:

    @property
    def with_yum(self):
        return self.is_linux and self.linux_distro in ("pidora", "fedora", "scientific", "centos",
                                                       "redhat", "rhel", "xenserver", "amazon",
                                                       "oracle", "amzn")

It should be great to see what distro.id() is returning for your distro, and also if an update (like suggested in #9452) could help.

@daravi
Copy link
Contributor Author

daravi commented Aug 23, 2021

@memsharded Thanks! My distro.id() returns "almalinux". Should I make a PR for adding that?

@memsharded
Copy link
Member

@memsharded Thanks! My distro.id() returns "almalinux". Should I make a PR for adding that?

Yes, please, that would be great.

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