Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.58k stars 12.33k forks source link

stow: perl compilation failed, can't locate File/Copy.pm in @INC #177695

Closed liondandelion closed 1 month ago

liondandelion commented 1 month ago

brew gist-logs <formula> link OR brew config AND brew doctor output

$ brew config
HOMEBREW_VERSION: 4.3.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 1c98a33a376e5b35ebc801d0f7d6ba7b9eb118ac
Last commit: 10 days ago
Core tap JSON: 18 Jul 07:47 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_EDITOR: /usr/bin/nano
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 3.3.3 => /var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.3/bin/ruby
CPU: dodeca-core 64-bit zen
Clang: N/A
Git: 2.45.2 => /bin/git
Curl: 8.6.0 => /bin/curl
Kernel: Linux 6.9.8-200.fc40.x86_64 x86_64 GNU/Linux
OS: Fedora release 40 (Forty)
Host glibc: 2.39
/usr/bin/gcc: 14.1.1
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: 14.1.0_2
xorg: N/A

$ brew doctor
Your system is ready to brew.

Verification

What were you trying to do (and why)?

I was trying to install and run stow to manage my dotfiles.

What happened (include all command output)?

While running stow with any arguments i get the following output:

$ stow -h
Can't locate File/Copy.pm in @INC (you may need to install the File::Copy module) (@INC entries checked: /home/linuxbrew/.linuxbrew/Cellar/stow/2.4.0/share/perl/5.34.0 /usr/local/lib64/perl5/5.38 /usr/local/share/perl5/5.38 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /home/linuxbrew/.linuxbrew/Cellar/stow/2.4.0/share/perl/5.34.0/Stow.pm line 54.
BEGIN failed--compilation aborted at /home/linuxbrew/.linuxbrew/Cellar/stow/2.4.0/share/perl/5.34.0/Stow.pm line 54.
Compilation failed in require at /home/linuxbrew/.linuxbrew/bin/stow line 465.
BEGIN failed--compilation aborted at /home/linuxbrew/.linuxbrew/bin/stow line 465.

What did you expect to happen?

I expected stow to work normally without failures.

Step-by-step reproduction instructions (by running brew commands)

1. $ brew install stow
2. $ stow -h
SMillerDev commented 1 month ago

Judging by https://metacpan.org/release/XSAWYERX/perl-5.34.0/view/lib/File/Copy.pm that's supposed to be part of the default Perl system.

cho-m commented 1 month ago

This doesn't look like right search path for brew perl (which should include paths under /home/linuxbrew/.linuxbrew/opt/perl). It seems to be using system perl paths (e.g. /usr/...) instead:

(@INC entries checked:
/home/linuxbrew/.linuxbrew/Cellar/stow/2.4.0/share/perl/5.34.0
/usr/local/lib64/perl5/5.38
/usr/local/share/perl5/5.38
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5)

EDIT: Also looks like the stow bottle contains path for Perl 5.34.0 (which may be System perl on Ubuntu CI runner)

Can you check what the shebang is? e.g. head -1 /home/linuxbrew/.linuxbrew/bin/stow.

cho-m commented 1 month ago

May be due to not uploading bottle from #176700 so existing bottles are still using system /usr/bin/perl and only work if that Perl matches version on Ubuntu 22.04

liondandelion commented 1 month ago

Can you check what the shebang is?

It is indeed #!/usr/bin/perl

branchvincent commented 1 month ago

Bottle was rebuilt in #177803, should be fixed after a brew reinstall stow

liondandelion commented 1 month ago

Yes, it is fixed now. Thanks!