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

.slimify-excludes break groff functionality #87

Closed
paddy-hack opened this issue Mar 30, 2020 · 3 comments · Fixed by #94
Closed

.slimify-excludes break groff functionality #87

paddy-hack opened this issue Mar 30, 2020 · 3 comments · Fixed by #94

Comments

@paddy-hack
Copy link

The slim variants (at least buster-slim) break groff by excluding all files below /usr/share/groff/ in /etc/dpkg/dpkg.cfg.d/docker. A bit of digging led me to .slimify-excludes as the source for this.

I ran into the breakage when trying to convert manual pages for a project to HTML. All the groff macros are installed below /usr/share/groff/. Not installing them via the path-exclude completely breaks groff functionality. Even something like groff -man < inputfile works 😮

FTR, for a long time I also believed the content of this directory was not needed 🤦‍♂️

@tianon
Copy link
Collaborator

tianon commented Mar 30, 2020

Hah, nice catch! I guess someone should probably update https://wiki.ubuntu.com/ReducingDiskFootprint#Drop_unnecessary_files too (which is where we got it from).

Are there things in /usr/share/groff that we should exclude? Perhaps a more specific subdirectory (or collection of subdirectories)?

@tianon
Copy link
Collaborator

tianon commented Mar 30, 2020

Looking at https://packages.debian.org/buster/amd64/groff-base/filelist and https://packages.debian.org/buster/amd64/groff/filelist, I see a lot of things under font -- there's probably some of that that's related to why yours failed, but possibly some of it that's "extra" ?

We exclude things like locales, so some amount of breakage is somewhat intended with this image, but I guess it probably depends a lot on how common it is to have "groff" installed.

On my desktop system here, I've only got groff-base (accounting for ~1.8MB), and even in buildpack-deps:buster (which is a "batteries included" style of image, so quite large), there's nothing in /usr/share/groff, so perhaps it's safe to just not exclude.

@paddy-hack
Copy link
Author

paddy-hack commented Mar 31, 2020

Eh, that Ubuntu wiki hasn't been modified since 2012-10-11.

The specific error I ran into was

$ cat sample.1 | groff
groff: can't find 'DESC' file
groff: fatal error: invalid device 'ps'

The groff command needs those /usr/share/groff/*/font/dev*/DESC files to be of any use. Depending on the input groff gets, it will need all other font files for a given device and if macros are given on the command line it needs a matching /usr/share/groff/*/tmac/*.tmac as well as any other *.tmac files that are referenced from it.

In short, excluding /usr/share/groff/* breaks the groff-base and groffpackages like completely if these are installed later by an unsuspecting user.

A quick apt-file search /usr/share/groff on my Devuan beowulf (nominally Debian buster) also shows noweb and tix-dev as putting one or two files there. I've just rebuilt my Devuan Docker images with the path-exclude removed. The images do not have a /usr/share/groff directory to begin with so there will not be any bloat of the base packages.

I'd remove the path-exclude as it only serves to knowingly break groff for no benefit to the Debian Docker images.

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.

2 participants