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

Linux Mint support #3692

Open
emengd opened this issue Dec 10, 2018 · 10 comments
Open

Linux Mint support #3692

emengd opened this issue Dec 10, 2018 · 10 comments

Comments

@emengd
Copy link

emengd commented Dec 10, 2018

I know there is a closed issue (ocaml-opam/opam-depext#26) with the exact same title but I don't think this is solved.

Basically the user in ocaml-opam/opam-depext#26 solved their problem through the fact that their /etc/os-release contains ID=ubuntu. This may end up being the case after upgrades but on a fresh Linux Mint install you have ID=linuxmint. Of course you can change it to ID=ubuntu, which I ended up doing, but since I am not sure if this has any greater consequences I would like to propose either of two cleaner ways to support Mint:

  1. Translate linuxmint to ubuntu (this should be harmless as it's the same repository)

  2. Let the user provide their own (extra?) flags in a config file (I'm willing to implement it if there's interest). Then Linux Mint users can add ubuntu by themselves. Perhaps complement this with a FAQ in the Readme. Edit: actually this is just Can't pass in/override flags ocaml-opam/opam-depext#72. @Leonidas-from-XIV, should I take over ?

(In ocaml-opam/opam-depext#63 it is also proposed to look at ID_LIKE, which would have worked in my case since I had ID_LIKE=ubuntu, but I'm not sure if this is correct in general since I think Ubuntu has ID_LIKE=debian and they don't always have the same package names.)

[rjbou] edit links

@AltGr AltGr transferred this issue from ocaml-opam/opam-depext Dec 10, 2018
@AltGr
Copy link
Member

AltGr commented Dec 10, 2018

Transferred issue, since all the OS detection is now done directly in opam (opam-depext only handles the dialog with the appropriate package managers now).

Could you give the output of opam config report on your system, so that we can check what exactly is inferred ? Thanks.

@emengd
Copy link
Author

emengd commented Dec 10, 2018

Oh, sorry, I'm using opam 1.2.2 so my problem may no longer be one. Since I read the source code on master over at opam-depext and it appeared to correspond to what my system was doing, and also because the online doc for opam 2 doesn't mention the depext command, I thought nothing had changed.

Anyway, in case it's still relevant:

# OPAM config report
# opam-version    1.2.2 
# self-upgrade    no
# os              linux
# external-solver aspcud $in $out $criteria
# criteria        -count(removed),-notuptodate(request),-sum(request,version-lag),-count(down),-notuptodate(changed),-count(changed),-notuptodate(solution),-sum(solution,version-lag)
# jobs            8
# repositories    1 (http)
# pinned          5 (path)
# current-switch  4.07.0
# last-update     2018-12-10 10:11

@emengd
Copy link
Author

emengd commented Dec 13, 2018

I switched to opam 2 from the PPA and the lack of support persists. With the basic os-release file:

$ opam depext -l owl
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=linuxmint, os-family=ubuntu
# No required system packages found

Changing ID=LinuxMint to ID=ubuntu:

$ opam depext -l owl
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=ubuntu, os-family=ubuntu
# The following system packages are needed:
liblapacke-dev
libopenblas-dev
libplplot-dev
libshp-dev
m4
pkg-config

Here is the output of opam config report:

# opam config report
# opam-version      2.0.2 
# self-upgrade      no
# system            arch=x86_64 os=linux os-distribution=linuxmint os-version=19
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              7
# repositories      1 (http) (default repo at 4c4ab28a)
# pinned            5 (git)
# current-switch    default

@avsm
Copy link
Member

avsm commented Dec 14, 2018

Does Linux Mint provide container images on the Docker Hub? If so, I'd be happy to add it into the supported distribution list in the ocaml containers.

@emengd
Copy link
Author

emengd commented Dec 14, 2018

As far as I can tell they do not advertise or document it but they do have them, is that what you're looking for?

@avsm
Copy link
Member

avsm commented Dec 14, 2018

Thanks, it looks like its very similar to Ubuntu so we probably dont need it in CI.

From looking at

$ docker run -it linuxmintd/mint19.1-amd64 cat /etc/os-release
NAME="Linux Mint"
VERSION="19.1 (Tessa)"
ID=linuxmint
ID_LIKE=ubuntu
PRETTY_NAME="Linux Mint 19.1"
VERSION_ID="19.1"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.ubuntu.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=tessa
UBUNTU_CODENAME=bionic

I think the right answer here is to build on ocaml-opam/opam-depext#63 and parse ID and ID_LIKE. We need depext to fold over both values, stopping at the first one it recognises. Thus it would recognise ubuntu via ID, and Mint via ID_LIKE (that is set to ubuntu).

@emengd
Copy link
Author

emengd commented Dec 15, 2018

Thanks, it looks like its very similar to Ubuntu so we probably dont need it in CI.

Yes, it uses the same package repository, up to a few packages mostly relating to the interface and to core system functionality, so nothing that should interact with builds.

@rjbou
Copy link
Collaborator

rjbou commented Dec 20, 2019

ID and ID_LIKE are already parsed, respectively for os-distrbution and os-family (cf. variables doc).
The thing here is that linuxmint has an ID_LIKE=ubuntu and ubuntu an ID_LIKE=debian, and as e.g. for owl, depexts are only checked for os-family=debian.
If you want to take a look, it's here.

We could add an special case for LinuxMint, but it would only be an hardcoded workaround...
Do other distros rely on an ID_LIKE=ubuntu? If so, maybe we should update conf files to handle this os-family.

@GreenBeard
Copy link

I use Linux Mint myself and believe a hardcoded workaround would be best until Linux Mint finally updates their /etc/releases to have ID_LIKE="ubuntu debian". I haven't checked, but I assume that opam already supports multiple IDs in this field. Source for multiple IDs: https://www.freedesktop.org/software/systemd/man/os-release.html Relevant bug report that probably needs nudging in Linux Mint (I may do this myself) https://bugs.launchpad.net/linuxmint/+bug/1641491

@rjbou
Copy link
Collaborator

rjbou commented Aug 28, 2020

Same problem for opensuse, based on this ocaml/opam-repository#16864 (comment), ocaml/opam-repository#17004 related also.
ping @anuragsoni to know about this issue

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

No branches or pull requests

5 participants