From Fedora Project Wiki
 
(3 intermediate revisions by the same user not shown)
Line 177: Line 177:
`*.la` files explicitly listed in `%files` (this includes packages that modify the `*.la` file(s) but don't list them in `%files` explicitly):
`*.la` files explicitly listed in `%files` (this includes packages that modify the `*.la` file(s) but don't list them in `%files` explicitly):
* [https://src.fedoraproject.org/rpms/arts/pull-request/2 arts (MERGED)]
* [https://src.fedoraproject.org/rpms/arts/pull-request/2 arts (MERGED)]
* [https://src.fedoraproject.org/rpms/gambas3/pull-request/2 gambas3]
* [https://src.fedoraproject.org/rpms/gambas3/pull-request/2 gambas3 (MERGED)]
* [https://src.fedoraproject.org/rpms/chafa/pull-request/2 chafa]
* [https://src.fedoraproject.org/rpms/chafa/pull-request/2 chafa]
* [https://src.fedoraproject.org/rpms/ImageMagick/pull-request/5 ImageMagick (MERGED)]
* [https://src.fedoraproject.org/rpms/ImageMagick/pull-request/5 ImageMagick (MERGED)]
Line 189: Line 189:
* [https://src.fedoraproject.org/rpms/mingw-sane-backends/pull-request/1 mingw-sane-backends]
* [https://src.fedoraproject.org/rpms/mingw-sane-backends/pull-request/1 mingw-sane-backends]
* [https://src.fedoraproject.org/rpms/mingw-speexdsp/pull-request/1 mingw-speexdsp]
* [https://src.fedoraproject.org/rpms/mingw-speexdsp/pull-request/1 mingw-speexdsp]
* [https://src.fedoraproject.org/rpms/neon/pull-request/2 neon]
* [https://src.fedoraproject.org/rpms/neon/pull-request/2 neon (MERGED)]
* [https://src.fedoraproject.org/rpms/openldap/pull-request/9 openldap]
* [https://src.fedoraproject.org/rpms/openldap/pull-request/9 openldap (MERGED)]
* [https://src.fedoraproject.org/rpms/pinball/pull-request/2 pinball (MERGED)]
* [https://src.fedoraproject.org/rpms/pinball/pull-request/2 pinball (MERGED)]
* [https://src.fedoraproject.org/rpms/qt5-qtbase/pull-request/8 qt5-qtbase (MERGED)]
* [https://src.fedoraproject.org/rpms/qt5-qtbase/pull-request/8 qt5-qtbase (MERGED)]
Line 196: Line 196:
* [https://src.fedoraproject.org/rpms/qt5-qtremoteobjects/pull-request/1 qt5-qtremoteobjects (MERGED)]
* [https://src.fedoraproject.org/rpms/qt5-qtremoteobjects/pull-request/1 qt5-qtremoteobjects (MERGED)]
* [https://src.fedoraproject.org/rpms/qt5-qttools/pull-request/3 qt5-qttools (MERGED)]
* [https://src.fedoraproject.org/rpms/qt5-qttools/pull-request/3 qt5-qttools (MERGED)]
* [https://src.fedoraproject.org/rpms/subversion/pull-request/5 subversion]
* [https://src.fedoraproject.org/rpms/subversion/pull-request/5 subversion (MERGED)]
* [https://src.fedoraproject.org/rpms/unicornscan/pull-request/1 unicornscan]
* [https://src.fedoraproject.org/rpms/unicornscan/pull-request/1 unicornscan (MERGED)]
* [https://src.fedoraproject.org/rpms/xfce4-calculator-plugin/pull-request/1 xfce4-calculator-plugin]
* [https://src.fedoraproject.org/rpms/xfce4-calculator-plugin/pull-request/1 xfce4-calculator-plugin]
* [https://src.fedoraproject.org/rpms/GraphicsMagick/pull-request/1 GraphicsMagick (MERGED)]
* [https://src.fedoraproject.org/rpms/GraphicsMagick/pull-request/1 GraphicsMagick (MERGED)]

Latest revision as of 07:30, 16 February 2022


Remove .la files from buildroot

Summary

Autools/libtool-based projects frequently install files ending in .la in their make install. These files are usually unwanted. Many projects therefore end up with a variation of find $RPM_BUILD_ROOT -name "*.la" -delete in their %install section.

*.la files are "libtool archives" and provide additional metadata for library files and come from a time before the introduction of the ELF format. Today, they are only consumed by libtool itself. Refer to https://autotools.io/libtool/lafiles.html.

This changes proposes to instead use the %__brp_remove_la_files macro in redhat-rpm-config's %__os_install_post to remove the *.la files automatically. This has been added to RPM 4.17.

Owner


Current status

  • Targeted release: Fedora Linux 36
  • Last updated: 2022-02-16
  • Devel list thread
  • FESCo issue: #2693
  • Tracker bug: #2024312
  • Release notes tracker: <will not be assigned by Wrangler - not user-facing>

Detailed Description

Feedback

Benefit to Fedora

This change removes a widely used line of shell script from many spec files. The advantage is cleaner and easier to maintain spec files as well as more sensible defaults for rpm package builds.

While looking at what packages will be affected by this change, I already found several packages that ship and install .la files by accident. These packages will be fixed to not ship them.

Scope

  • Proposal owners:
    • Update packaging guidelines to mention the automatic removal of *.la files and mention the mechanism for opting out of this behavior.
  • Other developers:
    • For the packages already removing their *.la files manually, there should be no change. For packages that want to install such packages, the package maintainers need to opt out of the automatic removal.


  • Policies and guidelines: N/A (not needed for this Change)
  • Alignment with Objectives:

Upgrade/compatibility impact

The following packages ship .la files currently (queried via $ repoquery --repo=rawhide -f '*.la' --source | pkgname | sort | uniq):


*.la files explicitly listed in %files (this includes packages that modify the *.la file(s) but don't list them in %files explicitly):


No mention of *.la files in the spec file:

  • gcc-avr
  • calf
  • cross-gcc
  • djview4
  • filezilla
  • gforth
  • gnome-do
  • gnome-subtitles
  • google-authenticator
  • gstreamer1-doc
  • jpilot
  • kguitar
  • liferea
  • mcabber
  • mousepad
  • octave
  • opencryptoki
  • pragha
  • taxipilot
  • xfce4-timer-plugin


Tries to delete them but fails:

  • aqbanking
  • binutils (fixed)
  • flatpak
  • gretl
  • gutenprint
  • gwenhywfar
  • kdepim3
  • koffice-kivio
  • OpenIPMI
  • owfs
  • util-linux

How To Test

Whether a RPM package ships .la files can be checked either via the repoquery command from above or via querying a local .rpm file directly: rpm -q --files ./my-package.rpm | grep '\.la$'. The latter command can be used for local testing.

If a package currently ships any *.la files but only does so accidentally, nothing needs to be done and the package will automatically stop shipping those files after it is rebuilt with this change in effect.

If a package whishes to keep shipping *.la files, the package maintainer can opt out of the automatic removal by setting %__brp_remove_la_files to %nil: %global __brp_remove_la_files %nil

If the package currently removes all *.la files manually via some form of find $RPM_BUILD_ROOT -name "*.la" -delete or similar, it is recommended (but not required) to remove that line.


User Experience

Users should not notice any change.

Dependencies

There are no dependencies. Only redhat-rpm-config needs to adapt to the change.

Contingency Plan

  • Contingency mechanism: The change can simply be reverted in the redhat-rpm-config package. Packages that have already removed the manual deletion of *.la files need to revert this change too. Packages that have opted out of the automatic *.la file removal don't need to do anything.
  • Contingency deadline: beta freeze
  • Blocks release? Yes


Documentation

Pull request implementing %__brp_remove_la_files in the upstream rpm repository: https://github.com/rpm-software-management/rpm/pull/1674


Release Notes

The RPM 4.17 release notes simply state "Add policy for removing .la files from buildroot by default".