Description of problem: Please add BuildRequires: util-linux to the spec file, since the test suite fails if this is not installed, AND ensure that /usr/sbin is in $PATH for the build - When I built with no /usr/sbin in my $PATH, as a non-root user normally would , the build fails, with end-of-log : "... All done. + grep -v -e sector-size -e '^$' + sfdisk -d /tmp/test-repart.vpxHpruSQk/zzz /home/jvd/rpmbuild/BUILD/systemd-stable-248.4/src/partition/test-repart.sh: line 20: sfdisk: command not found + rm -rf /tmp/test-repart.vpxHpruSQk ------- Summary of Failures: 324/617 udev-test SKIP 0.07s 331/617 test-repart FAIL 0.08s (exit status 1) ... Version-Release number of selected component (if applicable): 248.4-1.fc34 How reproducible: 100% Steps to Reproduce: Try to rebuild SRPM as non-root user without /usr/sbin in $PATH . Actual results: Build fails. Expected results: Build should succeed. Additional info:
Created attachment 1803045 [details] Patch to systemd.spec that fixes the problem by adding /usr/sbin to $PATH Patch to systemd.spec that fixes the problem by adding /usr/sbin to $PATH before tests are run .
The attached systemd.spec patch (also with spec file patch for Bug 1983432) fixes the problem, since it adds /usr/sbin to $PATH before tests are run.
User paths as configured in Fedora already contain /usr/sbin. If that is removed, various things will not work properly. Just don't do that. BR:util-linux should be added, indeed.
RE: > User paths as configured in Fedora already contain /usr/sbin. If that is removed, various > things will not work properly. Just don't do that. But 'rpmbuild' does actually use the user's $PATH, which could be anything . If your .spec file script depends for its success on some command being found in $PATH , it should explicitly ensure that $PATH contains the directory - at least a stanza like this should be in the spec file for the test run: if [[ ! "$PATH" =~ (^|:)/usr/sbin(:|$) ]]; then export PATH="${PATH}:/usr/sbin"; fi And actually, if you look at the bash defaults, the default path for the root usr is: /bin:/sbin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin and for the non-root user is ${HOME}/bin:/usr/local/bin:/bin:/usr/bin I run with my non-root PATH set in my .bashrc to be /usr/bin:/usr/local/bin:${HOME}/bin and with my root path being: /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin (since /bin -> /usr/bin and /sbin -> /usr/sbin ). The default path is configurable. Spec file scripts cannot depend on rpm / rpmbuild having set some default path, containing /usr/sbin - that does not happen.
And also, the whole purpose putting programs into some */sbin directory rather than */bin is that only the super-user is meant to be able to read or run files in the */sbin directory ; otherwise, why not just put such programs in */bin ?
https://src.fedoraproject.org/rpms/systemd/c/a6bdda479df8a3a4103648ab2fd2a94f032cdd62?branch=rawhide adds sfdisk to BR. > And also, the whole purpose putting programs into some */sbin directory rather than */bin is that only the super-user is meant to be able to read or run files in the */sbin directory ; otherwise, why not just put such programs in */bin ? The split exists mostly for historical reasons. It is not possible to split programs into those only invoked by an administrator and the rest in any meaningful way. We would get rid of the split, but currently this is not possible because of consolehelper and the handful of packages which use it.
*** Bug 1983449 has been marked as a duplicate of this bug. ***