nfs-ganesha icon indicating copy to clipboard operation
nfs-ganesha copied to clipboard

rpmbuild failed for nfs-ganesha-4-rc6

Open XiJinyu opened this issue 3 years ago • 5 comments

Hi @dang , when I complied NFS-Ganesha rpm, I found that it always failed. As follows:

Could NOT find Python (missing: Python_LIBRARIES Python_INCLUDE_DIRS Development) (found version "2.7.5")
......
Processing files: nfs-ganesha-utils-4-rc6.el7.centos.x86_64
error: File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/lib/python2.7/site-packages/Ganesha/*
error: File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/lib/python2.7/site-packages/ganeshactl-*-info
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganesha-admin
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/manage_clients
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/manage_exports
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/manage_logger
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganeshactl
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/client_stats_9pOps
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/export_stats_9pOps
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/fake_recall
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/get_clientids
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/grace_period
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganesha_stats
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganesha_mgr
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganesha_conf


RPM build errors:
    File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/lib/python2.7/site-packages/Ganesha/*
    File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/lib/python2.7/site-packages/ganeshactl-*-info
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganesha-admin
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/manage_clients
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/manage_exports
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/manage_logger
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganeshactl
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/client_stats_9pOps
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/export_stats_9pOps
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/fake_recall
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/get_clientids
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/grace_period
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganesha_stats
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc6.el7.centos.x86_64/usr/bin/ganesha_mgr

I found that this problem occurred after "CMAKE - stop using deperecated python detection". What are the rpmbuild compliation method after stoping use deperecated python detection?

  OS : CentOS7
  CMAKE : cmake3-3.17.3-3.el7.x86_64
  Python : python36-3.6.8-2
-   git clone https://github.com/nfs-ganesha/nfs-ganesha.git
-   cd nfs-ganesha;
-   git submodule update --init --recursive
-   mkdir build; cd build; cmake3 ../src; cd ..
-   mkdir nfs-ganesha-4-rc6; cp -r src/* nfs-ganesha-4-rc6
-   tar -zcvf /root/rpmbuild/SOURCES/nfs-ganesha-4-rc6.tar.gz nfs-ganesha-4-rc6/
-   cd nfs-ganesha-4-rc6/
-   rpmbuild -bb nfs-ganesha.spec --with utils

XiJinyu avatar Dec 17 '21 03:12 XiJinyu

It works for me with cmake 3.16.4 and python 3.7.6. However, your rpmbuild is trying to use python 2 for some reason. Which version of python was detected when you used cmake? My guess is that it detected python3, and then rpmbuild tried to use python 2 (for some reason) and that is the problem.

Can you try running "make rpm" in your initial build directory?

dang avatar Dec 17 '21 14:12 dang

It works for me with cmake 3.16.4 and python 3.7.6. However, your rpmbuild is trying to use python 2 for some reason. Which version of python was detected when you used cmake? My guess is that it detected python3, and then rpmbuild tried to use python 2 (for some reason) and that is the problem.

Can you try running "make rpm" in your initial build directory?

Unfortunately, this problem still exists on my machine. According to your suggestion, I made the following attempts: First, I upgraded cmake and python(cmake 3.16.4 and python3.7.6). The following methods can be used to compile successfully,but but the nfs-ganesha-utils package is missing.

git clone https://github.com/nfs-ganesha/nfs-ganesha.git
cd nfs-ganesha
git submodule update --init --recursive
mkdir build; cd build 
cmake3 ../src
make rpm
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64
Wrote: /root/rpmbuild/SRPMS/nfs-ganesha-4-rc7.el7.centos.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-mount-9P-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-vfs-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-proxy-v4-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-proxy-v3-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-nullfs-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-mem-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-gpfs-4-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/libntirpc-4.0-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/libntirpc-devel-4.0-rc7.el7.centos.x86_64.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/nfs-ganesha-debuginfo-4-rc7.el7.centos.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.h5Fbps
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd nfs-ganesha-4-rc7
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64
+ exit 0
Built target rpm

Then I added DUSE_ADMIN_TOOLS options:

cmake3 ../src -DUSE_ADMIN_TOOLS=ON
make rpm

The following problems occurred after compilation:

Processing files: nfs-ganesha-utils-4-rc7.el7.centos.x86_64
error: File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/lib/python2.7/site-packages/Ganesha/*
error: File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/lib/python2.7/site-packages/ganeshactl-*-info
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/fake_recall
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/get_clientids
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/grace_period
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/ganesha_stats
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/ganesha_mgr
error: File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/ganesha_conf

RPM build errors:
    File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/lib/python2.7/site-packages/Ganesha/*
    File not found by glob: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/lib/python2.7/site-packages/ganeshactl-*-info
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/fake_recall
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/get_clientids
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/grace_period
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/ganesha_stats
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/ganesha_mgr
    File not found: /root/rpmbuild/BUILDROOT/nfs-ganesha-4-rc7.el7.centos.x86_64/usr/bin/ganesha_conf
make[3]: *** [rpm] Error 1
make[2]: *** [CMakeFiles/rpm.dir/all] Error 2
make[1]: *** [CMakeFiles/rpm.dir/rule] Error 2
make: *** [rpm] Error 2

In src/CMakeLists.txt: find_package (Python COMPONENTS Interpreter Development) Display after compilation: Could NOT find Python (missing: Python_LIBRARIES Python_INCLUDE_DIRS Development) (found version "2.7.5") find_package (Python3 COMPONENTS Interpreter Development) Display after compilation: Could NOT find Python3 (missing: Python3_LIBRARIES Python3_INCLUDE_DIRS Development) (found version "3.7.6")

XiJinyu avatar Dec 20 '21 08:12 XiJinyu

RHEL7/Centos7 have Python2, not Python3; and QT4, not QT5. In theory you might be able to get Python3 from EPEL or the RHEL or CentOS Software Collections Library (SCL) or Code Ready Builder (CRB) repos and use that. To build ganesha-3.x for el7 have to patch some of the files for QT4, and the .spec I use is (very) slightly different than what's in the tree. I haven't even tried to ganesha-4 on el7 yet (and I'm not sure I was planning to either :-)) You can see the patch and the .spec file that I use for ganesha-3 at https://git.centos.org/rpms/nfs-ganesha/tree/c7-sig-storage-nfs-ganesha-3

kalebskeithley avatar Dec 20 '21 12:12 kalebskeithley

try these two patches on el7: https://git.centos.org/rpms/nfs-ganesha/blob/c7-sig-storage-nfs-ganesha-4/f/SOURCES/0001.python.patch https://git.centos.org/rpms/nfs-ganesha/blob/c7-sig-storage-nfs-ganesha-4/f/SOURCES/0002-src-CMakeLists.txt.patch

or on el8 and el9: https://git.centos.org/rpms/nfs-ganesha/blob/c9s-sig-storage-nfs-ganesha-4/f/SOURCES/0002-CMakeLists.txt.patch

kalebskeithley avatar Dec 22 '21 19:12 kalebskeithley

To compile nfs-ganesha-4.0.8 for the official Debian package, I need to use the CMakeLists.txt patches for el8/el9 .

christmart avatar Sep 09 '22 12:09 christmart

Looks like there was a resolution here. Closing.

ffilz avatar Jan 24 '23 19:01 ffilz