Failed to build in fedora copr build system
Describe the bug
When build in fedora copr build sytem, it will failed at chown root line in libfuse/Makefile: Permission not permitted.
To Reproduce Method 1: Build using fedora copr build system
- Add a new build
- Select
SCMat Select the source type step - Select
rpkgat How to build SRPM from the source step - Click Build button, and wait for the result
Method 2: Build in local disk using a normal user account
- make
- make install
Expected behavior Build successfully in fedora copr build system.
System information: Build in fedora copr build system.
Additional context
Comment out the chown root line in libfuse/Makefile seems works for the fedora copr build system. But if it's not acceptable, I have test a dedicated fix for fedora copr build system, which add a .copr/Makefile to tell copr build system how to build srpm.
In this .copr/Makefile, it will comment out the chown root line in libfuse/Makefile and created a patch file for it, and then created a modified mergerfs.spec, so that the srpm file will contain the patch file of libfuse/Makefile and a modified mergerfs.spec. It had been built successfully in fedora copr build system.
The tool needs to be installed as setuid root. I don't know anything about copr. How does one install an app as setuid root?
I don't know copr build system too. According to the successful build log (chown root line is commented out), it seems been built under a chroot environment of mock program. chmod u+s succeeded, but chown root will failed.
chmod u+s succeeded
install -D build/mergerfs-fusermount "/builddir/build/BUILDROOT/mergerfs-2.30.0_3_ga416682-1.fc32.x86_64/usr/bin/mergerfs-fusermount"
install -D build/mount.mergerfs "/builddir/build/BUILDROOT/mergerfs-2.30.0_3_ga416682-1.fc32.x86_64/sbin/mount.mergerfs"
chmod u+s "/builddir/build/BUILDROOT/mergerfs-2.30.0_3_ga416682-1.fc32.x86_64/usr/bin/mergerfs-fusermount"
make[1]: Leaving directory '/builddir/build/BUILD/mergerfs-2.30.0_3_ga416682/libfuse'
Makefile:178: "pandoc does not appear available: unable to build manpage"
mkdir -p "/builddir/build/BUILDROOT/mergerfs-2.30.0_3_ga416682-1.fc32.x86_64/usr/share/man/man1"
install -v -m 0644 "man/mergerfs.1" "/builddir/build/BUILDROOT/mergerfs-2.30.0_3_ga416682-1.fc32.x86_64/usr/share/man/man1/mergerfs.1"
'man/mergerfs.1' -> '/builddir/build/BUILDROOT/mergerfs-2.30.0_3_ga416682-1.fc32.x86_64/usr/share/man/man1/mergerfs.1'
chown root will failed
install -D build/mount.mergerfs "/builddir/build/BUILDROOT/mergerfs-__VERSION__-1.fc32.x86_64/sbin/mount.mergerfs"
chown root "/builddir/build/BUILDROOT/mergerfs-__VERSION__-1.fc32.x86_64/usr/bin/mergerfs-fusermount"
chown: changing ownership of '/builddir/build/BUILDROOT/mergerfs-__VERSION__-1.fc32.x86_64/usr/bin> /mergerfs-fusermount': Operation not permitted
make[1]: Leaving directory '/builddir/build/BUILD/mergerfs-__VERSION__/libfuse'
make[1]: *** [Makefile:110: install-utils] Error 1
make: *** [Makefile:153: install-mount-tools] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.8URzkw (%install)
If comment out the chown root line in libfuse/Makefile is not acceptable, can I send a pull request which add a .copr/Makefile file to make it work in copr build system?
No. Nothing changes until the failure reason is understood. The program must be owned by root. You can't just remove that as it will break regular installs.