bbusschots / hsxkpasswd

A Perl module and terminal command for generating secure memorable passwords inspired by the fabulous XKCD web comic and Steve Gibson's Password Hay Stacks. This is the library that powers www.xkpasswd.net
http://www.bartb.ie/xkpasswd
BSD 2-Clause "Simplified" License
278 stars 48 forks source link

After installing MacOS Big Sur I get the error: Can't locate File/HomeDir.pm #40

Open prutsky opened 3 years ago

prutsky commented 3 years ago

I updated my Mac with Big Sur. Now the hsxkpasswd script won't run anymore. I get the following error:

Can't locate File/HomeDir.pm in @INC (you may need to install the File::HomeDir module) (@INC contains: /Library/Perl/5.28/darwin-thread-multi-2level /Library/Perl/5.28 /Network/Library/Perl/5.28/darwin-thread-multi-2level /Network/Library/Perl/5.28 /Library/Perl/Updates/5.28.2/darwin-thread-multi-2level /Library/Perl/Updates/5.28.2 /System/Library/Perl/5.28/darwin-thread-multi-2level /System/Library/Perl/5.28 /System/Library/Perl/Extras/5.28/darwin-thread-multi-2level /System/Library/Perl/Extras/5.28) at /usr/local/bin/hsxkpasswd line 14. BEGIN failed--compilation aborted at /usr/local/bin/hsxkpasswd line 14.

I googled and found I maybe needed to install the himedir (again) using sudo cpan -i File::HomeDir. But no luck with that.

When I install hsxkpasswd from scratch I see this error passing by in the logging: `HASCOMPILER8_2A/TEST4bx0.c:2:10: fatal error: 'EXTERN.h' file not found

include "EXTERN.h"

     ^~~~~~~~~~

1 error generated. Couldn't execute cc -g -pipe -fno-strict-aliasing -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Os "-I/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE" -c HASCOMPILER8_2A/TEST4bx0.c -o HASCOMPILER8_2A/TEST4bx0.o: Inappropriate ioctl for device at Makefile.PL line 14. `

(I updated Xcode btw).

What can I do to make this work again?

jimtut commented 3 years ago

Having the same problem, although with a different Perl module (updating CPAN itself!). Any luck getting HomeDir (or more technically Mac::SystemDirectory, which is actually what's failing, at least for me) to install under Big Sur (macOS 11.0)? I'm on an M1 Mac too, so that could be my problem...

JosephLeedy commented 3 years ago

I experienced this too on a 2018 Mac Mini. Here is how I fixed it:

  1. Installed Perl from Homebrew with brew install perl
  2. Ran brew link --overwrite perl*
    • * This was necessary to overwrite the system symlinks in /usr/local/bin created when I originally installed the module on Catalina
  3. Added /usr/local/opt/perl/bin to my $PATH

The system Perl seems hobbled and useless now.

prutsky commented 3 years ago

When I install Perl, I get this output:

brew install perl
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
aerc                f3d                 librttopo           tm
aws-rotate-key      giza                libtirpc            utf8cpp
bpytop              gopls               lua@5.3             v2ray
cairomm@1.14        gping               magic_enum          xcb-util
cargo-edit          json5               overdrive           xinput
cfn-format          kcgi                php@7.4             xkeyboardconfig
clash               kubecm              regipy              youtube-dlc
docui               kubevela            t-rec               youtubedr
duf                 libbsd              tendermint
evernote2md         libcap              terraform@0.13
==> Updated Formulae
Updated 4604 formulae.
==> Renamed Formulae
now-cli -> vercel-cli
==> Deleted Formulae
curl-openssl               rmtrash                    unp64
fmsx                       stlviewer                  xspin

==> Downloading https://homebrew.bintray.com/bottles/perl-5.32.0.big_sur.bottle.
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/7db44dc9609acbada14bd
######################################################################## 100.0%
==> Pouring perl-5.32.0.big_sur.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/prove
Target /usr/local/bin/prove
already exists. You may want to remove it:
  rm '/usr/local/bin/prove'

To force the link and overwrite all conflicting files:
  brew link --overwrite perl

To list all files that would be deleted:
  brew link --overwrite --dry-run perl

Possible conflicting files are:
/usr/local/bin/prove
/usr/local/share/man/man1/prove.1
==> Caveats
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.

You can set that up like this:
  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
  echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"' >> /Users/erwin/.bash_profile
==> Summary
🍺  /usr/local/Cellar/perl/5.32.0: 2,458 files, 65.0MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/erwin/Library/Logs/Homebrew/libusb... (64B)
Pruned 0 symbolic links and 317 directories from /usr/local

and when I ran brew link --overwrite perl* I get: Error: No such keg: /usr/local/Cellar/perl5

JosephLeedy commented 3 years ago

Sorry, the asterisk was a footnote, not a part of the command.