All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Linxuan <me@black-desk.cn>
To: Gao Xiang <hsiangkao@linux.alibaba.com>, linux-erofs@lists.ozlabs.org
Subject: Re: [PATCH] build: support building static library
Date: Thu, 6 Jun 2024 10:25:03 +0800	[thread overview]
Message-ID: <04076ce5-ea41-498f-b053-e51f00cf26e1@black-desk.cn> (raw)
In-Reply-To: <b11a08dd-cb27-4352-b031-2d0ab7b04fe8@linux.alibaba.com>

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.

Thanks,
Chen Linxuan

> 
> Thanks,
> Gao Xiang
> 
> 
>> We just want to do the same thing appimage guys do to squashfs.
>>
>>>> exposes some useful functions, Appimage uses this static library to 
>>>> build
>>>> image. It could ensure that the executable image can be executed 
>>>> directly
>>>> on most linux platforms and the user doesn't need to install squashfuse
>>>> in order to execute the image.
>>>>
>>>> Signed-off-by: ComixHe <heyuming@deepin.org>
>>>> ---
>>>>   configure.ac     | 28 ++++++++++++++++++++++++++++
>>>>   dump/Makefile.am | 10 ++++++++++
>>>>   fsck/Makefile.am | 10 ++++++++++
>>>>   fuse/Makefile.am | 10 ++++++++++
>>>>   mkfs/Makefile.am | 10 ++++++++++
>>>>   5 files changed, 68 insertions(+)
>>>>
>>>> diff --git a/configure.ac b/configure.ac
>>>> index 1989bca..16ddb7c 100644
>>>> --- a/configure.ac
>>>> +++ b/configure.ac
>>>> @@ -147,6 +147,30 @@ AC_ARG_ENABLE(fuse,
>>>>      [AS_HELP_STRING([--enable-fuse], [enable erofsfuse 
>>>> @<:@default=no@:>@])],
>>>>      [enable_fuse="$enableval"], [enable_fuse="no"])
>>>> +AC_ARG_ENABLE([static-fuse],
>>>> +    [AS_HELP_STRING([--enable-static-fuse],
>>>> +                    [build erofsfuse as a static library 
>>>> @<:@default=no@:>@])],
>>>> +    [enable_static_fuse="$enableval"],
>>>> +    [enable_static_fuse="no"])
>>>> +
>>>> +AC_ARG_ENABLE([static-dump],
>>>> +    [AS_HELP_STRING([--enable-static-dump],
>>>> +                    [build dump.erofs as a static library 
>>>> @<:@default=no@:>@])],
>>>> +    [enable_static_dump="$enableval"],
>>>> +    [enable_static_dump="no"])
>>>> +
>>>> +AC_ARG_ENABLE([static-mkfs],
>>>> +    [AS_HELP_STRING([--enable-static-mkfs],
>>>> +                    [build mkfs.erofs as a static library 
>>>> @<:@default=no@:>@])],
>>>> +    [enable_static_mkfs="$enableval"],
>>>> +    [enable_static_mkfs="no"])
>>>> +
>>>> +AC_ARG_ENABLE([static-fsck],
>>>> +    [AS_HELP_STRING([--enable-static-fsck],
>>>> +                    [build fsck.erofs as a static library 
>>>> @<:@default=no@:>@])],
>>>> +    [enable_static_fsck="$enableval"],
>>>> +    [enable_static_fsck="no"])
>>>
>>> But how could we support static libraries from binaries?
>>>
>>> I guess you need static liberofs instead?
>>>
>>> Thanks,
>>> Gao Xiang
>>>
> 


  reply	other threads:[~2024-06-06  2:25 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 [this message]
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
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=04076ce5-ea41-498f-b053-e51f00cf26e1@black-desk.cn \
    --to=me@black-desk.cn \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    /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.