The plymouth label plugin pulls in too many dependencies

Bug #1976352 reported by Alfonso Sanchez-Beato
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
plymouth (Ubuntu)
Fix Released
Wishlist
Alfonso Sanchez-Beato

Bug Description

The plymouth label plugin pulls in too many dependencies (libpango, libcairo, X libs, etc.). This is an issue for integration in the initramfs.

There is an alternative plugin (label-ft) that has been proposed upstream:
https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/91
As it is a separate plugin, core parts of plymouth are only slightly changed.

The package built for kinetic can be found here: https://launchpad.net/~alfonsosanchezbeato/+archive/ubuntu/plymouth

SRU bug for jammy is LP: #1981432

Tags: patch kinetic
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "label-ft.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
summary: - The plymouth label pulls in too many dependencies
+ The plymouth label plugin pulls in too many dependencies
description: updated
Changed in plymouth (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
assignee: nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato)
status: Triaged → In Progress
description: updated
Changed in plymouth (Ubuntu):
status: In Progress → Fix Committed
tags: added: kinetic
Revision history for this message
Steve Langasek (vorlon) wrote :

Just a note, pango is indispensable for any dynamic strings in languages such as Thai or Lao that require character composition; or for languages that mix RTL and LTR text (such as Arabic or Hebrew with embedded Latin filenames). This may save us some space now in Ubuntu Core, but are we going to find ourselves right back where we started in 2 years when we need support for such languages?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Font rendering should, in theory, have zero dependencies on graphics libraries. If you disable GPU-accelerated paths, which are probably rare, then you're only left with the need to write bytes into a simple pixel buffer.

No well-designed font rendering library should have any dependencies on graphics libraries to achieve that. If they do then I would hope it's just a matter of changing build flags.

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :
Download full text (3.6 KiB)

libharzbuff would allow drawing glyphs for most languages with much less requirements than libpango. But that requires some work. So it is an alternative if in the future we need something more powerful but want to avoid pango. The change itself is easy to revert thanks to plymouth plugin base architecture - label-ft and label have the same ABI, it is just that label-ft has a subset of label's capabilities.

Regarding dependencies, this is what pangocairo pulls:

$ ldd /lib/x86_64-linux-gnu/libpangocairo-1.0.so.0
 linux-vdso.so.1 (0x00007fff72bfa000)
 libpango-1.0.so.0 => /lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f3840a6d000)
 libpangoft2-1.0.so.0 => /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f3840a52000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f384096b000)
 libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f3840831000)
 libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f38407d1000)
 libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f3840700000)
 libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f38406b6000)
 libcairo.so.2 => /lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f384058e000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3840366000)
 libgio-2.0.so.0 => /lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f384018e000)
 libfribidi.so.0 => /lib/x86_64-linux-gnu/libfribidi.so.0 (0x00007f3840172000)
 libthai.so.0 => /lib/x86_64-linux-gnu/libthai.so.0 (0x00007f3840167000)
 libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f384009d000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f3840b02000)
 libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f3840027000)
 libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007f384001a000)
 libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f383fff3000)
 libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f383ffc2000)
 libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f383ffb7000)
 libpixman-1.so.0 => /lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f383ff0c000)
 libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f383fed1000)
 libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f383fecc000)
 libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f383fea2000)
 libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f383fe93000)
 libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f383fe84000)
 libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f383fd44000)
 libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007f383fd2f000)
 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f383fd13000)
 libgmodule-2.0.so.0 => /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f383fd0c000)
 libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f383fcc8000)
 libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f383fc9a000)
 libdatrie.so.1 => /lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f383fc91000)
 libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f383fc83000)
 libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f383fc7d000)
 libXdmcp.so.6 => /lib/x86_64-linux-...

Read more...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed libpangocairo (or cairo itself) is the problem here. Plain libpango has much more sane dependencies. Can we just use libpango?

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

cairo is used to provide the drawing surface [1]. Not sure what would be the best replacement.

[1] https://gitlab.freedesktop.org/plymouth/plymouth/-/blob/main/src/plugins/controls/label/plugin.c#L227

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Sounds like a weak excuse. Cairo is implemented on top of software buffers that plymouth/pango/any-font-renderers should be writing to directly. Hence Cairo should not be involved, ideally.

I would say Cairo is what needs to be removed from Plymouth to remove most dependencies.

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Sure, but what should be proposed to upstream?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

> Sure, but what should be proposed to upstream?

A minor rewrite of the label plugin that perhaps none of us have time to do right now. :)

Although if Steve's concern becomes a blocker then one of us will need to.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package plymouth - 0.9.5+git20211018-1ubuntu4

---------------
plymouth (0.9.5+git20211018-1ubuntu4) kinetic; urgency=medium

  * Add patches to build the label-ft plugin, an alternative to the label
    plugin that has less dependencies (LP: #1976352).
  * Apply labelft-0004-label-ft-fix-alignment.patch to fix alignment
    issue with the label-ft control plugin.

 -- Alfonso Sanchez-Beato <email address hidden> Mon, 11 Jul 2022 11:07:22 +0100

Changed in plymouth (Ubuntu):
status: Fix Committed → Fix Released
description: updated
description: updated
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Hi, could please somebody sponsor to jammy-proposed plymouth package from kinetic (0.9.5+git20211018-1ubuntu4)?

Revision history for this message
Steve Langasek (vorlon) wrote :

FYI this binary package has just been demoted to universe in kinetic because it has no reverse-dependencies in main. If it's to be used in images, please make sure it ends up in the appropriate seed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.