Bug 2316238

Summary: emacs-nw package has a lot of package dependencies
Product: [Fedora] Fedora Reporter: Jeffrey Walton <noloader>
Component: emacsAssignee: Daiki Ueno <dueno>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 40CC: benson_muite, dan.cermak, dmalcolm, dueno, eliz, fweimer, gordon.messmer, jakub, jlaw, josmyers, jwakely, marcandre.lureau, mavit, mcermak, mpolacek, msebor, msekleta, nickc, nixuser, noloader, phracek, sipoyare
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: emacs-29.4-38.fc41 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-13 11:13:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeffrey Walton 2024-10-03 02:43:22 UTC
I just installed Fedora 40 Server on x86_64 hardware. The server is fully up-to-date using dnf.

I'm an emacs users. I need to edit some configuration files. I install emacs-nox or emacs-nw, depending on what the distro offers.

Fedora provides emacs-nw, so I installed it (see below). I was surprised to see 622 MB of dependencies brought in just to edit text files from a terminal.

I think something is a bit off with the way this package is built. This looks like the dependencies for a full-blown emacs install, not a non-windowed installation on a headless server for a terminal.

(And sorry to file this against the 'emacs' package. There was no selection for 'emacs-nw' or 'emacs-nox').

-----

$ sudo yum install emacs-nox
Last metadata expiration check: 0:19:03 ago on Wed 02 Oct 2024 10:09:59 PM EDT.
Dependencies resolved.
==============================================================================
 Package                   Arch      Version                 Repository  Size
==============================================================================
Installing:
 emacs-nw                  x86_64    1:29.4-9.fc40           updates     31 M
