Re: Local Build ID Directory Lookup (DEBUGINFOD_LOCAL_PATH)

2023-06-01 Thread Frank Ch. Eigler via Elfutils-devel
Hi -

> So I guess, sans the format, the feature request would just be that
> it would have a shortcut for file URLs to produce the path directly
> in response to e.g. a debuginfod_find_debuginfo, rather than making
> a copy of the file via libcurl.

A compromise solution could be for new code to produce a symlink in
the .cache/debuginfod_client directory that points to the matching
file:// bit, and return that symlink name/fd to the calling app.

At future accesses, the client can determine if the symlink is
broken and reject/unlink it.

- FChE



Re: Local Build ID Directory Lookup (DEBUGINFOD_LOCAL_PATH)

2023-06-01 Thread Daniel Thornburgh via Elfutils-devel
Hmm, how would the effective behavior of this differ from directly
returning the path? The symlink could become invalid at any time, and it
would become invalid in precisely the same scenarios that the original file
would. A further request would in both cases stat the original file, and if
it were missing, download a new copy into the cache via the usual
mechanisms.

It would make sense if the cache were made to contain a hard link to the
file if it were on the same filesystem as the cache, but that inherits the
usual problems with hard links. It would persist a copy of the file in the
cache though.

On Thu, Jun 1, 2023 at 7:58 AM Frank Ch. Eigler  wrote:

> Hi -
>
> > So I guess, sans the format, the feature request would just be that
> > it would have a shortcut for file URLs to produce the path directly
> > in response to e.g. a debuginfod_find_debuginfo, rather than making
> > a copy of the file via libcurl.
>
> A compromise solution could be for new code to produce a symlink in
> the .cache/debuginfod_client directory that points to the matching
> file:// bit, and return that symlink name/fd to the calling app.
>
> At future accesses, the client can determine if the symlink is
> broken and reject/unlink it.
>
> - FChE
>
>

-- 

Daniel Thornburgh | dth...@google.com


Re: Local Build ID Directory Lookup (DEBUGINFOD_LOCAL_PATH)

2023-06-01 Thread Frank Ch. Eigler via Elfutils-devel
Hi -

> Hmm, how would the effective behavior of this differ from directly
> returning the path? The symlink could become invalid at any time [...]

Effective behaviour is about the same, but code logic and explanation
is simpler.

> It would make sense if the cache were made to contain a hard link to the
> file if it were on the same filesystem as the cache [...]

And this could be a QoI implementation detail: prefer hardlink, fall
back to symlink.

- FChE



Re: Local Build ID Directory Lookup (DEBUGINFOD_LOCAL_PATH)

2023-06-01 Thread Daniel Thornburgh via Elfutils-devel
SGTM; I'll see if I can write a patch to do this when I get some spare
cycles.

On Thu, Jun 1, 2023 at 2:21 PM Frank Ch. Eigler  wrote:

> Hi -
>
> > Hmm, how would the effective behavior of this differ from directly
> > returning the path? The symlink could become invalid at any time [...]
>
> Effective behaviour is about the same, but code logic and explanation
> is simpler.
>
> > It would make sense if the cache were made to contain a hard link to the
> > file if it were on the same filesystem as the cache [...]
>
> And this could be a QoI implementation detail: prefer hardlink, fall
> back to symlink.
>
> - FChE
>
>

-- 

Daniel Thornburgh | dth...@google.com