Missing Perl path causing compiling error

Attempting to install the ffmpeg-obs AUR package and fails when compiling the documents for ffmpeg.1 and ffplay.1, the pod2man command is not found. I’m using pikaur AUR helper for the install.

# uname -a
Linux on 6.12.19-1-MANJARO #1 SMP PREEMPT_DYNAMIC

Pertinent error portion of the build:

MAN     doc/ffmpeg.1
/bin/sh: line 1: pod2man: command not found
MAN     doc/ffplay.1
make: *** [doc/Makefile:98: doc/ffmpeg.1] Error 127
make: *** Waiting for unfinished jobs....
/bin/sh: line 1: pod2man: command not found
make: *** [doc/Makefile:98: doc/ffplay.1] Error 127
==> ERROR: A failure occurred in build().
    Aborting...

Command 'sudo --user=#1000 --preserve-env=VISUAL,EDITOR -- makepkg --force' failed to execute.

Checking the path of pod2man:

$ which pod2man
/usr/bin/core_perl/pod2man

from root:

# which pod2man
which: no pod2man in (/usr/local/sbin:/usr/local/bin:/usr/bin)

I have the perl base-devel installed and the user’s path shows the perl’s path, but the root’s path does not.

User’s path

$ echo $PATH
/home/pc/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

root’s path

# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin

The /etc/profile.d has the correct files:

# ls /etc/profile.d 
70-systemd-shell-extra.sh  flatpak.sh    home-local-bin.sh            perlbin.csh
debuginfod.csh             freetype2.sh  libreoffice-still.csh        perlbin.sh
debuginfod.sh              gawk.csh      libreoffice-still.sh         qt5-accessibility.sh
flatpak-bindir.sh          gawk.sh       locale.sh                    vte.csh
flatpak.csh                gpm.sh        manjaro-kde-settings-xdg.sh  vte.sh

here’s the perlbin.sh file entry:

# cat /etc/profile.d/perlbin.sh 
# Set path to perl scriptdirs if they exist
# https://wiki.archlinux.org/index.php/Perl_Policy#Binaries_and_scripts
# Added /usr/bin/*_perl dirs for scripts

[ -d /usr/bin/site_perl ] && append_path '/usr/bin/site_perl'

[ -d /usr/bin/vendor_perl ] && append_path '/usr/bin/vendor_perl'

[ -d /usr/bin/core_perl ] && append_path '/usr/bin/core_perl'

export PATH

# If you have modules in non-standard directories you can add them here.
#export PERLLIB=dir1:dir2

My partner’s laptop shows the correct path in root and is able to build the ffmpeg-obs package without issue. Although, the laptop uses an earlier version of Manjaro:

# uname -a
Linux ep 6.6.75-2-MANJARO #1 SMP PREEMPT_DYNAMIC

I’ve attempted to manually source the /etc/profile, and it adds the paths, but resets after the session closes or reboots. I tried another pc with a separate downloaded version of Manjaro KDE, and it has the same behavior.

To summarize, it appears root doesn’t source the /etc/profile path exports, but the regular users do. Might be a bug for this version of Manjaro?

What command did you actually run? sudo should neither be used with an AUR helper nor makepkg.

==> ERROR: Running makepkg as root is not allowed as it can cause permanent,
catastrophic damage to your system.
1 Like

Correct, good call to confirm the use of sudo. Pikaur won’t run with sudo, here’s what I run:

$ pikaur -S ffmpeg-obs

You will then enter elevated sudo credentials to allow the installation process. I’m not too familiar with the fakeroot steps needed for pikaur to complete the process, the sudo --user… was part of the error return not allowing to continue with the given #1000 user and forcing the makepkg command. I’ve seen it in past compilation failures.

Likewise, I’m more curious as to why root isn’t getting the defined paths to access necessary commands.

Have you ensured you have all build dependencies installed?

E.g. pod2man is provided by the package of the same name

sudo pacman -Syu pod2man
sorry my mistake - I should have looked closer at the pamac info output :man_facepalming:

To identify if the pikaur helper work as expected - use the native method

git clone https://aur.archlinux.org/ffmpeg-obs
cd ffmpeg-obs

Examine the PKGBUILD and verify if it mentions pod2man in the build dependency array

makepkg -iscC

Have you tried building other AUR packages for ffmpeg
ffmpeg-full
ffmpeg-git
ffmpeg-full-git

Unfortunately, pod2man is not a standalone package in the standard repos as it is part of the base-devel. But there is a pod2man in the AUR AUR (en) - pod2man

$ sudo pacman -Syu pod2man                                                                     1 ✘ 
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date
error: target not found: pod2man

The package is installed in the proper location, see above which command for user, root is not sourcing the correct path to run it. Thank you for the suggestion.

Thank you for the suggestion to try other AUR ffmpeg packages, I opted to try the ffmpeg-amd-full package, as I don’t need the cuda dependency. I was able to install the full package without issue, retried the obs package with the command errors appearing.

To reiterate, the issue is root not sourcing the command paths in the /etc/profile file, causing missing command errors. Thank you all for helping troubleshoot this issue.

Here’s what happens to the root’s path before and after sourcing /etc/profile

# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin

# source /etc/profile
[root@on]#

# echo $PATH
/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

Hmm - pod2man is part of perl.

yay -S ffmpeg-obs builds the package flawlessly

Only sudo su results in this very short PATH

sudo su
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin
sudo su -
echo $PATH
/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
1 Like

Hmm - pod2man is part of perl.

You are correct, not part of base-devel, my mistake.

Thanks for that distinction for su, I forget about the deeper level “-” offers. Can confirm path is reading full when echoed.

$ sudo su -                                                                                                                                     
[on ~]# echo $PATH
/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

It maybe an issue with pikaur and their root management, I’ll dig deeper there and see if there is a bug from them. I’ll mark this solved for the time being.

Thanks!

My apologies - you are right pod2man is not a standalone pkg - but a part of perl

In any case your issue is because you try to run makepkg as root as pointed out by @Yochanan.

So it is an xyproblem where you try to work around the wrong usage of makepkg.

2 Likes

Not a problem, thanks for offering help!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.