Installation issue with spack related to expat/libbsd

I’m trying to install fenicsx on an HPC using spack
I followed the github instructions for spack.

module load gcc/13.1.0
module list  # => verif gcc ok

cd /home/$USER/git
git clone https://github.com/spack/spack.git
. ./spack/share/spack/setup-env.sh

spack env create fenicsxenv
spack env activate fenicsxenv

spack add fenics-dolfinx+adios2 py-fenics-dolfinx cflags=-O3 fflags=-O3

spack concretize --force
cat ./spack/var/spack/environments/fenicsxenv/spack.yaml  # verif compilers ok

spack install

Wich always results as

==> Error: ProcessError: Command exited with status 1:
    '/tmp/spack-stage/spack-stage-expat-2.6.2-6zcxdsvhtdoowjfljdznplbzn5omvqzz/spack-src/configure' '--prefix=/home/$USER/git/spack/opt/spack/linux-rhel8-zen4/gcc-13.1.0/expat-2.6.2-6zcxdsvhtdoowjfljdznplbzn5omvqzz' '--without-docbook' '--enable-static' '--with-libbsd'

1 error found in build log:
     127    checking whether byte ordering is bigendian... no
     128    checking for an ANSI C-conforming const... yes
     129    checking for size_t... yes
     130    checking whether /home/$USER/git/spack/lib/spack/env/gcc/g++ supports C++11 features with -std=c++11... yes
     131    checking for cos in -lm... yes
     132    checking for arc4random_buf in -lbsd... no
  >> 133    **configure: error: Enforced use of libbsd cannot be satisfied**.

If someone could help,

Thanks in advance.

The last post in Build error "Enforced use of libbsd cannot be satisfied" · Issue #735 · libexpat/libexpat · GitHub may be helpful.

Thank you for your reply !

I followed your link up to this one

Which solved the issue (removing libbsd.so in the spack directories and linking libbsd.so toward libbsd.so.X.Y.Z instead)