From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Chen Linxuan <me@black-desk.cn>, linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH] build: support building static library
Date: Thu, 6 Jun 2024 11:22:15 +0800 [thread overview]
Message-ID: <b4be780e-6c48-4ca9-a9ec-075b12479fcf@linux.alibaba.com> (raw)
In-Reply-To: <714a2ab0-331d-41ce-8056-d4f70a8f8272@black-desk.cn>
On 2024/6/6 11:17, Chen Linxuan wrote:
> On 2024/6/6 11:13, Gao Xiang wrote:
>>
>>
>> On 2024/6/6 11:06, Chen Linxuan wrote:
>>> On 2024/6/6 10:45, Gao Xiang wrote:
>>>>
>>>>
>>>> On 2024/6/6 10:25, Chen Linxuan wrote:
>>>>> Hi,
>>>>>
>>>>> On 2024/6/6 10:22, Gao Xiang wrote:
>>>>>> Hi,
>>>>>>
>>>>>> On 2024/6/6 10:13, Chen Linxuan wrote:
>>>>>>> Hi Xiang!
>>>>>>>
>>>>>>> On 2024/5/23 16:05, Gao Xiang wrote:
>>>>>>>> Hi Comix!
>>>>>>>>
>>>>>>>> On 2024/5/23 15:31, ComixHe wrote:
>>>>>>>>> In some cases, developer may need to integrate erofs-utils into their
>>>>>>>>> proejct as a static library to reduce package dependencies and
>>>>>>>>> have more finer control over the feature used by the project.
>>>>>>>>
>>>>>>>> Thanks for sharing this.
>>>>>>>>
>>>>>>>>>
>>>>>>>>> For exapmle, squashfuse provides a static library `libsquashfuse.a` and
>>>>>>>
>>>>>>> We want a static library for running fuse-erofs, maybe liberofsfuse or something like that, to make a appimage like bundle with erofs.
>>>>>>>
>>>>>>> For quite a long time, Appimage guys patch the fuse program of squashfs to get such a static library, and this patch is accepted by Debian.
>>>>>>>
>>>>>>> https://github.com/AppImageCommunity/libappimage/blob/master/src/patches/squashfuse.patch
>>>>>>>
>>>>>>> https://salsa.debian.org/sgmoore/squashfuse/-/commit/489b04eb7f5e45478f2ba5cd8d7173bb96
>>>>>>>
>>>>>>> The patch just make a binary to be a static library by changing `main` to `fusefs_main`.
>>>>>>>
>>>>>>
>>>>>> Since squashfs don't have any offical libsquashfs, so I guess they tried
>>>>>> export the squashfuse project as a library.
>>>>>>
>>>>>> But erofs-utils is quite another story since we already have an offical
>>>>>> `liberofs` concept. If you'd like to export some FUSE interface, would
>>>>>> you mind moving some logic in fuse/ to lib/? Does this way also work
>>>>>> for you?
>>>>>
>>>>> Sure.
>>>>>
>>>>> We will send other patches later.
>>>>
>>>> Err, sorry, a second thought.. If you just would like
>>>> to move all code from fuse/main.c to lib/, I also think
>>>> it's somewhat strange.
>>>>
>>>> So just address your requirement (erofsfuse_main), would
>>>> you mind just export liberofsfuse static library instead?
>>>> Since it's a bit tangled with libfuse version, so I'm now
>>>> hesitated to move into lib/...
>>>
>>> So you mean that I should export a static library call "liberofsfuse".
>>> And the only function it has is erofsfuse_main. Am I right?
>>
>> You could export any function in the fuse/main.c, also you
>> could rename main() as erofsfuse_main() for the liberofsfuse
>> library.
>>
>>>
>>> But where should I place the source code of this new library? "liberofsfuse/", "lib/fuse" or somewhere else?
>>
>> Just like the current patch, fuse/main.c is okay for me (since
>
> Maybe you want to check the original patch again?
>
> We build liberofsfuse with -Dmain=erofsfuse_main at that patch, which sounds like what you suggest here.
That is also fine with me, anyway, liberofsfuse is a very special
case for us, I'd like to just build a static library for
erofsfuse only (because liberofs will be exported as a dynamic
library in later versions, I don't want to rely on random libfuse
interface).
For other usage, I'd suggest form some formal APIs in liberofs
instead.
Thanks,
Gao Xiang
>
> Thanks,
> Chen Linxuan
>
>> it's tangled with libfuse internals), but I guess we'd better
>> to avoid self-contained libmkerofs and more. `liberofs` is
>> much better to be directy used for mkfs, fsck usage.
>>
>> Thanks,
>> Gao Xiang
>>
>>
>>>
>>> Thanks,
>>> Chen Linxuan
>>>
>>>>
>>>> For mkfs, I guess we will have offical API interfaces for
>>>> users to build images later, so libmkerofs is not worthwhile.
>>>>
>>>> I'm not sure dump.erofs is useful too since low-level APIs
>>>> are provided. As for fsck, it's similar to mkfs in the future.
>>>>
>>>>
>>>> Thanks,
>>>> Gao Xiang
>>>>
>>>>>
>>>>> Thanks,
>>>>> Chen Linxuan
>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Gao Xiang
>>>>>>
>>>>>>
>>
next prev parent reply other threads:[~2024-06-06 3:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-23 7:31 [PATCH] build: support building static library ComixHe
2024-05-23 8:05 ` Gao Xiang
2024-06-06 2:13 ` Chen Linxuan
2024-06-06 2:22 ` Gao Xiang
2024-06-06 2:25 ` Chen Linxuan
2024-06-06 2:45 ` Gao Xiang
2024-06-06 3:06 ` Chen Linxuan
2024-06-06 3:13 ` Gao Xiang
2024-06-06 3:17 ` Chen Linxuan
2024-06-06 3:22 ` Gao Xiang [this message]
2024-06-06 4:18 ` [PATCH] build: support building static library liberofsfuse ComixHe
2024-06-06 6:31 ` Gao Xiang
2024-06-06 7:39 ` [PATCH v2] " ComixHe
2024-06-06 7:53 ` Gao Xiang
2024-06-11 9:23 ` Gao Xiang
-- strict thread matches above, loose matches on Subject: below --
2024-06-06 4:55 [PATCH] build: support building static library ComixHe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4be780e-6c48-4ca9-a9ec-075b12479fcf@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=me@black-desk.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.