First time attempt to build a package: "Can't locate metadata.pm"

Probably a super newbie perl question, but I only used perl briefly 20+ years ago so...

I'm trying to build mbedtls with a config change due to this apparent issue.

Following the build instructions, I've cloned the repo.

But when I try the ./scripts/feeds update -a step I get:

Can't locate metadata.pm in @INC (you may need to install the metadata module) (@INC entries checked: /home/d/projects/openwrt/openwrt/scripts /usr/local/lib64/perl5/5.40 /usr/local/share/perl5/5.40 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /home/d/projects/openwrt/openwrt/scripts/feeds line 6.
BEGIN failed--compilation aborted at /home/d/projects/openwrt/openwrt/scripts/feeds line 6.

AFAICT I should have the perl module available:

$ dnf list installed *perl*metadata*
Updating and loading repositories:
Repositories loaded.
Installed packages
perl-Module-Metadata.noarch                1.000038-511.fc41 fedora

Available packages
perl-Dist-Metadata.noarch                  0.927-25.fc41     fedora
perl-Dist-Zilla-Role-ModuleMetadata.noarch 0.006-20.fc41     fedora
perl-Module-Metadata-Changes.noarch        2.12-23.fc41      fedora
perl-Net-Amazon-EC2-Metadata.noarch        0.10-38.fc41      fedora

and, ignoring the two instances in flatpaks:

$ locate perl |grep -i metadata
/home/d/.local/share/flatpak/runtime/org.freedesktop.Sdk/x86_64/23.08/cd912210aba6f0bd13806966be67320a2c1b5f76528e050e557234cc044cf14c/files/lib/perl5/5.38.2/Module/Metadata.pm
/home/d/.local/share/flatpak/runtime/org.freedesktop.Sdk/x86_64/24.08/f204b2a59b67831c67f7174fda5ac0cc40c438e5211dfdb9d0ac6c0ad893e025/files/lib/perl5/5.40.0/Module/Metadata.pm
/usr/share/doc/perl-Module-Metadata
/usr/share/doc/perl-Module-Metadata/CONTRIBUTING
/usr/share/doc/perl-Module-Metadata/Changes
/usr/share/doc/perl-Module-Metadata/README
/usr/share/licenses/perl-Module-Metadata
/usr/share/licenses/perl-Module-Metadata/LICENCE
/usr/share/perl5/vendor_perl/Module/Metadata.pm

This simple test also fails:

$ cat test.pm 
#!/usr/bin/env perl
use metadata;
print "here"
$ ./test.pm 
Can't locate metadata.pm in @INC (you may need to install the metadata module) (@INC entries checked: /usr/local/lib64/perl5/5.40 /usr/local/share/perl5/5.40 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at ./test.pm line 2.
BEGIN failed--compilation aborted at ./test.pm line 2.

So any idea how to get unstuck here would be much appreciated.

Hi there, I just tried myself today... only to end up asking my microsoft pc asking me for my bitlocker key and not booting anymore. Fortunately I could recover it... I did not even know this is automatically on these days. I am done for today and will try again next days on some older pc's of me.

Anyway, did you install all packages mentioned on this page? As you are running fedora (?) you are lucky, the column is pretty complete.

Correct on Fedora.

Still, I had everything installed except for ncurses dev libraries which I didn't expect to make a difference - and didn't :frowning:

installing `ncurses` dev libraries
$ sudo dnf install bash-completion bzip2 file gcc gcc-c++ git-core make ncurses-devel patch \
rsync tar unzip wget which diffutils python3 perl-base \
perl-Data-Dumper perl-File-Compare perl-File-Copy perl-FindBin \
perl-IPC-Cmd perl-JSON-PP perl-lib perl-Thread-Queue perl-Time-Piece
Place your right index finger on the fingerprint reader
Updating and loading repositories:
 Fedora 41 - x86_64 - Updates                                      100% |  56.5 KiB/s |  30.0 KiB |  00m01s
