Bug 27867

Summary: Support ostree archive format (.filez)
Product: elfutils Reporter: Abderrahim Kitouni <akitouni>
Component: debuginfodAssignee: Not yet assigned to anyone <unassigned>
Status: WAITING ---    
Severity: enhancement CC: elfutils-devel, fche
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed: 2021-05-25 00:00:00
Attachments: The example file
The decompressed file

Description Abderrahim Kitouni 2021-05-15 10:31:01 UTC
debuginfod supports a few archive formats. It would be nice to support ostree archive files too. ostree is used by a few 

They have the .filez extension and have the following format: (I don't think it is documented, but it is stable and can be seen in the code https://github.com/ostreedev/ostree/blob/main/src/libostree/ostree-core.c#L475)

4 bytes header length (big endian)
4 bytes padding
header
content (deflate compressed without the zlib header)

So one should be able to read the header length, skip the padding and header and read (and decompress) the contents.
Comment 1 Frank Ch. Eigler 2021-05-15 10:34:58 UTC
Can you link to an actual ostree archive file we can look at?

Are ostree archives usually assembled from upstream distro binaries, which could already be looked up in a corresponding debuginfod?
Comment 2 Abderrahim Kitouni 2021-05-15 17:24:04 UTC
(In reply to Frank Ch. Eigler from comment #1)
> Can you link to an actual ostree archive file we can look at?

Here is an example: debug info for epiphany

https://dl.flathub.org/repo/objects/de/0800585350a08de5c92505e84144f18dbf7f4c74687e7a02b3ff415419bf26.filez
 
> Are ostree archives usually assembled from upstream distro binaries, which
> could already be looked up in a corresponding debuginfod?

It depends, in the case of Fedora Silverblue or EndlessOS they're generated from the .rpm/.deb packages. But sometimes they're not. The main case where ostree is the original format is for flatpak apps (although there are OSes that generate ostree directly, for instance the GNOME OS testing images).
Comment 3 Abderrahim Kitouni 2021-05-15 17:24:58 UTC
Created attachment 13450 [details]
The example file
Comment 4 Abderrahim Kitouni 2021-05-15 17:25:48 UTC
Created attachment 13451 [details]
The decompressed file
Comment 5 Frank Ch. Eigler 2021-05-25 14:26:59 UTC
By the way, debuginfod's knowledge of archives is practically entirely based on that of libarchive (= bsdtar).  Have you considered reaching out upstream, to have them learn to recognize these '.filez' directly?  Then no code changes would be needed for debuginfod.

Also: where would debuginfod find dwarf/source content for files packaged in these archives?  Is there a -debuginfod.filez type of archive that's also available somewhere?