sqitchers / homebrew-sqitch

Homebrew Formulas for Sqitch
22 stars 10 forks source link

Will not build on MacOs 12 Homebrew due to system perl confusion #55

Closed mrflip closed 2 years ago

mrflip commented 2 years ago

tl;dr

I tried twelve different angles on this, using homebrew and then directly with homebrew cpanm; errors included

Finally, I caught it trying to run /usr/bin/perl version 5.30.3 -- i.e. the system perl -- during the install process of that. it might be I was always running into the same problem; or that the issue was the homebrew perl is 5.34.0 vs 5.30.3; or that I am still on bash and the system has switched to zsh.

In any case, I instead blew away perl completely by rm -rf ~/.cpan ~/.cpanm ~/perl5 and brew uninstall cpanm perl and then installed perl 5.3.0 using asdf:

sudo mkdir /usr/local/perl
sudo chown $USER /usr/local/perl
mkdir /usr/local/perl/{bin,lib,include,etc}
asdf plugin add perl
asdf list all perl
asdf install perl 5.30.3

Added this to my .bashrc:

export PERL5LIB=/usr/local/perl:/usr/local/perl/lib/perl5:$PERL5LIB
export PERL_CPANM_OPT="--local-lib /usr/local/perl"
append_path PATH /usr/local/perl/bin

Finally did the install:

cpanm -n install DBI App::Sqitch DBD::Pg DBD::SQLite

I've retconned some of those commands as of course I was just spamming anything I could at the command line but that gives you the gist. No idea if I was hitting one problem or several and whether all of this is necessary.

theory commented 2 years ago

Was able to replicate the issue, I think; looks like the Homebrew cpanminus formula was updated to use the system Perl, which breaks things in the Sqitch installer. See Homebrew/homebrew-core#103511 for details. Will update with a fix ASAP.