Repositories loaded.
Package "bash-completion-1:2.13-2.fc41.noarch" is already installed.
Package "bzip2-1.0.8-19.fc41.x86_64" is already installed.
Package "file-5.45-7.fc41.x86_64" is already installed.
Package "gcc-14.2.1-7.fc41.x86_64" is already installed.
Package "gcc-c++-14.2.1-7.fc41.x86_64" is already installed.
Package "git-core-2.48.1-1.fc41.x86_64" is already installed.
Package "make-1:4.4.1-8.fc41.x86_64" is already installed.
Package "patch-2.7.6-25.fc41.x86_64" is already installed.
Package "rsync-3.4.1-1.fc41.x86_64" is already installed.
Package "tar-2:1.35-4.fc41.x86_64" is already installed.
Package "unzip-6.0-64.fc41.x86_64" is already installed.
Package "wget2-wget-2.2.0-1.fc41.x86_64" is already installed.
Package "which-2.21-42.fc41.x86_64" is already installed.
Package "diffutils-3.10-8.fc41.x86_64" is already installed.
Package "python3-3.13.1-2.fc41.x86_64" is already installed.
Package "perl-base-2.27-512.fc41.noarch" is already installed.
Package "perl-Data-Dumper-2.189-512.fc41.x86_64" is already installed.
Package "perl-File-Compare-1.100.800-512.fc41.noarch" is already installed.
Package "perl-File-Copy-2.41-512.fc41.noarch" is already installed.
Package "perl-FindBin-1.54-512.fc41.noarch" is already installed.
Package "perl-IPC-Cmd-2:1.04-512.fc41.noarch" is already installed.
Package "perl-JSON-PP-1:4.16-512.fc41.noarch" is already installed.
Package "perl-lib-0.65-512.fc41.x86_64" is already installed.
Package "perl-Thread-Queue-3.14-511.fc41.noarch" is already installed.
Package "perl-Time-Piece-1.3401-512.fc41.x86_64" is already installed.

Package                            Arch      Version                            Repository             Size
Installing:
 ncurses-devel                     x86_64    6.5-2.20240629.fc41                fedora            870.1 KiB
Installing dependencies:
 ncurses-c++-libs                  x86_64    6.5-2.20240629.fc41                fedora            161.7 KiB

Transaction Summary:
 Installing:         2 packages

Total size of inbound packages is 608 KiB. Need to download 608 KiB.
After this operation, 1 MiB extra will be used (install 1 MiB, remove 0 B).
Is this ok [y/N]: y
[1/2] ncurses-c++-libs-0:6.5-2.20240629.fc41.x86_64                100% |  73.7 KiB/s |  37.8 KiB |  00m01s
[2/2] ncurses-devel-0:6.5-2.20240629.fc41.x86_64                   100% | 276.7 KiB/s | 570.0 KiB |  00m02s
-----------------------------------------------------------------------------------------------------------
[2/2] Total                                                        100% | 251.4 KiB/s | 607.8 KiB |  00m02s
Running transaction
[1/4] Verify package files                                         100% | 400.0   B/s |   2.0   B |  00m00s
[2/4] Prepare transaction                                          100% |   9.0   B/s |   2.0   B |  00m00s
[3/4] Installing ncurses-c++-libs-0:6.5-2.20240629.fc41.x86_64     100% |   5.5 MiB/s | 162.9 KiB |  00m00s
[4/4] Installing ncurses-devel-0:6.5-2.20240629.fc41.x86_64        100% |   2.4 MiB/s |   1.0 MiB |  00m00s
Complete!

No change, same error:

$ ./scripts/feeds update -a
Can't locate metadata.pm in @INC (you may need to install the metadata module) (@INC entries checked: /home/d/projects/openwrt/openwrt/scripts /usr/local/lib64/perl5/5.40 /usr/local/share/perl5/5.40 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /home/d/projects/openwrt/openwrt/scripts/feeds line 6.
BEGIN failed--compilation aborted at /home/d/projects/openwrt/openwrt/scripts/feeds line 6.

This part is solved, I had to manually specify PERL5LIB=$PWD/scripts on the command line.

1 Like

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