Installing dependencies:
 alsa-lib                  x86_64    1.2.12-1.fc40           updates    514 k
 cpp                       x86_64    14.2.1-3.fc40           updates     12 M
 emacs-common              x86_64    1:29.4-9.fc40           updates     42 M
 gc                        x86_64    8.2.2-6.fc40            fedora     110 k
 gcc                       x86_64    14.2.1-3.fc40           updates     37 M
 git-core                  x86_64    2.46.2-1.fc40           updates    4.8 M
 git-core-doc              noarch    2.46.2-1.fc40           updates    3.0 M
 glibc-devel               x86_64    2.39-22.fc40            updates    116 k
 glibc-headers-x86         noarch    2.39-22.fc40            updates    610 k
 guile30                   x86_64    3.0.7-12.fc40           fedora     8.1 M
 kernel-headers            x86_64    6.10.3-200.fc40         updates    1.6 M
 libgccjit                 x86_64    14.2.1-3.fc40           updates     11 M
 liblockfile               x86_64    1.17-8.fc40             fedora      30 k
 libmpc                    x86_64    1.3.1-5.fc40            fedora      71 k
 libstdc++-devel           x86_64    14.2.1-3.fc40           updates    2.8 M
 libtree-sitter            x86_64    0.22.5-1.fc40           updates    101 k
 libxcrypt-devel           x86_64    4.4.36-5.fc40           fedora      29 k
 make                      x86_64    1:4.4.1-6.fc40          fedora     588 k
 perl-AutoLoader           noarch    5.74-506.fc40           fedora      22 k
 perl-B                    x86_64    1.88-506.fc40           fedora     176 k
 perl-Carp                 noarch    1.54-502.fc40           fedora      29 k
 perl-Class-Struct         noarch    0.68-506.fc40           fedora      23 k
 perl-Data-Dumper          x86_64    2.188-503.fc40          fedora      56 k
 perl-Digest               noarch    1.20-502.fc40           fedora      25 k
 perl-Digest-MD5           x86_64    2.59-3.fc40             fedora      36 k
 perl-DynaLoader           x86_64    1.54-506.fc40           fedora      26 k
 perl-Encode               x86_64    4:3.21-505.fc40         fedora     1.1 M
 perl-Errno                x86_64    1.37-506.fc40           fedora      15 k
 perl-Error                noarch    1:0.17029-15.fc40       fedora      40 k
 perl-Exporter             noarch    5.78-3.fc40             fedora      31 k
 perl-Fcntl                x86_64    1.15-506.fc40           fedora      21 k
 perl-File-Basename        noarch    2.86-506.fc40           fedora      18 k
 perl-File-Find            noarch    1.43-506.fc40           fedora      26 k
 perl-File-Path            noarch    2.18-503.fc40           fedora      35 k
 perl-File-Temp            noarch    1:0.231.100-503.fc40    fedora      59 k
 perl-File-stat            noarch    1.13-506.fc40           fedora      18 k
 perl-FileHandle           noarch    2.05-506.fc40           fedora      16 k
 perl-Getopt-Long          noarch    1:2.57-4.fc40           updates     63 k
 perl-Getopt-Std           noarch    1.13-506.fc40           fedora      16 k
 perl-Git                  noarch    2.46.2-1.fc40           updates     39 k
 perl-HTTP-Tiny            noarch    0.088-5.fc40            fedora      56 k
 perl-IO                   x86_64    1.52-506.fc40           fedora      83 k
 perl-IO-Socket-IP         noarch    0.42-2.fc40             fedora      42 k
 perl-IO-Socket-SSL        noarch    2.085-1.fc40            fedora     229 k
 perl-IPC-Open3            noarch    1.22-506.fc40           fedora      22 k
 perl-MIME-Base64          x86_64    3.16-503.fc40           fedora      30 k
 perl-Mozilla-CA           noarch    20231213-3.fc40         fedora      14 k
 perl-Net-SSLeay           x86_64    1.94-3.fc40             fedora     385 k
 perl-POSIX                x86_64    2.13-506.fc40           fedora      97 k
 perl-PathTools            x86_64    3.89-502.fc40           fedora      87 k
 perl-Pod-Escapes          noarch    1:1.07-503.fc40         fedora      20 k
 perl-Pod-Perldoc          noarch    3.28.01-503.fc40        fedora      86 k
 perl-Pod-Simple           noarch    1:3.45-6.fc40           fedora     219 k
 perl-Pod-Usage            noarch    4:2.03-504.fc40         updates     40 k
 perl-Scalar-List-Utils    x86_64    5:1.63-503.fc40         fedora      73 k
 perl-SelectSaver          noarch    1.02-506.fc40           fedora      12 k
 perl-Socket               x86_64    4:2.038-1.fc40          updates     55 k
 perl-Storable             x86_64    1:3.32-502.fc40         fedora      98 k
 perl-Symbol               noarch    1.09-506.fc40           fedora      15 k
 perl-Term-ANSIColor       noarch    5.01-504.fc40           fedora      48 k
 perl-Term-Cap             noarch    1.18-503.fc40           fedora      22 k
 perl-TermReadKey          x86_64    2.38-21.fc40            fedora      35 k
 perl-Text-ParseWords      noarch    3.31-502.fc40           fedora      16 k
 perl-Text-Tabs+Wrap       noarch    2024.001-1.fc40         fedora      22 k
 perl-Time-Local           noarch    2:1.350-5.fc40          fedora      34 k
 perl-URI                  noarch    5.28-1.fc40             updates    133 k
 perl-base                 noarch    2.27-506.fc40           fedora      17 k
 perl-constant             noarch    1.33-503.fc40           fedora      23 k
 perl-if                   noarch    0.61.000-506.fc40       fedora      14 k
 perl-interpreter          x86_64    4:5.38.2-506.fc40       fedora      72 k
 perl-lib                  x86_64    0.65-506.fc40           fedora      15 k
 perl-libnet               noarch    3.15-503.fc40           fedora     129 k
 perl-libs                 x86_64    4:5.38.2-506.fc40       fedora     2.3 M
 perl-locale               noarch    1.10-506.fc40           fedora      14 k
 perl-mro                  x86_64    1.28-506.fc40           fedora      29 k
 perl-overload             noarch    1.37-506.fc40           fedora      46 k
 perl-overloading          noarch    0.02-506.fc40           fedora      13 k
 perl-parent               noarch    1:0.241-502.fc40        fedora      15 k
 perl-podlators            noarch    1:5.01-502.fc40         fedora     126 k
 perl-vars                 noarch    1.05-506.fc40           fedora      13 k
Installing weak dependencies:
 enchant2                  x86_64    2.6.9-1.fc40            updates     65 k
 gcc-c++                   x86_64    14.2.1-3.fc40           updates     14 M
 git                       x86_64    2.46.2-1.fc40           updates     52 k
 info                      x86_64    7.1-2.fc40              fedora     182 k
 libtree-sitter-java       x86_64    0.20.2-2.fc40           fedora      62 k
 perl-NDBM_File            x86_64    1.16-506.fc40           fedora      23 k

Transaction Summary
==============================================================================
Install  87 Packages

Total download size: 176 M
Installed size: 622 M

Comment 1 Peter Oliver 2024-10-03 10:51:15 UTC
Some of these dependencies are optional.  If you would prefer not to install them, you can do that with:

    sudo yum install --setopt=install_weak_deps=False emacs-nw

The bulk of the remainder is GCC and dependencies, which are required for Emacs' native compilation feature.  This improves speed at the expense of space (https://www.gnu.org/software/emacs/manual/html_node/elisp/Native-Compilation.html).

