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

[feature] Conan should recognize elementaryOS as a distro that uses apt #7307

Closed
1 task done
seanballais opened this issue Jul 3, 2020 · 7 comments · Fixed by #7309
Closed
1 task done

[feature] Conan should recognize elementaryOS as a distro that uses apt #7307

seanballais opened this issue Jul 3, 2020 · 7 comments · Fixed by #7309
Milestone

Comments

@seanballais
Copy link
Contributor

elementaryOS is a Linux distro based on Ubuntu. So, it uses apt. However, Conan, via the conans module, disagrees and says that it does not use apt when calling tools.os_info.with_apt.

Python 3.7.4 (default, Oct  9 2019, 00:16:19) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from conans import tools
>>> tools.os_info.with_apt
False

Letting Conan know that elementaryOS uses apt is important since recipes that have to know whether or not the distro they are running in uses apt may have to resort to doing something less than ideal when ran under elementaryOS. For example, using opengl/system in a project under elementaryOS will fail (just like this in bincrafters/community#1216) because the recipe, as it is currently is (and supported by conan-io/conan-center-index#2114), fails hard when being used in an unrecognized distro.

As such, Conan should be updated to recognize elementaryOS as a distro that uses apt. Based on my quick skim of the conans module code, it seems that a change in client/tools/oss.py:181 to:

# ...
        apt_distros = ("debian", "ubuntu", "knoppix", "linuxmint", "raspbian", "neon", "pop", "elementary")
# ...

should do the trick.

Note: import distro; distro.id() returns 'elementary'.

@memsharded
Copy link
Member

Hi @seanballais

Thanks for submitting this issue. Yes, we recently added pop there, so I see no problem to add there elementary too. Would you like to send a PR yourself, as you have already investigated where to add it?

@seanballais
Copy link
Contributor Author

Hey, @memsharded. Sure! I'll send a PR as soon as I can.

@memsharded memsharded added this to the 1.28 milestone Jul 3, 2020
@SSE4
Copy link
Contributor

SSE4 commented Jul 3, 2020

@SSE4
Copy link
Contributor

SSE4 commented Jul 3, 2020

also, as new distros appear almost every month (it's actually very simple to create your own distro like BolgenOS), maybe we can go away from maintaining a hard-coded distro list, and just verify if apt exists and it's really apt package manager (not just a random executable named apt).

@seanballais
Copy link
Contributor Author

Checking if apt itself exists should be a better option. Alright. I'm working on it.

@seanballais
Copy link
Contributor Author

seanballais commented Jul 3, 2020

I've just submitted a PR!

@seanballais
Copy link
Contributor Author

@SSE4, perhaps later on, we can stop depending on a hard-coded distro list and have the package manager properties (e.g. with_apt) check for the existence of the appropriate package manager executable.

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.

3 participants