Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Anybody successfully run git-svn on M1 CPU Mac?

I've tried so many ways posted on Homebrew issues.Always fail to run git-svn

Can't locate SVN/Core.pm in @INC (you may need to install the
SVN::Core module) (@INC contains:
/opt/homebrew/Cellar/git/2.30.1/share/perl5
/Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level
/Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/darwin-2level
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0) at
/opt/homebrew/Cellar/git/2.30.1/share/perl5/Git/SVN/Utils.pm line 6.
BEGIN failed--compilation aborted at
/opt/homebrew/Cellar/git/2.30.1/share/perl5/Git/SVN/Utils.pm line 6.
Compilation failed in require at
/opt/homebrew/Cellar/git/2.30.1/share/perl5/Git/SVN.pm line 25. BEGIN
failed--compilation aborted at
/opt/homebrew/Cellar/git/2.30.1/share/perl5/Git/SVN.pm line 32.
Compilation failed in require at
/opt/homebrew/Cellar/git/2.30.1/libexec/git-core/git-svn line 23.
BEGIN failed--compilation aborted at
/opt/homebrew/Cellar/git/2.30.1/libexec/git-core/git-svn line 23.

Git-SVN do not support M1 Mac?

like image 645
ssccsci Avatar asked Nov 05 '25 08:11

ssccsci


2 Answers

It's unlikely that M1 has anything to do with this problem.

git-svn is written in Perl, and the interpreter itself appears to be working OK. It did produce a backtrace; the error would be different had it major troubles to run at all (due to a special machine you're using or whatnot).

If you could read carefully the output, you could easily understand what's the problem.

Let's just do that together.

Can't locate SVN/Core.pm in @INC

This says git-svn (a perl script) tries to import/include/require a module SVN/Core.pm. The file for that module could not be found.

Can't locate SVN/Core.pm in @INC

Even without intimate Perl knowledge, you could guess that @INC is the "include path" variable. List of directories where Perl looks for imported modules.

Reading further.

@INC contains:
/opt/homebrew/Cellar/git/2.30.1/share/perl5
/Applications/Xcode.app/Contents/Developer/Library/Perl/5.28/darwin-thread-multi-2level
/Library/Developer/CommandLineTools/Library/Perl/5.28/darwin-thread-multi-2level
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/darwin-2level
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0/darwin-2level
/Users/admin/perl5/perlbrew/perls/perl-5.32.0/lib/5.32.0)

This is exactly the current setting for @INC. It shows you that exact list of directories. Read it carefully, don't skip over! We're expecting to see something git-svn-related there, right?

Problem 1: your Perl module path appears to contain some junk. There're 2 version of Perl intermixed in there (5.28 & 5.32.0) which can't be a good sign. Did you frantically install multiple versions never cleaning up?..

Let's read the traceback next:

/opt/homebrew/Cellar/git/2.30.1/share/perl5/Git/SVN/Utils.pm line 6.
/opt/homebrew/Cellar/git/2.30.1/share/perl5/Git/SVN.pm line 25. 
/opt/homebrew/Cellar/git/2.30.1/libexec/git-core/git-svn line 23.

git-svn includes Git::SVN. Obviously, the Git/SVN.pm is located correctly by Perl; which indicates that at least some of the @INC paths do contain git & the corresponding git-svn modules. The homebrew package is what got picked up.

Next in the chain is Git::SVN::Utils which imports SVN::Core on line 6 thus triggering the crash.

Notice there's no SVN/Core.pm file, neither in Git-2.30.1 Homebrew bottle for Big Sure (that's what you get from brew install git on your M1) — neither in Git source!

That's because it comes from a separate library (SVN::Core, not Git::SVN::Core).

Problem 2: git-svn needs to have the libsvn-perl library installed, it's a dependency.

Can you find / -path '*/SVN/Core.pm' ? Is the dependency installed somewhere Perl is not looking?

Problem 3: the git Homebrew formula should either declare the dependency onto libsvn-perl (which somebody should first create & upload as I'm not finding it packaged), or ship the dependency together with git, e.g. in the /git/2.30.2/share/perl5/FromCPAN/ subdir of the "bottle"... because it's not there.

I won't go much further. What happened according to my hunch, is that nobody cared. SVN as such is past century technology (think about it); the test section of the Git formula does check that sending emails works, but ignores git-svn.

You're welcome to contribute to the community effort which is Open Source. Fix the bug yourself if you care.

This has nothing to do with your hardware.

like image 72
ulidtko Avatar answered Nov 07 '25 01:11

ulidtko


I figured it out, posted on Homebrew issues #52490 page: https://github.com/Homebrew/homebrew-core/issues/52490#issuecomment-793464504

like image 33
ssccsci Avatar answered Nov 07 '25 00:11

ssccsci



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!