#90 Use RemovePathPostfixes for gdb-minimal
Closed 2 months ago by kevinb. Opened 9 months ago by siosm.
rpms/ siosm/gdb gdb-minimal  into  rawhide

file modified
+8 -1
@@ -457,6 +457,9 @@ 

  %if 0%{?_build_minimal}

  %package minimal

  Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages (minimal version)

+ # Conflict with the main package and trim '-minimal' suffix from binaries

+ Conflicts: %{name}

+ RemovePathPostfixes: .minimal

  # gdb-add-index is shared with gdb-headless and it must be from same version

  Conflicts: %{name}-headless < %{version}-%{release}

  Conflicts: %{name}-headless > %{version}-%{release}
@@ -467,7 +470,7 @@ 

  fashion and printing their data.

  

  This package provides a minimal version of GDB, tailored to be used by

- the Fedora buildroot.  It should probably not be used by end users.

+ the Fedora buildroot or in non-interactive use cases.

  %endif # 0%{?_build_minimal}

  

  %package gdbserver
@@ -1252,6 +1255,10 @@ 

  %endif

  

  %changelog

+ * Mon Jul 17 2023 Timothée Ravier <tim@siosm.fr> - 13.2-5

+ - Use RemovePathPostfixes for the minimal package and have it conflict with the

+   main one.

+ 

  * Fri Jul 07 2023 Python Maint <python-maint@redhat.com>

  - Rebuilt for Python 3.12

  

Using RemovePathPostfixes: -minimal for the gdb-minimal package, we
can get a sub package with a gdb binary instead of using a distinct
name for the binary.

Add a conflcit for the main package as we can no longer install both at
the same time.

See: https://rpm-software-management.github.io/rpm/manual/spec.html

In the .spec file, the description of the gdb-minimal package says, "This package provides a minimal version of GDB, tailored to be used by the Fedora buildroot. It should probably not be used by end users."

First, note that it says that it should (probably) not be installed by end users. That being the case, does it matter what the GDB binary is named?

Second, since the gdb-minimal package is used by the Fedora buildroot, I think it's likely that a name change here will require a name change in some other package or perhaps the build infrastructure. (EDIT: I think this is unlikely to be a problem. There is a script named gdb-add-index which is installed by the gdb-minimal package. It looks for 'gdb.minimal' as well as 'gdb'.)

Lastly, is there a compelling reason for this change? Having the minimal package - which most users won't install - install the GDB binary with a different name doesn't seem like a bad thing to me. In fact, I'd argue that it's a good thing since you'll be aware of the fact that you're working with a somewhat less functional version of gdb.

After thinking about this some more, I'm also concerned that, if the gdb-minimal package's installed binary is named 'gdb', we may get bug reports about missing gdb features from users who inadvertently installed gdb-minimal.

Also, after installing the gdb-minimal package on Fedora 38, I found that the binary is actually named 'gdb.minimal".

I found it useful to (re)read this document...

https://fedoraproject.org/wiki/Changes/Minimal_GDB_in_buildroot

...to remind myself for the reason why the gdb-minimal package was added.

There is the chase for a minimal size cloud image as each MB means some $$ and maybe some cloud images need GDB for some non-interactive tasks and maybe gdb-minimal is sufficient for some of these cloud image use cases. They would expect to use /usr/bin/gdb. But there is too many ands and maybes so it would be nice for such change justification to have such an example cloud image or other such use case first.
If there is no use for gdb-minimal as a minimal replacement for a regular gdb maybe it could be rather called gdb-rpmbuild-helper or some such. As the naming maybe unfortunate as there are already many *-minimal packages looking to be possibly used by users.

In the .spec file, the description of the gdb-minimal package says, "This package provides a minimal version of GDB, tailored to be used by the Fedora buildroot. It should probably not be used by end users."

I can also update that description to match the change.

Second, since the gdb-minimal package is used by the Fedora buildroot, I think it's likely that a name change here will require a name change in some other package or perhaps the build infrastructure. (EDIT: I think this is unlikely to be a problem. There is a script named gdb-add-index which is installed by the gdb-minimal package. It looks for 'gdb.minimal' as well as 'gdb'.)

We can add a symlink from gdb.minimal to gdb if that is a concern and then drop it in a later release.

First, note that it says that it should (probably) not be installed by end users. That being the case, does it matter what the GDB binary is named?

Lastly, is there a compelling reason for this change? Having the minimal package - which most users won't install - install the GDB binary with a different name doesn't seem like a bad thing to me. In fact, I'd argue that it's a good thing since you'll be aware of the fact that you're working with a somewhat less functional version of gdb.

This is driven by the need to include GDB in Fedora Kinoite (and likely Silverblue too soon) for application crash reporting. GDB is not used as a command line tool but instead by other graphical applications (DrKonqi for KDE). We thus mostly don't need the additional features and dependencies that are interesting only for interactive users. We do need the binary to be named correctly to not have to create a special "Fedora" case with custom names for GDB.

After thinking about this some more, I'm also concerned that, if the gdb-minimal package's installed binary is named 'gdb', we may get bug reports about missing gdb features from users who inadvertently installed gdb-minimal.

Note that the curl package already has a minimal and non-minimal variants.

In this case, only Kinoite systems would have this pre-installed. Otherwise, users would be explicitly installing the minimal version and they could always install the full variant if they need it.

rebased onto 6a517183d9e5e9e5ade2c96015e3839105453315

9 months ago

For now, I've included the full gdb package in Kinoite and manually excluded the dependencies that we don't want: https://pagure.io/fedora-kde/SIG/issue/218 & https://pagure.io/workstation-ostree-config/pull-request/396

rebased onto 3834e05

9 months ago

Pull-Request has been closed by kevinb

2 months ago
Metadata