boulder-d-legacy icon indicating copy to clipboard operation
boulder-d-legacy copied to clipboard

builder: Optionally compress man & info pages. Resolves #16

Open joebonrichie opened this issue 3 years ago • 6 comments
trafficstars

Compress any man or info page files found in the manifest with gzip, if enabled by the packager.

There are two considerations:-

  • It will increase the size of the resulting .stone file(s),
  • Updated symlinks not yet tested on a real install

joebonrichie avatar Sep 17 '22 14:09 joebonrichie

Just need to find a file with man page symlinks now and should be good to go. There is also an annoying bug where formattedSize introduces some useless whitespace.

joebonrichie avatar Jan 14 '23 09:01 joebonrichie

Just need to find a file with man page symlinks

Probably easier to add a symlink manually to test. But I'm pretty sure it won't work. The first check ensures only Regular files hit the NextFunction (i.e. so a Symlink will never hit compressPage).

Also with if ((fileInfo.type == FileType.Symlink) && (fileInfo.type != FileType.Directory)) the 2nd check is redundant as if it's a Symlink, then it will always not be a Directory.

sunnyflunk avatar Jan 16 '23 00:01 sunnyflunk

This is borked with the new zstd pledged size stuff. With the initial move to zstdoubledee it was working okay. Just hangs forever when emitting the packages. Don't really know what's going on.

joebonrichie avatar Jan 16 '23 09:01 joebonrichie

Bisected to here: https://github.com/serpent-os/moss-format/commit/641c047c3c602881c6900735f4735e6bfb7c32e0

joebonrichie avatar Jan 16 '23 09:01 joebonrichie

Seems to be failing to flush (remaining never decreases) [12:57:12] TRACE FLUSHING remaining 18446744073709551544

from here: https://github.com/serpent-os/moss-format/blob/main/source/moss/format/binary/writer/zstd_token.d#L117

joebonrichie avatar Jan 16 '23 12:01 joebonrichie

Switched to gzip compression and it's now working, meaning mandb can correctly display the resulting files! Switching to zstd in the future when the high level API is a bit more fleshed out is an option but I don't really want to use the low-level bindings for something like this.

Updated symlinks is now seemingly working (with the xz pkg) but I need to find a package I can safely remove and reinstall in the rootfs to fully test it, which is the last blocker. [Man] Updated symlink /usr/share/man/ro/man1/unxz.1 to xz.1.gz

joebonrichie avatar Jan 22 '23 10:01 joebonrichie