Bug 433323 - Use pkglibexecdir as vglibdir
Summary: Use pkglibexecdir as vglibdir
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Mark Wielaard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-20 12:29 UTC by Mark Wielaard
Modified: 2021-02-28 17:00 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Use pkglibexec as vglibdir (6.22 KB, text/plain)
2021-02-20 12:39 UTC, Mark Wielaard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2021-02-20 12:29:09 UTC
vglibdir is the directory from where valgrind loads its internal executables, vgpreload and static tools. Currently vglibdir is pkglibdir, so those internal tools are intermingeled with normal executables and libraries that the user might use directly.

Make vglibdir equal to pkglibexecdir so the internal tools get installed and loaded from libexec and don't get get stored under lib.

This leaves just the static archives and the mpiwrapper libraries that the user would link/load themselves under lib.

This seems more in line with the FHS lib/libexec standard and makes it slightly easier to combine the tools from a multilib target (say the memcheck-amd64-linux and memcheck-x86-linux tools) because they would be installed under the same directory, while the pkglibdir can differ depending on arch/target (lib/lib64).
Comment 1 Mark Wielaard 2021-02-20 12:39:08 UTC
Created attachment 135964 [details]
Use pkglibexec as vglibdir
Comment 2 Tom Hughes 2021-02-20 12:41:38 UTC
Note that libexec usage varies quite a bit across distros - it's not used much on Ubuntu for example but is on Fedora.

Bizarrely valgrind is one of the few packages that does seem to use libexec on Ubuntu, but only for the DHAT html/js/css files, which seems very odd.
Comment 3 Mark Wielaard 2021-02-20 14:25:49 UTC
(In reply to Tom Hughes from comment #2)
> Note that libexec usage varies quite a bit across distros - it's not used
> much on Ubuntu for example but is on Fedora.

Yes, I have been using it on Fedora for some time (since 3.16.0 at least). But it should be distro independent. And is more in spirit of the FHS and how automake intends pkglibdir vs pkglibexecdir to be used.

> Bizarrely valgrind is one of the few packages that does seem to use libexec
> on Ubuntu, but only for the DHAT html/js/css files, which seems very odd.

I think it depends on how you look at those files. Note that we used to also install those under pkglibdir, which also seemed wrong/weird. If you see them as executables (which at least the js/css are) intended to be run by other programs (webbrowsers) then libexec makes sense. But maybe there is a different standard place to install those programs? Where they are installed is controlled by the dhatdir variable defined in dhat/Makefile.am.
Comment 4 Mark Wielaard 2021-02-23 11:37:55 UTC
Note that Debian only recently (2018) started following FHS 3.0 which allows libexec use. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834607
Which probably explains why it isn't yet widely used on Debian.
Comment 5 Mark Wielaard 2021-02-28 17:00:36 UTC
commit c9d1cd0db3a806ee0b2e91f59261d6caf791ffee
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Feb 19 23:49:10 2021 +0100

    Use pkglibexec as vglibdir.
    
    vglibdir is the directory from where valgrind loads its internal tool
    executables and vgpreloads. Currently vglibdir is pkglibdir, so those
    internal tools are intermingeled with normal executables and libraries
    that the user might use directly.
    
    Make vglibdir equal to pkglibexecdir so the internal tools get installed
    and loaded from libexec and don't get get stored under lib.
    
    This leaves just the static archives and the mpiwrapper libraries that
    the user would link/load themselves under pkglibdir.
    
    This seems more in line with the FHS lib/libexec standard and makes it
    slightly easier to combine the tools from a multilib target (say the
    memcheck-amd64-linux and memcheck-x86-linux tools) because they would
    be installed under the same directory, while the pkglibdir can differ
    depending on arch/target (lib/lib64).
    
    https://bugs.kde.org/show_bug.cgi?id=433323