CircleCI-Public / cimg-base

The CircleCI Base (Ubuntu) Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/base
MIT License
76 stars 42 forks source link

Missing file package #225

Closed MattFenelon closed 1 year ago

MattFenelon commented 1 year ago

We use the file package as part of our ruby build and the file package has disappeared between the 3.1.2 and 3.1.3 release of cimg-ruby.

I'm raising the bug here because I believe changes in this image were the root cause for the package disappearing.

It looks like the file package was included because it's a suggested package for libmagic1. I believe the file package has disappeared because it's a suggested package and suggested packages aren't installed when no-install-recommends flag is used.

Would it make sense to include the file package in this image?

On cimg/ruby:3.1.2

$ apt rdepends file
file
Reverse Depends:
  Suggests: libmagic1
  Recommends: mime-support
$ apt depends libmagic1
libmagic1
  Depends: libbz2-1.0
  Depends: libc6 (>= 2.15)
  Depends: liblzma5 (>= 5.1.1alpha+20120614)
  Depends: zlib1g (>= 1:1.1.4)
  Depends: libmagic-mgc (= 1:5.38-4)
  Suggests: file
$ apt show libmagic1
Package: libmagic1
Version: 1:5.38-4
Status: install ok installed
Priority: optional
Section: libs
Source: file
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Installed-Size: 225 kB
Depends: libbz2-1.0, libc6 (>= 2.15), liblzma5 (>= 5.1.1alpha+20120614), zlib1g (>= 1:1.1.4), libmagic-mgc (= 1:5.38-4)
Suggests: file
Homepage: https://www.darwinsys.com/file/
Download-Size: unknown
APT-Manual-Installed: no
APT-Sources: /var/lib/dpkg/status
Description: Recognize the type of data in a file using "magic" numbers - library
 This library can be used to classify files according to magic number
 tests. It implements the core functionality of the file command. 

On cimg/ruby:3.1.3

$ apt rdepends file
<file>
$ apt depends libmagic1
libmagic1
  Depends: libbz2-1.0
  Depends: libc6 (>= 2.33)
  Depends: liblzma5 (>= 5.1.1alpha+20120614)
  Depends: zlib1g (>= 1:1.1.4)
  Depends: libmagic-mgc (= 1:5.41-3)
  Suggests: <file>
$ apt show libmagic1
Package: libmagic1
Version: 1:5.41-3
Status: install ok installed
Priority: optional
Section: libs
Source: file
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
Installed-Size: 233 kB
Depends: libbz2-1.0, libc6 (>= 2.33), liblzma5 (>= 5.1.1alpha+20120614), zlib1g (>= 1:1.1.4), libmagic-mgc (= 1:5.41-3)
Suggests: file
Homepage: https://www.darwinsys.com/file/
Download-Size: unknown
APT-Manual-Installed: no
APT-Sources: /var/lib/dpkg/status
Description: Recognize the type of data in a file using "magic" numbers - library
 This library can be used to classify files according to magic number
 tests. It implements the core functionality of the file command.

file seems to come from libmagic1. On 3.1.2, libmagic1 depends on file whereas on 3.1.3 libmagic1 depends on <file>. I'm not sure of the significance of the greater/less than symbols. Seems like something changed between libmagic1 1:5.38-4 on 3.1.2 and 1:5.41-3 on 3.1.3.

Running file on 3.1.3:

$ file
bash: file: command not found

Fix: https://github.com/CircleCI-Public/cimg-ruby/issues/103 See: https://github.com/CircleCI-Public/cimg-base/issues/86

MattFenelon commented 1 year ago

I raised a PR: https://github.com/CircleCI-Public/cimg-base/pull/224