From 2c75fc415ec0069861cc778cf32460d6a9172bb1 Mon Sep 17 00:00:00 2001 From: Jeff Olivier Date: Wed, 27 Mar 2024 11:52:58 -0600 Subject: [PATCH] DAOS-15136 client: Switch to using libfused Switch to using libfused instead of libfuse3 PR-repos: fused@PR-1:28 Required-githooks: true Change-Id: I382b96a17a8d503d6cf7321b57050e7ab0c187d4 Signed-off-by: Jeff Olivier --- debian/changelog | 6 ++++++ debian/control | 2 +- site_scons/components/__init__.py | 14 +++++++++++++- site_scons/prereq_tools/base.py | 3 +-- src/client/dfuse/SConscript | 30 ++++-------------------------- src/client/dfuse/dfuse.h | 4 ++-- src/client/dfuse/dfuse_fuseops.c | 2 +- src/client/dfuse/dfuse_main.c | 4 ++-- src/client/dfuse/dfuse_thread.c | 2 +- utils/build.config | 3 +-- utils/rpms/daos.spec | 17 ++++++++--------- 11 files changed, 40 insertions(+), 47 deletions(-) diff --git a/debian/changelog b/debian/changelog index 71b8feb50a81..bcffd016ab10 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +daos (2.5.101-3) unstable; urgency=medium + [ Jeff Olivier ] + * Switch from libfuse3 to libfused + + -- Jeff Olivier Wed, 27 Mar 2024 21:30:00 +0000 + daos (2.5.101-2) unstable; urgency=medium [ Jan Michalski ] * Add dtx_tests to the server-tests package diff --git a/debian/control b/debian/control index 921880c051ce..61ff273f9c05 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Build-Depends: debhelper (>= 10), libabt-dev, libucx-dev, libpmemobj-dev (>= 2.0.0), - libfuse3-dev, + libfused-dev, libprotobuf-c-dev, libjson-c-dev, dpdk-dev (>= 21.11.2), diff --git a/site_scons/components/__init__.py b/site_scons/components/__init__.py index b96a7ffc9733..beec0b46e9f9 100644 --- a/site_scons/components/__init__.py +++ b/site_scons/components/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2016-2023 Intel Corporation +# Copyright 2016-2024 Intel Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -308,6 +308,18 @@ def define_components(reqs): required_progs=['libtoolize', 'ninja', 'meson'], out_of_src_build=True) + reqs.define('fused', libs=['fused'], defines=['FUSE_USE_VERSION=35'], + retriever=GitRepoRetriever('https://github.com/daos-stack/fused.git'), + commands=[['find', '../fused', '-type', 'f', '-name', '*', '-exec', 'sed', '-i', + 's/fuse3/fused/g', '{}', ';'], + ['meson', 'setup', '--prefix=$FUSED_PREFIX', '-Ddisable-mtab=True', + '-Dudevrulesdir=$FUSED_PREFIX/udev', '-Dutils=False', + '--default-library', 'shared', '../fused'], + ['ninja', 'install']], + headers=['fused/fuse.h'], + required_progs=['libtoolize', 'ninja', 'meson'], + out_of_src_build=True) + # Tell SPDK which CPU to optimize for, by default this is native which works well unless you # are relocating binaries across systems, for example in CI under GitHub actions etc. There # isn't a minimum value needed here, but getting this wrong will cause daos server to exit diff --git a/site_scons/prereq_tools/base.py b/site_scons/prereq_tools/base.py index efd2fd3f9a4e..67ee2d5a1c12 100644 --- a/site_scons/prereq_tools/base.py +++ b/site_scons/prereq_tools/base.py @@ -444,7 +444,6 @@ def __init__(self, env, opts): opts.Add(('MPI_PKG', 'Specifies name of pkg-config to load for MPI', None)) opts.Add(BoolVariable('FIRMWARE_MGMT', 'Build in device firmware management.', False)) opts.Add(BoolVariable('STACK_MMAP', 'Allocate ABT ULTs stacks with mmap()', False)) - opts.Add(BoolVariable('STATIC_FUSE', "Build with static libfuse library", False)) opts.Add(EnumVariable('BUILD_TYPE', "Set the build type", 'release', ['dev', 'debug', 'release'], ignorecase=1)) opts.Add(EnumVariable('TARGET_TYPE', "Set the prerequisite type", 'default', @@ -521,7 +520,7 @@ def run_build(self, opts): # argobots is not really needed by client but it's difficult to separate common_reqs = ['ucx', 'ofi', 'hwloc', 'mercury', 'boost', 'uuid', 'crypto', 'protobufc', 'lz4', 'isal', 'isal_crypto'] - client_reqs = ['fuse', 'json-c', 'capstone'] + client_reqs = ['fused', 'json-c', 'capstone'] server_reqs = ['argobots', 'pmdk', 'spdk', 'ipmctl'] test_reqs = ['cmocka'] diff --git a/src/client/dfuse/SConscript b/src/client/dfuse/SConscript index 4b35bb3460de..419a0c77bc6a 100644 --- a/src/client/dfuse/SConscript +++ b/src/client/dfuse/SConscript @@ -140,7 +140,7 @@ def check_ioctl_def(context, ctype): context.Message(f'Checking if fuse ioctl is type {ctype} ') # pylint: disable-next=consider-using-f-string - src = """#include + src = """#include extern void my_ioctl (fuse_req_t req, fuse_ino_t ino, %s cmd, @@ -175,22 +175,6 @@ def configure_fuse(cenv): check.Finish() -def find_static_fuse(cenv): - """Find and copy static fuse library""" - - fuse_prefix = '/usr' - if os.path.exists(cenv.subst('$FUSE_PREFIX')): - fuse_prefix = cenv.subst('$FUSE_PREFIX') - - for path in ['lib64', 'lib/x86_64-linux-gnu', 'lib']: - fuselib = os.path.join(fuse_prefix, path, "libfuse3.a") - if os.path.exists(fuselib): - return [File(fuselib)] - - print("Could not find libfuse3.a") - return [] - - def scons(): """Scons function""" @@ -229,14 +213,8 @@ def scons(): cenv.AppendUnique(LIBS=['dfs', 'duns']) cenv.require('hwloc') - if cenv.get('STATIC_FUSE'): - cenv.require('fuse', headers_only=True) - static_fuse = find_static_fuse(cenv) - extra_libs = ['dl'] - else: - cenv.require('fuse') - static_fuse = [] - extra_libs = ['dl'] + cenv.require('fused') + extra_libs = ['dl'] configure_fuse(cenv) @@ -246,7 +224,7 @@ def scons(): for src in OPS_SRC: dfuse_obj += cenv.Object(os.path.join('ops', f'{src}.c')) cenv.AppendUnique(LIBS=['gurt'] + extra_libs) - dfuse_bin = cenv.d_program('dfuse/dfuse', common + dfuse_obj + static_fuse) + dfuse_bin = cenv.d_program('dfuse/dfuse', common + dfuse_obj) Default(dfuse_bin) diff --git a/src/client/dfuse/dfuse.h b/src/client/dfuse/dfuse.h index 350323dbecb3..2fe14f26d226 100644 --- a/src/client/dfuse/dfuse.h +++ b/src/client/dfuse/dfuse.h @@ -9,8 +9,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/src/client/dfuse/dfuse_fuseops.c b/src/client/dfuse/dfuse_fuseops.c index dcf7fadfa855..c115d6c69b29 100644 --- a/src/client/dfuse/dfuse_fuseops.c +++ b/src/client/dfuse/dfuse_fuseops.c @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause-Patent */ -#include +#include #include "dfuse_common.h" #include "dfuse.h" diff --git a/src/client/dfuse/dfuse_main.c b/src/client/dfuse/dfuse_main.c index a8b5b0e45ef5..d697bb589097 100644 --- a/src/client/dfuse/dfuse_main.c +++ b/src/client/dfuse/dfuse_main.c @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/src/client/dfuse/dfuse_thread.c b/src/client/dfuse/dfuse_thread.c index d4036a32c587..e38853634003 100644 --- a/src/client/dfuse/dfuse_thread.c +++ b/src/client/dfuse/dfuse_thread.c @@ -6,7 +6,7 @@ #include -#include +#include #define D_LOGFAC DD_FAC(dfuse) #include "dfuse.h" diff --git a/utils/build.config b/utils/build.config index ba1a33793a3b..a2ba8ea21e69 100644 --- a/utils/build.config +++ b/utils/build.config @@ -3,7 +3,7 @@ component=daos [commit_versions] ARGOBOTS = v1.1 -FUSE = fuse-3.16.2 +FUSED = master PMDK = 2.0.0 ISAL = v2.30.0 ISAL_CRYPTO = v2.23.0 @@ -17,4 +17,3 @@ UCX=v1.14.1 spdk=https://github.com/spdk/spdk/commit/b0aba3fcd5aceceea530a702922153bc75664978.diff,https://github.com/spdk/spdk/commit/445a4c808badbad3942696ecf16fa60e8129a747.diff ofi=https://github.com/ofiwg/libfabric/commit/d827c6484cc5bf67dfbe395890e258860c3f0979.diff mercury=https://raw.githubusercontent.com/daos-stack/mercury/857f1d5d2ca72d4c1b8d7be5e7fd26d6292b495f/na_ucx_am_send_retry.patch -fuse=https://github.com/libfuse/libfuse/commit/c9905341ea34ff9acbc11b3c53ba8bcea35eeed8.diff diff --git a/utils/rpms/daos.spec b/utils/rpms/daos.spec index 16ac6ba93753..eb90ccc25386 100644 --- a/utils/rpms/daos.spec +++ b/utils/rpms/daos.spec @@ -15,7 +15,7 @@ Name: daos Version: 2.5.101 -Release: 2%{?relval}%{?dist} +Release: 3%{?relval}%{?dist} Summary: DAOS Storage Engine License: BSD-2-Clause-Patent @@ -51,9 +51,9 @@ BuildRequires: boost-devel %endif BuildRequires: libpmemobj-devel >= 2.0.0 %if (0%{?rhel} >= 8) -BuildRequires: fuse3-devel >= 3 +BuildRequires: fused-devel >= 1 %else -BuildRequires: fuse3-devel >= 3.4.2 +BuildRequires: fused-devel >= 1 %endif %if (0%{?suse_version} >= 1500) BuildRequires: go-race @@ -175,7 +175,7 @@ Requires: mercury >= %{mercury_version} Requires: libfabric >= %{libfabric_version} %if (0%{?suse_version} >= 1500) Requires: libfabric1 >= %{libfabric_version} -Requires: libfuse3-3 >= 3.4.2 +Requires: fused >= 1 %endif Requires: /usr/bin/fusermount3 %{?systemd_requires} @@ -225,11 +225,7 @@ Requires: libcapstone-devel Requires: Lmod Requires: capstone-devel %endif -%if (0%{?rhel} >= 8) -Requires: fuse3-devel >= 3 -%else -Requires: fuse3-devel >= 3.4.2 -%endif +Requires: fused >= 1 %description client-tests This is the package needed to run the DAOS test suite (client tests) @@ -587,6 +583,9 @@ getent passwd daos_agent >/dev/null || useradd -s /sbin/nologin -r -g daos_agent # No files in a shim package %changelog +* Wed Mar 27 2024 Jeff Olivier 2.5.101-3 +- Switch libfuse3 to libfused + * Mon Mar 18 2024 Jan Michalski 2.5.101-2 - Add dtx_tests to the server-tests package