all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to find binaries in libexec dir?
@ 2022-04-16 23:21 Vagrant Cascadian
  2022-04-17 18:52 ` Danny Milosavljevic
  0 siblings, 1 reply; 6+ messages in thread
From: Vagrant Cascadian @ 2022-04-16 23:21 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]

Diffoscope uses *lots* of optional tools for which it would be
impractical to embed all the tool references in the guix
packaging... instead, for the most part, diffoscope relies on PATH to
find helper utilities to decode various file formats into something more
human readable...

But libxmlb ships the xb-tool binary in libexec, which diffoscope cannot
find on guix. For Debian, diffoscope just basically adds the
corresponding directory to PATH, and it's basically a single directory,
but I'm not sure how I'd do that with guix ...

How do I find all the potential libexec dirs that a user might have in a
given environment? On Guix System, I'll likely have at least the system
profile's libexec, the user's libexec, but as soon as you start using
guix shell, guix shell --container, or source multiple profiles, it's
hard to know where would be "reasonable" to look.

A workaround would be to adjust the libxmlb package so that xb-tool is
also in PATH somehow, but maybe this is bad form?


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to find binaries in libexec dir?
  2022-04-16 23:21 How to find binaries in libexec dir? Vagrant Cascadian
@ 2022-04-17 18:52 ` Danny Milosavljevic
  2022-04-17 19:27   ` Vagrant Cascadian
  0 siblings, 1 reply; 6+ messages in thread
From: Danny Milosavljevic @ 2022-04-17 18:52 UTC (permalink / raw)
  To: Vagrant Cascadian; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

Hi,

On Sat, 16 Apr 2022 16:21:50 -0700
Vagrant Cascadian <vagrant@reproducible-builds.org> wrote:

> But libxmlb ships the xb-tool binary in libexec, which diffoscope cannot
> find on guix.

> For Debian, diffoscope just basically adds the
> corresponding directory to PATH, and it's basically a single directory,
> but I'm not sure how I'd do that with guix ...
> 
> A workaround would be to adjust the libxmlb package so that xb-tool is
> also in PATH somehow, but maybe this is bad form?

Isn't the whole point of libexec so that executable is not in PATH?

FHS section 4.7 says:

>/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts.

libexec is usually used to store tool executables that are invoked internally
by libraries (glibc, ssh, gpg etc).

I'd like to caution against just adding libexec to PATH, because that would
make the entire separation of libexec out of bin (and thus the reason of
existence of libexec) useless to begin with.

I've looked upstream https://github.com/hughsie/libxmlb and it says, very close
to the beginning (so it's a main feature apparently):

>$ xb-tool compile fedora.xmlb fedora.xml.gz

Well, for that to work, xb-tool should be in bin.

I'd file a bug report with libxmlb to move xb-tool to bin.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to find binaries in libexec dir?
  2022-04-17 18:52 ` Danny Milosavljevic
@ 2022-04-17 19:27   ` Vagrant Cascadian
  2022-04-17 19:54     ` Liliana Marie Prikler
  0 siblings, 1 reply; 6+ messages in thread
From: Vagrant Cascadian @ 2022-04-17 19:27 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

On 2022-04-17, Danny Milosavljevic wrote:
> On Sat, 16 Apr 2022 16:21:50 -0700
> Vagrant Cascadian <vagrant@reproducible-builds.org> wrote:
>
>> But libxmlb ships the xb-tool binary in libexec, which diffoscope cannot
>> find on guix.
...
> I've looked upstream https://github.com/hughsie/libxmlb and it says, very close
> to the beginning (so it's a main feature apparently):
>
>>$ xb-tool compile fedora.xmlb fedora.xml.gz
>
> Well, for that to work, xb-tool should be in bin.
>
> I'd file a bug report with libxmlb to move xb-tool to bin.

Good suggestion, we'll see where it goes!

  Please install xb-tool into bin instead of libexec
  https://github.com/hughsie/libxmlb/issues/123


In the meantime, would it be reasonable to workaround this in guix by
patching libxmlb to include xb-tool in bin, either by moving it there,
or symlinking it from there?


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to find binaries in libexec dir?
  2022-04-17 19:27   ` Vagrant Cascadian
@ 2022-04-17 19:54     ` Liliana Marie Prikler
  2022-04-17 20:42       ` Vagrant Cascadian
  0 siblings, 1 reply; 6+ messages in thread
From: Liliana Marie Prikler @ 2022-04-17 19:54 UTC (permalink / raw)
  To: Vagrant Cascadian, Danny Milosavljevic; +Cc: guix-devel

Am Sonntag, dem 17.04.2022 um 12:27 -0700 schrieb Vagrant Cascadian:
> On 2022-04-17, Danny Milosavljevic wrote:
> > On Sat, 16 Apr 2022 16:21:50 -0700
> > Vagrant Cascadian <vagrant@reproducible-builds.org> wrote:
> > 
> > > But libxmlb ships the xb-tool binary in libexec, which diffoscope
> > > cannot find on guix.
> ...
> > I've looked upstream https://github.com/hughsie/libxmlb and it
> > says, very close to the beginning (so it's a main feature
> > apparently):
> > 
> > > $ xb-tool compile fedora.xmlb fedora.xml.gz
> > 
> > Well, for that to work, xb-tool should be in bin.
> > 
> > I'd file a bug report with libxmlb to move xb-tool to bin.
> 
> Good suggestion, we'll see where it goes!
> 
>   Please install xb-tool into bin instead of libexec
>   https://github.com/hughsie/libxmlb/issues/123
> 
> 
> In the meantime, would it be reasonable to workaround this in guix by
> patching libxmlb to include xb-tool in bin, either by moving it
> there, or symlinking it from there?
You do realize search-input-file works with libexec/ as well, right? 
Just expand the command to its store path like we do for most commands
out there.

Cheers


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to find binaries in libexec dir?
  2022-04-17 19:54     ` Liliana Marie Prikler
@ 2022-04-17 20:42       ` Vagrant Cascadian
  2022-04-19  7:17         ` Allan Adair
  0 siblings, 1 reply; 6+ messages in thread
From: Vagrant Cascadian @ 2022-04-17 20:42 UTC (permalink / raw)
  To: Liliana Marie Prikler, Danny Milosavljevic; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1896 bytes --]

