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

os-family changed for opensuse-tumbleweed? #5565

Open
novemberkilo opened this issue Jun 1, 2023 · 3 comments · Fixed by ocaml/opam-repository#24225
Open

os-family changed for opensuse-tumbleweed? #5565

novemberkilo opened this issue Jun 1, 2023 · 3 comments · Fixed by ocaml/opam-repository#24225

Comments

@novemberkilo
Copy link

It appears that for opensuse-tumbleweed, os-family = opensuse while for opensuse-15.4 os-family = suse -- is this what is expected?

For opensuse-tumbleweed

> opam depext --flags
# Depexts vars detected on this system: arch=x86_64, os=linux, os-distribution=opensuse-tumbleweed, os-family=opensuse

For opensuse-15.4

> opam depext --flags
# Depexts vars detected on this system: arch=x86_64, os=linux, os-distribution=opensuse-leap, os-family=suse

Related to ocaml/opam-repository#23851

@Niols
Copy link

Niols commented Jun 3, 2023

Dayum, you beat me at reporting! To reproduce:

Leap 15.4

$ docker run -it ocaml/opam:opensuse-15.4 bash -i
Unable to find image 'ocaml/opam:opensuse-15.4' locally
opensuse-15.4: Pulling from ocaml/opam
c4f95e685b8e: Pull complete 
Digest: sha256:d57dc78825d379c57759bb5db47b539e8a796c4758e0dec81e1ce410cc938371
Status: Downloaded newer image for ocaml/opam:opensuse-15.4

opam@f552dee3bb10:~> opam depext conf-jq
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=opensuse-leap, os-family=suse
# The following system packages are needed:
jq
The following command needs to be run through "sudo":
    zypper --non-interactive install jq
Retrieving repository 'Update repository of openSUSE Backports' metadata ...........................[done]
Building repository 'Update repository of openSUSE Backports' cache ................................[done]
Retrieving repository 'Update repository with updates from SUSE Linux Enterprise 15' metadata ......[done]
Building repository 'Update repository with updates from SUSE Linux Enterprise 15' cache ...........[done]
Retrieving repository 'Main Update Repository' metadata ............................................[done]
Building repository 'Main Update Repository' cache .................................................[done]
Retrieving repository 'Update Repository (Non-Oss)' metadata .......................................[done]
Building repository 'Update Repository (Non-Oss)' cache ............................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 3 NEW packages are going to be installed:
  jq libjq1 libonig4

3 new packages to install.
Overall download size: 312.4 KiB. Already cached: 0 B. After the operation, additional 900.2 KiB will be
used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving: libonig4-6.7.0-150000.3.3.1.x86_64 (Update repository with updates from SUSE Linux Enterprise
15)
                                                                                      (1/3), 128.3 KiB    
Retrieving: libonig4-6.7.0-150000.3.3.1.x86_64.rpm .................................................[done]
Retrieving: libjq1-1.6-3.3.1.x86_64 (Main Repository)                                 (2/3), 118.4 KiB    
Retrieving: libjq1-1.6-3.3.1.x86_64.rpm ............................................................[done]
Retrieving: jq-1.6-3.3.1.x86_64 (Main Repository)                                     (3/3),  65.7 KiB    
Retrieving: jq-1.6-3.3.1.x86_64.rpm ................................................................[done]

Checking for file conflicts: .......................................................................[done]
(1/3) Installing: libonig4-6.7.0-150000.3.3.1.x86_64 ...............................................[done]
(2/3) Installing: libjq1-1.6-3.3.1.x86_64 ..........................................................[done]
(3/3) Installing: jq-1.6-3.3.1.x86_64 ..............................................................[done]
# OS packages installation successful

Tumbleweed