We already provide four different Emacs builds, and I don't think it would make sense to double that to provide builds without native compilation.  If you really want to save the disk space, and don't mind Emacs warning you that it isn't able to natively compile the code for any Emacs packages that you install, you could run:

    sudo rpm -e --nodeps gcc
    sudo yum autoremove

Given that this still allows Emacs to run the previously-compiled native code that is included in the Emacs RPMs, perhaps the dependencies of the libgccjit RPM should be altered to make gcc a weak dependency.  That would be a decision for the gcc RPM package maintainers.

Comment 2 Jakub Jelinek 2024-10-03 11:06:56 UTC
That doesn't make any sense, gcc is a hard dependency of libgccjit, the library doesn't work at all without it.

Comment 3 Fedora Update System 2024-10-03 23:56:44 UTC
FEDORA-2024-ef83e4516c (emacs-29.4-36.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-ef83e4516c

Comment 4 Fedora Update System 2024-10-04 02:57:29 UTC
FEDORA-2024-ef83e4516c has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-ef83e4516c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-ef83e4516c

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

Comment 5 Fedora Update System 2024-10-11 01:36:06 UTC
FEDORA-2024-622c0253f9 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-622c0253f9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-622c0253f9

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

Comment 6 Jeffrey Walton 2024-10-24 05:56:01 UTC
I just stood up another production web server using a Fedora 40 Server. The machine is fully patched, and it faces the internet.

I am baffled at the extra stuff being pulled in for emacs-nw. All I want is a simple text editor. I _don't_ want a compiler on this machine. I am not trying to help a bad guy attack this machine. If someone wishes to compile source files through emacs, then they should install a compiler.

$ sudo dnf install emacs-nw --setopt=install_weak_deps=False
Last metadata expiration check: 0:03:05 ago on Thu 24 Oct 2024 01:48:40 AM EDT.
Dependencies resolved.
==============================================================================
 Package                Arch        Version                Repository    Size
==============================================================================
Installing:
 emacs-nw               x86_64      1:29.4-9.fc40          updates       31 M
Installing dependencies:
 alsa-lib               x86_64      1.2.12-1.fc40          updates      514 k
 cpp                    x86_64      14.2.1-3.fc40          updates       12 M
 emacs-common           x86_64      1:29.4-9.fc40          updates       42 M
 gc                     x86_64      8.2.2-6.fc40           fedora       110 k
 gcc                    x86_64      14.2.1-3.fc40          updates       37 M
 glibc-devel            x86_64      2.39-22.fc40           updates      116 k
 glibc-headers-x86      noarch      2.39-22.fc40           updates      610 k
 guile30                x86_64      3.0.7-12.fc40          fedora       8.1 M
 kernel-headers         x86_64      6.11.3-200.fc40        updates      1.6 M
 libgccjit              x86_64      14.2.1-3.fc40          updates       11 M
 liblockfile            x86_64      1.17-8.fc40            fedora        30 k
 libmpc                 x86_64      1.3.1-5.fc40           fedora        71 k
 libtree-sitter         x86_64      0.22.5-1.fc40          updates      101 k
 libxcrypt-devel        x86_64      4.4.36-5.fc40          fedora        29 k
 make                   x86_64      1:4.4.1-6.fc40         fedora       588 k

Transaction Summary
==============================================================================
Install  16 Packages

Total download size: 145 M
Installed size: 507 M

Comment 7 Dan Čermák 2024-10-24 07:26:00 UTC
(In reply to Jeffrey Walton from comment #6)
> I just stood up another production web server using a Fedora 40 Server. The
> machine is fully patched, and it faces the internet.
> 
> I am baffled at the extra stuff being pulled in for emacs-nw. All I want is
> a simple text editor. I _don't_ want a compiler on this machine. I am not
> trying to help a bad guy attack this machine. If someone wishes to compile
> source files through emacs, then they should install a compiler.

Emacs nowadays uses libgccjit to just-in-time compile elisp and therefore needs gcc.

Comment 8 Jonathan Wakely 2024-10-24 07:42:30 UTC
i.e. this has nothing to do with wishing "to compile source files through emacs", it's about using emacs itself.

Comment 9 Jeffrey Walton 2024-10-24 07:44:27 UTC
Thanks Dan and Jonathan.

I'll raise an issue with the emacs folks.

Comment 10 Jeffrey Walton 2024-10-24 07:47:50 UTC
(In reply to Jeffrey Walton from comment #9)
> Thanks Dan and Jonathan.
> 
> I'll raise an issue with the emacs folks.

Also see <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73982>.

Comment 11 Eli Zaretskii 2024-10-24 10:11:18 UTC
It is wrong to raise this issue with the upstream Emacs project, because Emacs allows to configure the build with or without any optional dependency.  That includes native-compilation; in fact, native-compilation is OFF by default in Emacs 29, and only Emacs 30 (which was not yet released) will make it ON by default.  Evidently, Red Hat decided to provide Emacs 29 packages with native-compilation, for whatever reasons.  But whether ON or OFF by default, Emacs can be configured to build without native-compilation and any other optional dependency.

So it is the decision of the Red Hat packaging team that caused emacs-nox to include native-compilation, and it's their decision not to provide a similar package without native-compilation.
The upstream Emacs project includes build-time options to do both.  There's no bug in Emacs here.

I responded in this spirit to the bug report submitted to the Emacs bug tracker, see <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73982#8>.

Comment 12 Peter Oliver 2024-10-24 13:06:52 UTC
It would be possible to provide some kind of “emacs-minimal” package, but someone invested in this use-case would need to step forward to do the work to decide if it should supplement or replace the existing no-window build, decide what features it should include/exclude, and then help maintain it in future.  Offering a Copr repository (https://copr.fedorainfracloud.org/) would probably be a good place to start.

I'll leave this bug open for now, in case such a person volunteers.

Comment 13 Jeffrey Walton 2024-10-24 13:22:32 UTC
(In reply to Peter Oliver from comment #12)
> It would be possible to provide some kind of “emacs-minimal” package...
> I'll leave this bug open for now, in case such a person volunteers.

Thanks Peter.

I _think_ the emacs folks should provide a truly minimal option to configure. The last time I checked (circa v24), there was no "minimal" option. Something like this is missing:

    ./configure --enable-minimal

Instead, distros and users have to configure with something like this:

    ./configure \
      --with-xml2 \
      --with-zlib \
      --without-x \
      --without-sound \
      --without-xpm \
      --without-jpeg \
      --without-tiff \
      --without-gif \
      --without-png \
      --without-rsvg \
      --without-imagemagick \
      --without-xft \
      --without-libotf \
      --without-m17n-flt \
      --without-xaw3d \
      --without-toolkit-scroll-bars \
      --without-gpm \
      --without-dbus \
      --without-gconf \
      --without-gsettings \
      --without-makeinfo \
      --without-compress-install

Distros and users trying to find a way to minimize the build have been going on since at least 2013; see <https://superuser.com/q/617468>.

Comment 14 Jonathan Wakely 2024-10-24 13:47:48 UTC
It doesn't matter whether upstream provides a single option to do that or not. What takes effort is packaging and maintaining an alternative emacs-minimal RPM in the distro. Using a long list of options in the .spec file is not the hard part. Unless somebody is willing to do the hard part, the options used in the spec file are irrelevant.

Comment 15 Eli Zaretskii 2024-10-24 14:27:11 UTC
(In reply to Jeffrey Walton from comment #13)
> (In reply to Peter Oliver from comment #12)
> > It would be possible to provide some kind of “emacs-minimal” package...
> > I'll leave this bug open for now, in case such a person volunteers.
> 
> Thanks Peter.
> 
> I _think_ the emacs folks should provide a truly minimal option to
> configure. The last time I checked (circa v24), there was no "minimal"
> option. Something like this is missing:
> 
>     ./configure --enable-minimal

It is not missing, it is called "./configure --without-all".

May I suggest to invoke "./configure --help" and read what it says?

Comment 16 Benson Muite 2024-10-25 13:37:07 UTC
The article https://opensource.com/article/20/3/lightweight-emacs lists a
number of lightweight emacs alternatives:
µemacs - https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git/tree/
zile - https://www.gnu.org/software/zile/
jove - https://github.com/jonmacs/jove

µemacs cannot be packaged.
zile is already packaged - https://packages.fedoraproject.org/pkgs/jove/jove/
Jove has been orphaned:
https://packages.fedoraproject.org/pkgs/jove/jove/
Am working on bringing it back to Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=2321770

Comment 17 Peter Oliver 2024-10-25 13:57:13 UTC
Another Emacs clone, mg (https://github.com/hboetes/mg), is also packaged for Fedora.

Personally, I only run a text editor on a server or in a container in emergencies.  In usual circumstances, I edit remote files using a local Emacs and its TRAMP feature (https://www.gnu.org/software/emacs/manual/html_node/tramp/index.html).

Comment 18 Fedora Update System 2024-10-26 02:54:32 UTC
FEDORA-2024-622c0253f9 (emacs-29.4-38.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Jeffrey Walton 2025-01-13 05:28:20 UTC
I think this can be closed.

(I switched to zile. It is too frustrating trying to continue using emacs. The emacs maintainers want it to be too much).