openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

Debian package build process fails #216

Closed bitsgalore closed 7 months ago

bitsgalore commented 7 months ago

Running:

./docker-package.sh debian:stretch

First results in following warning:

DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Then further on:

W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.194.132 80]
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

Appears to be related to this:

https://serverfault.com/a/1130167

This mentions that Debian 9 (Stretch) is out of LTS, which is confirmed by:

https://www.debian.org/releases/stretch/

It is superseded by Debian 10 (Buster):

https://www.debian.org/releases/buster/

LTS will stop in 2024, so its successor Debian 11 (bullseye) looks like a better option:

https://www.debian.org/releases/bullseye/

In turn this is succeeded by Debian 12 (bookworm).

Tried this:

./docker-package.sh debian:bullseye

After this the stretch-related errors disappear, but the following error occurs:

E: Unable to locate package libparse-debianchangelog-perl
The command '/bin/sh -c env LANG=C apt-get update -qq -o Acquire::Languages=none     && env LANG=C DEBIAN_FRONTEND=noninteractive apt-get install         -yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io                 apt-transport-https         apt-utils         build-essential         debhelper         devscripts         equivs         gnupg2         gzip         libparse-debianchangelog-perl         lintian         lsb-release         python3-all         python3-dev         python3-pip         python3-pkg-resources         python3-setuptools         tar         libxml2-dev' returned a non-zero code: 100

Also the deprecation warning at the start still appears.

After reading this checked for the buildx component:

sudo apt list --installed | grep buildx

This turned up nothing (so it's not installed). Installed using:

apt install docker-buildx-plugin

Result:

Package docker-buildx-plugin is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  moby-buildx:armhf moby-buildx:arm64 moby-buildx

E: Package 'docker-buildx-plugin' has no installation candidate

So tried:

sudo apt install moby-buildx

But now Docker doesn't work anymore!

This askubuntu thread suggests the following command:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

Result:

Note, selecting 'moby-containerd' instead of 'containerd.io'
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  moby-cli:armhf moby-engine:armhf moby-cli:arm64 moby-engine:arm64
  moby-engine moby-cli

Package docker-ce-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  moby-cli:armhf moby-cli:arm64 moby-cli

E: Package 'docker-ce' has no installation candidate
E: Package 'docker-ce-cli' has no installation candidate
E: Unable to locate package docker-compose-plugin

So tried:

sudo apt-get install moby-cli moby-containerd moby-buildx

Still no luck.

bitsgalore commented 7 months ago

More suggestions here:

https://stackoverflow.com/questions/44678725/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker

Or perhaps a complete reinstall of Docker following:

https://docs.docker.com/engine/install/ubuntu/

bitsgalore commented 7 months ago

Tried again on laptop with fresh Docker install (Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1j). Command:

./docker-package.sh debian:bullseye

Result:

1
2
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  216.2MB
Step 1/13 : ARG DIST_ID="debian"
Step 2/13 : ARG CODENAME="bullseye"
Step 3/13 : ARG PKGNAME
Step 4/13 : FROM ${DIST_ID}:${CODENAME} AS dpkg-build
bullseye: Pulling from library/debian
2f088d622efd: Pull complete 
Digest: sha256:a4aa0519fbd45786048bbc4daa7092fec803d22463f1cb6c4e7762dcb6a10cf0
Status: Downloaded newer image for debian:bullseye
 ---> 7dc90053c747
Step 5/13 : ARG CODENAME
 ---> Running in d991344c3a81
Removing intermediate container d991344c3a81
 ---> f757ba818f0f
Step 6/13 : ARG PKGNAME
 ---> Running in 72c95191017b
Removing intermediate container 72c95191017b
 ---> f4679876e9f3
Step 7/13 : ARG VERSION
 ---> Running in 47d4bf9725e7
Removing intermediate container 47d4bf9725e7
 ---> befafe5739da
Step 8/13 : RUN env LANG=C apt-get update -qq -o Acquire::Languages=none     && env LANG=C DEBIAN_FRONTEND=noninteractive apt-get install         -yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io                 apt-transport-https         apt-utils         build-essential         debhelper         devscripts         equivs         gnupg2         gzip         libparse-debianchangelog-perl         lintian         lsb-release         python3-all         python3-dev         python3-pip         python3-pkg-resources         python3-setuptools         tar         libxml2-dev
 ---> Running in 5a324364b02f
E: Unable to locate package libparse-debianchangelog-perl
The command '/bin/sh -c env LANG=C apt-get update -qq -o Acquire::Languages=none     && env LANG=C DEBIAN_FRONTEND=noninteractive apt-get install         -yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io                 apt-transport-https         apt-utils         build-essential         debhelper         devscripts         equivs         gnupg2         gzip         libparse-debianchangelog-perl         lintian         lsb-release         python3-all         python3-dev         python3-pip         python3-pkg-resources         python3-setuptools         tar         libxml2-dev' returned a non-zero code: 100

Same result for re-running the script for debian:bookworm.

bitsgalore commented 7 months ago

Additional test: removed line that refers to "libparse-debianchangelog-perl" from Dockerfile.build. This does get rid of the error, but ultimately the build fails with:

Step 13/13 : RUN dpkg-buildpackage -tc
 ---> Running in 5b5f2c615b62
dpkg-buildpackage: info: source package jpylyzer
dpkg-buildpackage: info: source version 2.2.0~rc1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Johan van der Knijff <johan.vanderknijff@kb.nl>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
dpkg-checkbuilddeps: error: Unmet build dependencies: dh-python
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
bitsgalore commented 7 months ago

Added missing dh-python dependency to Dockerfile.build.

After this the build is successful!

Changes:

https://github.com/openpreserve/jpylyzer/commit/a60ee0e753f970a8660a2bb09aa21de7b86cd0f2