Re: [gentoo-dev] netmount and glusterfs (fuse) dependency management

2024-04-10 Thread Jaco Kroon

Hi Joonas,

Thanks for the below.  Further comments there.

On 2024/04/11 07:11, Joonas Niilola wrote:


On 8.4.2024 12.51, Jaco Kroon wrote:

In order for glusterfs to mount successfully the fuse module needs to be
available when mount.glusterfs is invoked.  This can be achieved in one
of two ways:

1.  Compile the module statically into the kernel.
2.  Arrange for fuse service to be started prior to netmount (using say
/etc/conf.d/netmount rc_need="fuse")


3. Add "/sbin/modprobe -q fuse" to the init.d file's start_pre()
function, ExecStartPre with systemd, and make the ebuild warn about
CONFIG_FUSE_FS with linux-info.eclass.


The latter can certainly be done and makes sense (only required if 
you're using the fuse mount, so if USE=fuse at least).


The former doesn't make sense to do blindly in /etc/init.d/netmount 
(which belongs to sys-apps/openrc, not glusterfs).


If you look at /etc/init.d/netmount it has some special logic in 
depend() to want nfsclient if (and only if) there is at least one 
filesystem with fs type nfs or nfs4.


The logic for depending on /etc/init.d/fuse should be similar, but I 
don't think it makes sense to keep indefinitely expanding that depend() 
for every possible future filesystem that may have some special need 
like this.  So I think what we should rather do is find all fstab 
entries with _netdev and !noauto's fstype, and iterate those and add the 
relevant want's from there (for openrc at least), in some mechanisms 
where packages other than openrc can *supply* the relevant dependency 
list (eg, glusterfs package would say that it want's net, dns and fuse).


Something similar for systemd would be great, but I'd have to study up 
on systemd a bit before I can comment in greater detail.


At an absolute minimum I think we should amend netmount to add "use 
fuse" such that if fuse is added to the relevant runlevels it will start 
before netmount (and then I an arrange that  message be added to the 
glusterfs ebuild that fuse should be added to the default (where 
netmount is) runlevel).  As it is one can rc_need=fuse in 
/etc/conf.d/netmount, or rc_use=fuse and add fuse to default runlevel, 
but I believe we can do better than either of these options.


Kind regards,
Jaco




Re: [gentoo-dev] Current unavoidable use of xz utils in Gentoo

2024-04-10 Thread Joonas Niilola
On 6.4.2024 14.57, Eddie Chapman wrote:
> 
> --- /usr/portage/net-mail/dovecot/dovecot-2.3.21-r1.ebuild
> +++ /usr/local/portage/net-mail/dovecot/dovecot-2.3.21-r1.ebuild
> @@ -43,7 +43,6 @@
> 
>  DEPEND="
>     app-arch/bzip2
> -   app-arch/xz-utils
>     dev-libs/icu:=
>     dev-libs/openssl:0=
>     sys-libs/zlib:=
> @@ -126,7 +125,7 @@
>     --disable-rpath \
>     --with-bzlib \
>     --without-libbsd \
> -   --with-lzma \
> +   --without-lzma \
>     --with-icu \
>     --with-ssl \
>     --with-zlib \
> 
> --- /usr/portage/dev-lang/python/python-3.11.8_p1.ebuild
> +++ /usr/local/portage/dev-lang/python/python-3.11.8_p1.ebuild
> @@ -179,6 +179,7 @@
>     # Avoid as many dependencies as possible for the cross build.
>     cat >> Makefile <<-EOF || die
>     MODULE_NIS_STATE=disabled
> +   MODULE__LZMA_STATE=disabled
>     MODULE__DBM_STATE=disabled
>     MODULE__GDBM_STATE=disabled
>     MODULE__DBM_STATE=disabled
> @@ -328,7 +329,7 @@
>     fi
> 
>     # force-disable modules we don't want built
> -   local disable_modules=( NIS )
> +   local disable_modules=( NIS _LZMA )
>     use gdbm || disable_modules+=( _GDBM _DBM )
>     use sqlite || disable_modules+=( _SQLITE3 )
>     use ssl || disable_modules+=( _HASHLIB _SSL )
> 
> 
> --- /usr/portage/dev-lang/python/python-3.12.2_p1.ebuild
> +++ /usr/local/portage/dev-lang/python/python-3.12.2_p1.ebuild
> @@ -177,6 +177,7 @@
>     cat > Modules/Setup.local <<-EOF || die
>     *disabled*
>     nis
> +   _lzma
>     _dbm _gdbm
>     _sqlite3
>     _hashlib _ssl
> @@ -299,6 +300,7 @@
>     cat > Modules/Setup.local <<-EOF || die
>     *disabled*
>     nis
> +   _lzma
>     $(usev !gdbm '_gdbm _dbm')
>     $(usev !sqlite '_sqlite3')
>     $(usev !ssl '_hashlib _ssl')
> 
> 
> Lastly, I needed to create a custom dev-libs/libxmlb ebuild in order to
> upgrade it from 0.3.14 (latest in Gentoo at time of writing) to 0.3.15.
> 
> I also needed to apply a very recent patch from upstream, from this
> commit, which makes LZMA support optional:
> https://github.com/hughsie/libxmlb/commit/bdf845510fbed40b88465b2272ccad9e93656639
> 
> and I needed to make some small changes to the ebuild.
> 
> So this is what you need to do at the time of writing (6th April 2024):
> 
> 1. Copy the in-tree /usr/portage/dev-libs/libxmlb ebuild directory into
> your local ebuilds directory.
> 
> 2. Rename the ebuild file from libxmlb-0.3.14.ebuild to
> libxmlb-0.3.15.ebuild
> 
> 3. Download the raw patch, you can use this link:
> 
> https://github.com/hughsie/libxmlb/commit/bdf845510fbed40b88465b2272ccad9e93656639.patch
>    rename it to:
>    libxmlb-0.3.15-make_lzma_optional.patch
>    and place it in the local "files" directory.
> 
> 4. Modify the new ebuild according to the diff below. Then just rebuild it.
> 
> --- /usr/portage/dev-libs/libxmlb/libxmlb-0.3.14.ebuild
> +++ /usr/local/portage/dev-libs/libxmlb/libxmlb-0.3.15.ebuild
> @@ -14,15 +14,15 @@
>  SLOT="0/2" # libxmlb.so version
> 
>  KEYWORDS="amd64 ~arm arm64 ~loong ppc ppc64 ~riscv x86"
> -IUSE="doc introspection stemmer test +zstd"
> +IUSE="doc introspection -lzma stemmer test +zstd"
> 
>  RESTRICT="!test? ( test )"
> 
>  RDEPEND="
> -   app-arch/xz-utils
>     dev-libs/glib:2
>     sys-apps/util-linux
>     stemmer? ( dev-libs/snowball-stemmer:= )
> +   lzma? ( app-arch/xz-utils:= )
>     zstd? ( app-arch/zstd:= )
>  "
> 
> @@ -43,6 +43,7 @@
> 
>  PATCHES=(
>     "${FILESDIR}"/${PN}-0.3.12-no_installed_tests.patch
> +   "${FILESDIR}"/${PN}-0.3.15-make_lzma_optional.patch
>  )
> 
>  python_check_deps() {
> @@ -60,6 +61,7 @@
>     $(meson_use stemmer)
>     $(meson_use test tests)
>     $(meson_use zstd)
> +   $(meson_feature lzma)
>     )
>     meson_src_configure
>  }

Hey,

I'll admit I didn't read everything, but I just want to point out you
may not have to edit ebuilds at all. If xz-utils is package.provided
portage should ignore the dependency without you removing the dep from
an ebuild. Then you can utilize /etc/portage/patches to apply any
patches and finally try using EXTRA_ECONF and MYMESONARGS to override
configure options via package.env.

-- juippis


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] netmount and glusterfs (fuse) dependency management

2024-04-10 Thread Joonas Niilola
On 8.4.2024 12.51, Jaco Kroon wrote:
> 
> In order for glusterfs to mount successfully the fuse module needs to be
> available when mount.glusterfs is invoked.  This can be achieved in one
> of two ways:
> 
> 1.  Compile the module statically into the kernel.
> 2.  Arrange for fuse service to be started prior to netmount (using say
> /etc/conf.d/netmount rc_need="fuse")
> 

3. Add "/sbin/modprobe -q fuse" to the init.d file's start_pre()
function, ExecStartPre with systemd, and make the ebuild warn about
CONFIG_FUSE_FS with linux-info.eclass.

-- juippis



OpenPGP_signature.asc
Description: OpenPGP digital signature