Bug 2068556 - Allow installing envsubst binary without unnecessary dependencies
Summary: Allow installing envsubst binary without unnecessary dependencies
Alias: None
Product: Fedora
Classification: Fedora
Component: gettext
Version: 37
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Sundeep Anand
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2022-03-25 16:35 UTC by Honza Horak
Modified: 2022-09-27 06:09 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2022-09-27 06:09:49 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-409 0 None None None 2022-03-25 16:43:52 UTC

Description Honza Horak 2022-03-25 16:35:32 UTC
Description of problem:

TL;DR: this is a request to allow install envsubst binary without other unnecessary stuff from the gettext package.


The tool envsubst seems to be quite handy when working with configuration files in environments with a minimal footprint, like container images.

Containers are typically configured via environment variables, which are then put into files. We therefore often use envsubst to evaluate some variables in the config files.

However, when installing entire gettext for having envsubst binary available, it pulls in additional 7MB.

This is similar to what is being done when building small containers (installing into a directory):

$> mkdir rootfs-with-gettext rootfs-without-gettext
$> PACKAGES="bash"
$> dnf -y --releasever 35 --setopt install_weak_deps=false --nodocs --installroot $(pwd)/rootfs-without-gettext --disablerepo='*' --enablerepo=fedora install $PACKAGES
$> PACKAGES="bash gettext"
$> dnf -y --releasever 35 --setopt install_weak_deps=false --nodocs --installroot $(pwd)/rootfs-with-gettext --disablerepo='*' --enablerepo=fedora install $PACKAGES
$> rm -rf rootfs-without-gettext/var/cache/dnf/*
$> rm -rf rootfs-with-gettext/var/cache/dnf/*
$> du -d 0 -h rootfs-without-gettext
25M	rootfs-without-gettext
$> du -d 0 -h rootfs-with-gettext
38M	rootfs-with-gettext

Re-implementing the envsubst does not seem to be necessary, as it might likely work without additional stuff from the gettext package.

Comment 1 Honza Horak 2022-03-25 16:39:14 UTC
There is a PoC that worked for me, althoug might need some changes (I didn't put much thinking into which files the envsubst binary actually really needs from the gettext package): https://src.fedoraproject.org/rpms/gettext/pull-request/14

Comment 2 Sundeep Anand 2022-04-11 10:06:30 UTC
Another way looking at it could be separating out tools from the gettext main package, which is rather a larger chunk.

We had some ideas around https://src.fedoraproject.org/rpms/gettext/pull-request/7

This will reduce the footprint, and envsubst may continue a part of gettext main package.

Comment 3 Sundeep Anand 2022-04-13 10:57:50 UTC
How do you feel Honza?

Comment 4 Honza Horak 2022-05-10 09:57:32 UTC
I like the idea of splitting the tools. Still, when trying this change, I still see the size difference being 8MB (uncompressed installed files). So, it's quite far from the option of having just envsubst without anything else.

Comment 5 Sundeep Anand 2022-05-18 04:34:19 UTC
gettext split PR: https://src.fedoraproject.org/rpms/gettext/pull-request/15
scratch build repo: https://fedora.softwarefactory-project.io/logs/15/15/8e84a29c75f635efaa363ab14bebabf7e0fc30f2/check/rpm-scratch-build/734ab04/repo/
After the split, envsubst binary would be a part of gettext (main) package.

I take a re-look and find following:

gettext package
compressed size: 172 kB
uncompressed size: 749.6 kB

gettext-tools subpackage
compressed size: 1.0 MB
uncompressed size: 4.7 MB

As gettext depends on gettext-libs:

gettext-libs subpackage
compressed size: 322K
uncompressed size: 933.7 kB

so, total uncompressed size for envsubst would be 1413.3 kB

Comment 6 Jens Petersen 2022-06-13 10:17:21 UTC
Considering that envsubst doesn't depend on gettext-libs,
maybe it does make sense to subpackage separately
(so then gettext-runtime would requires it).

(Admittedly I have never actually used envsubst myself. :)

Comment 7 Ben Cotton 2022-08-09 13:38:14 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 8 Sundeep Anand 2022-08-17 08:22:27 UTC
Changes have been merged and built in rawhide: gettext-0.21-18.fc38.0.20220203

PR     https://src.fedoraproject.org/rpms/gettext/pull-request/19
Copr   https://copr.fedorainfracloud.org/coprs/suanand/envsubst/
Koji   https://koji.fedoraproject.org/koji/taskinfo?taskID=90907290

Comment 9 Honza Horak 2022-08-17 12:23:36 UTC
Thanks a lot, this change looks good, nothing else is installed when pulling in gettext-envsubst. I'm closing the original PR.

Comment 10 Fedora Update System 2022-08-25 07:11:31 UTC
FEDORA-2022-a8cde2a93d has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a8cde2a93d

Comment 11 Fedora Update System 2022-08-26 11:56:30 UTC
FEDORA-2022-a8cde2a93d has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-a8cde2a93d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-a8cde2a93d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Note You need to log in before you can comment on or make changes to this bug.