$ docker run -it ocaml/opam:opensuse-tumbleweed bash -i
Unable to find image 'ocaml/opam:opensuse-tumbleweed' locally
opensuse-tumbleweed: Pulling from ocaml/opam
c3f4b192af8c: Pull complete 
Digest: sha256:f73c66f03da17803780b04640010b563e10e5174857e89e4c6ac139b43430323
Status: Downloaded newer image for ocaml/opam:opensuse-tumbleweed

opam@0fb8cf5be281:~> opam depext conf-jq
# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=opensuse-tumbleweed, os-family=opensuse
# No extra OS packages requirements found.

opam@0fb8cf5be281:~> sudo zypper --non-interactive install jq
Retrieving repository 'openSUSE-Tumbleweed-Non-Oss' metadata .......................................[done]
Building repository 'openSUSE-Tumbleweed-Non-Oss' cache ............................................[done]
Retrieving repository 'openSUSE-Tumbleweed-Oss' metadata ...........................................[done]
Building repository 'openSUSE-Tumbleweed-Oss' cache ................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 3 NEW packages are going to be installed:
  jq libjq1 libonig5

3 new packages to install.
Overall download size: 375.2 KiB. Already cached: 0 B. After the operation, additional 1011.3 KiB will be
used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving: libonig5-6.9.8-1.5.x86_64 (openSUSE-Tumbleweed-Oss)                       (1/3), 178.6 KiB    
Retrieving: libonig5-6.9.8-1.5.x86_64.rpm ..........................................................[done]
Retrieving: libjq1-1.6-3.2.x86_64 (openSUSE-Tumbleweed-Oss)                           (2/3), 130.1 KiB    
Retrieving: libjq1-1.6-3.2.x86_64.rpm ..................................................[done (4.9 MiB/s)]
Retrieving: jq-1.6-3.2.x86_64 (openSUSE-Tumbleweed-Oss)                               (3/3),  66.4 KiB    
Retrieving: jq-1.6-3.2.x86_64.rpm ..................................................................[done]

Checking for file conflicts: .......................................................................[done]
(1/3) Installing: libonig5-6.9.8-1.5.x86_64 ........................................................[done]
(2/3) Installing: libjq1-1.6-3.2.x86_64 ............................................................[done]
(3/3) Installing: jq-1.6-3.2.x86_64 ................................................................[done]

@rjbou
Copy link
Collaborator

rjbou commented Jun 6, 2023

The origin is that os-family is retrieved from /etc/os-release, first element of field ID_LIKE:

  • for opensuse-tumbleweed it is ID_LIKE="opensuse suse"
  • for opensuse-15.4, it is ID_LIKE="suse opensuse"

related to #4440 #3692 (especially #3692 (comment)).

Note: opam depext is no more needed (nor maintained) as depext mechanism is integrated in opam since opam 2.1. To show configuration, you can use opam config report or opam var os-family for a specific variable.

@tmcgilchrist
Copy link

@rjbou Does the integrated depext in opam 2.1 not suffer from this same issue?
If I run this in a docker container with both opam 2.0 and 2.1 it still reports the different values.
Is the fix to add an extra os-family line into opam packages or to change the behaviour of opam to report both as suse?

$ docker run -it --entrypoint /bin/bash ocaml/opam:opensuse-tumbleweed-ocaml-4.14
opam@fe8872fd7ead:~> opam-2.1 --version
2.1.5
opam@fe8872fd7ead:~> opam-2.1 var os-family
opensuse
opam@fe8872fd7ead:~> opam --version
2.0.10
opam@fe8872fd7ead:~> opam var os-family
opensuse
$ docker run -it --entrypoint /bin/bash ocaml/opam:opensuse-15.4-ocaml-4.14
opam@a393ced0bb8e:~> opam-2.1 --version
2.1.5
opam@a393ced0bb8e:~> opam-2.1 var os-family
suse
opam@a393ced0bb8e:~> opam --version
2.0.10
opam@a393ced0bb8e:~> opam var os-family
suse

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 a pull request may close this issue.

4 participants