openbmc / openbmc-build-scripts

Apache License 2.0
19 stars 50 forks source link

Missing libsystmed0 (= 245.4-4ubuntu3.1) dependency causes run unit test docker script to failed #26

Closed lxwinspur closed 4 years ago

lxwinspur commented 4 years ago

Recently, I pulled openbmc-build-scripts (commit: 80d0728e6d5d3d623cda26a1bfe93d2eac4a8d3e) and ran the run-unit-test-docker.sh script, and prompted me that the missing libsystmed0 (= 245.4-4ubuntu3.1) dependency would cause the unit test to run docker The script failed. I did the following and still failed: ran the command on my system(ubuntu18.04):

  1. sudo docker pull ubuntu:focal
  2. sudo docker image prune -a

Error message:

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Ign:3 http://ddebs.ubuntu.com focal InRelease
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB]
Ign:5 http://ddebs.ubuntu.com focal-updates InRelease
Get:6 http://ddebs.ubuntu.com focal Release [40.4 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [36.5 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:9 http://ddebs.ubuntu.com focal-updates Release [40.5 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [108 kB]
Get:11 http://ddebs.ubuntu.com focal Release.gpg [819 B]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [180 kB]
Get:13 http://ddebs.ubuntu.com focal-updates Release.gpg [819 B]
Get:14 http://ddebs.ubuntu.com focal/multiverse amd64 Packages [78.2 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [89.8 kB]
Get:16 http://ddebs.ubuntu.com focal/universe amd64 Packages [5311 kB]
Get:17 http://ddebs.ubuntu.com focal/main amd64 Packages [611 kB]
Get:18 http://ddebs.ubuntu.com focal-updates/universe amd64 Packages [53.1 kB]
Get:19 http://ddebs.ubuntu.com focal-updates/main amd64 Packages [73.1 kB]
Fetched 6935 kB in 1min 16s (91.4 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsystemd-dev : Depends: libsystemd0 (= 245.4-4ubuntu3.1) but 245.4-4ubuntu3 is to be installed
 systemd : Depends: libsystemd0 (= 245.4-4ubuntu3.1) but 245.4-4ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get update && apt-get install -yy     gcc-10     g++-10     libc6-dbg     libc6-dev     libtool     bison     flex     cmake     python3     python3-dev    python3-yaml     python3-mako     python3-pip     python3-setuptools     python3-git     python3-socks     pkg-config     autoconf     autoconf-archive     libsystemd-dev     systemd     libsystemd0-dbgsym     libssl-dev     libevdev-dev     libevdev2-dbgsym     libjpeg-dev     libpng-dev     ninja-build     sudo     curl     git     dbus     iputils-ping     clang-10     clang-format-10     clang-tidy-10     clang-tools-10     npm     iproute2     libnl-3-dev     libnl-genl-3-dev     libconfig++-dev     libsnmp-dev     valgrind     valgrind-dbg     libpam0g-dev     xxd     libi2c-dev     wget     libldap2-dev     libprotobuf-dev     libperlio-gzip-perl     libjson-perl     protobuf-compiler     libgpiod-dev     device-tree-compiler     cppcheck' returned a non-zero code: 100
++ cleanup
++ local status=100
++ [[ -n /tmp/tmp.TSQHAz25st ]]
++ rm -f /tmp/tmp.TSQHAz25st
++ trap - EXIT ERR
++ exit 100

Looking forward to your reply. thanks.

williamspatrick commented 4 years ago

I get the same failure. Something must have changed in the latest pull.

Cloned sdbusplus and openbmc-build-scripts into /tmp/foo:

$ WORKSPACE=/tmp/foo UNIT_TEST_PKG=sdbusplus ./run-unit-test-docker.sh

Results in:

The following packages have unmet dependencies:
 libsystemd-dev : Depends: libsystemd0 (= 245.4-4ubuntu3.1) but 245.4-4ubuntu3 is to be installed
 systemd : Depends: libsystemd0 (= 245.4-4ubuntu3.1) but 245.4-4ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.

docker image ls shows:

ubuntu              focal               1d622ef86b13        4 weeks ago 
williamspatrick commented 4 years ago

If I run:

docker run --rm -it ubuntu:focal
apt-get update && apt-get install systemd libsystemd-dev

This would run successfully and indicates it is updating libsystemd0. I suspect something in the larger package list is pinning libsystemd0 back at an older version.

williamspatrick commented 4 years ago

libsystemd-dbgsym only exists after some modification of the sources.list.d to add the debug-debs repo.

RUN apt-get update && ( apt-get install ubuntu-dbgsym-keyring || ( apt-get install -yy dirmngr && \
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F2EDC64DC5AEE1F6B9C621F0C8CAB6595FDFF622 ) )

# Parse the current repo list into a debug repo list
RUN sed -n '/^deb /s,^deb [^ ]* ,deb http://ddebs.ubuntu.com ,p' /etc/apt/sources.list >/etc/apt/sources.list.d/debug.list

# Remove non-existent debug repos
RUN sed -i '/-\(backports\|security\) /d' /etc/apt/sources.list.d/debug.list

RUN cat /etc/apt/sources.list.d/debug.list

Once these are done, libsystemd-dbgsym is available but it is pointing to an older version:

root@30d11595f1e7:/# apt policy libsystemd0
libsystemd0:
  Installed: 245.4-4ubuntu3
  Candidate: 245.4-4ubuntu3.1
  Version table:
     245.4-4ubuntu3.1 500
        500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
 *** 245.4-4ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
root@30d11595f1e7:/# apt policy libsystemd0-dbgsym
libsystemd0-dbgsym:
  Installed: (none)
  Candidate: 245.4-4ubuntu3
  Version table:
     245.4-4ubuntu3 500
        500 http://ddebs.ubuntu.com focal/main amd64 Packages

It seems like upstream missed updating the dbgsym package?

msbarth commented 4 years ago

I hit this as well, where it does look like there's some version discrepancies upstream on the systemd packages. It seems to be between what's in focal LTS and focal-updates? https://packages.ubuntu.com/search?keywords=libsystemd-dev

FWIW, I was able to workaround this by setting explicit versions on the following packages in build-unit-test-docker.sh

libsystemd0=245.4-4ubuntu3 \
libsystemd-dev=245.4-4ubuntu3 \
systemd=245.4-4ubuntu3 \
msbarth commented 4 years ago

@williamspatrick Would we want to push this workaround fix up until the dependencies upstream get fixed?

williamspatrick commented 4 years ago

We could also remove libsystemd0-dbgsym for the time being.

I don't have a preference.

msbarth commented 4 years ago

Resolved by https://gerrit.openbmc-project.xyz/32841