Bug 27867 - Support ostree archive format (.filez)
Summary: Support ostree archive format (.filez)
Status: WAITING
Alias: None
Product: elfutils
Classification: Unclassified
Component: debuginfod (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-15 10:31 UTC by Abderrahim Kitouni
Modified: 2021-05-25 14:26 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2021-05-25 00:00:00


Attachments
The example file (19.61 KB, application/octet-stream)
2021-05-15 17:24 UTC, Abderrahim Kitouni
Details
The decompressed file (20.01 KB, application/x-sharedlib)
2021-05-15 17:25 UTC, Abderrahim Kitouni
Details

Note You need to log in before you can comment on or make changes to this bug.
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?