On 2022-04-17, Liliana Marie Prikler wrote:
> Am Sonntag, dem 17.04.2022 um 12:27 -0700 schrieb Vagrant Cascadian:
>> On 2022-04-17, Danny Milosavljevic wrote:
>> > On Sat, 16 Apr 2022 16:21:50 -0700
>> > Vagrant Cascadian <vagrant@reproducible-builds.org> wrote:
>> > 
>> > > But libxmlb ships the xb-tool binary in libexec, which diffoscope
>> > > cannot find on guix.
>> ...
>> > I've looked upstream https://github.com/hughsie/libxmlb and it
>> > says, very close to the beginning (so it's a main feature
>> > apparently):
>> > 
>> > > $ xb-tool compile fedora.xmlb fedora.xml.gz
>> > 
>> > Well, for that to work, xb-tool should be in bin.
>> > 
>> > I'd file a bug report with libxmlb to move xb-tool to bin.
>> 
>> Good suggestion, we'll see where it goes!
>> 
>>   Please install xb-tool into bin instead of libexec
>>   https://github.com/hughsie/libxmlb/issues/123

I got a positive response almost immediately, so that sounds promising
at least!


>> In the meantime, would it be reasonable to workaround this in guix by
>> patching libxmlb to include xb-tool in bin, either by moving it
>> there, or symlinking it from there?
> You do realize search-input-file works with libexec/ as well, right? 
> Just expand the command to its store path like we do for most commands
> out there.

I thought about that, but it needs to be discovered at runtime...

It is arguably unreasonable to install *all* of diffoscope's supported
features out-of-the-box. So hard-coding a specific guix generation's
paths seems inappropriate.

I recognize that is a bit at odds with guix's functional paradigm, as
diffoscope will behave differently depending on what else is installed
in the active user or system profile... but diffoscope has support for
*many* file formats and only detects for available helper tools at
runtime.


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to find binaries in libexec dir?
  2022-04-17 20:42       ` Vagrant Cascadian
@ 2022-04-19  7:17         ` Allan Adair
  0 siblings, 0 replies; 6+ messages in thread
From: Allan Adair @ 2022-04-19  7:17 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

Hi!

I'm not sure if the following suggestion is a canonical way of doing
things (I'm a scheme newb), but it is possible to define a package variant
of diffoscope with a G-expression that uses wrap-program (see
guix/build/utils.scm) to include paths to dependencies as part of an
environment variable.

From the docstring:

"This is useful for scripts that expect particular programs to be in
$PATH, for programs that expect particular shared libraries to be in
$LD_LIBRARY_PATH, or modules in $GUILE_LOAD_PATH, etc."

As Liliana said, it is possilbe to iterate over package-inputs to compute
the paths in the package definition of a diffoscope variant. So until the
problem with xb-tool is fixed, maybe this is a good way to go?

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-20 12:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-16 23:21 How to find binaries in libexec dir? Vagrant Cascadian
2022-04-17 18:52 ` Danny Milosavljevic
2022-04-17 19:27   ` Vagrant Cascadian
2022-04-17 19:54     ` Liliana Marie Prikler
2022-04-17 20:42       ` Vagrant Cascadian
2022-04-19  7:17         ` Allan Adair

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.