Skip to content

Commit

Permalink
DAOS-15136 client: Switch to using libfused
Browse files Browse the repository at this point in the history
Switch to using libfused instead of libfuse3

PR-repos: fused@PR-1:28

Required-githooks: true

Change-Id: I382b96a17a8d503d6cf7321b57050e7ab0c187d4
Signed-off-by: Jeff Olivier <jeffolivier@google.com>
  • Loading branch information
jolivier23 committed Mar 28, 2024
1 parent 6c59aa0 commit 2c75fc4
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 47 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
daos (2.5.101-3) unstable; urgency=medium
[ Jeff Olivier ]
* Switch from libfuse3 to libfused

-- Jeff Olivier <jeffolivier@google.com> 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
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
14 changes: 13 additions & 1 deletion site_scons/components/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions site_scons/prereq_tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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']

Expand Down
30 changes: 4 additions & 26 deletions src/client/dfuse/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fuse3/fuse_lowlevel.h>
src = """#include <fused/fuse_lowlevel.h>
extern void
my_ioctl (fuse_req_t req, fuse_ino_t ino, %s cmd,
Expand Down Expand Up @@ -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"""

Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include <semaphore.h>

#include <fuse3/fuse.h>
#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse.h>
#include <fused/fuse_lowlevel.h>

#include <gurt/list.h>
#include <gurt/hash.h>
Expand Down
2 changes: 1 addition & 1 deletion src/client/dfuse/dfuse_fuseops.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/

#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse_lowlevel.h>

#include "dfuse_common.h"
#include "dfuse.h"
Expand Down
4 changes: 2 additions & 2 deletions src/client/dfuse/dfuse_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <getopt.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <fuse3/fuse.h>
#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse.h>
#include <fused/fuse_lowlevel.h>
#include <string.h>

#include <sys/types.h>
Expand Down
2 changes: 1 addition & 1 deletion src/client/dfuse/dfuse_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <pthread.h>

#include <fuse3/fuse_lowlevel.h>
#include <fused/fuse_lowlevel.h>
#define D_LOGFAC DD_FAC(dfuse)
#include "dfuse.h"

Expand Down
3 changes: 1 addition & 2 deletions utils/build.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
17 changes: 8 additions & 9 deletions utils/rpms/daos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 <jeffolivier@google.com> 2.5.101-3
- Switch libfuse3 to libfused

* Mon Mar 18 2024 Jan Michalski <jan.michalski@intel.com> 2.5.101-2
- Add dtx_tests to the server-tests package

Expand Down

0 comments on commit 2c75fc4

Please sign in to comment.