subversion: build javahl on Apple Silicon#76900
subversion: build javahl on Apple Silicon#76900markphip wants to merge 1 commit intoHomebrew:masterfrom
Conversation
carlocab
left a comment
There was a problem hiding this comment.
Thanks for your PR, @markphip.
Please bump the revision (either add revision 1 or increment the revision right after license) so that users who have this installed get the updated version of the formula when they do brew upgrade.
|
ok, thanks @carlocab I was not sure if I was supposed to do that or not since this formula did not already have revision specified. I have added it to the formula. |
|
That's fine. Forgot to mention: please squash your commits together. Thanks! |
|
Thanks for the help @carlocab |
|
Sorry, one last thing: let's put the |
This was initially disabled due to OpenJDK not being available.
|
@carlocab that makes sense, nice catch. Done |
|
🤖 A scheduled task has triggered a merge. |
|
Why not build subversion Perl module for Apple Silicon? |
|
Does it work? It was deactivated in bdd7b9f because it didn't at the time. But if you know it works, you are welcome to open a PR to enable it. |
|
@moonfruit I am not a Perl user so would not know how to verify it works. I am toying with opening a new PR to change sqlite to use the system version from MacOS. I am not sure how others would feel about it. Since Big Sur on Intel and Apple Silicon, JavaHL no longer works in Eclipse (at least the working copy code that needs SQLite does not work). This is because for some reason the system library loads and there is a version mismatch. I can work around the problem by starting Eclipse from a Terminal after running: Building Subversion to use the system sqlite fixes the problem. I do not have easy access to Mojave and Catalina to know if it is a good solution for those versions. Thoughts? Should I just send a PR to have this discussion there? From what I can tell the JavaHL library is already building correctly. I am not sure what changed in Big Sur that makes this no longer work. That said, Big Sur and Homebrew 3.0 all happened around the same time so it is hard to know for certain where the root problem lives. |
|
This is what removing sqlite dependency would look like: markphip@cf8b319 |
|
@moonfruit I tried to remove the Intel conditions on the Perl bindings. It seems to build and install OK but when you run the tests it fails. |
|
Still, you may wish to open a PR so that it can be reviewed and discussed appropriately. |
I agree and I am also reluctant. I am a member of the Subversion PMC and the maintainer for Subclipse. I have already pinged some others from Subversion to see if they have any other ideas on better workarounds I could pursue or try to understand what has changed to cause the problem. I would feel slightly more comfortable if this was limited to Big Sur where I can at least see that Apple is providing a fairly current version of sqlite in the OS. I have no idea what version is provided in Mojave and Catalina. I will submit the PR. I just did not know if that was an acceptable way to start this conversation. |
There was some consistency issues where some dependents used system libs and some did not. That's no longer the case so I'm happy to just use system SQLite if it works. |
Code changes are usually small and relatively isolated in Homebrew/core, so PRs are always our preferred means of discussion. I suspect also that the issue you mention in #76900 (comment) could be a bug in Eclipse, as it sounds like it is assuming the default library search path, but shouldn't be. |
|
@markphip Sorry, I have no M1 chip MacBook, so I cannot know what's happened. But according to the output you provide, I think you should find what's in Maybe this path is not correct on Apple Silicon macOS. Can you paste what you see in |
|
@moonfruit it looks like the issue is that the folder name that gets installed in that folder is |
|
OK, I know, this is because you installed homebrew's perl which is 5.32.1. This patch is for only building perl module to system perl. diff --git a/Formula/subversion.rb b/Formula/subversion.rb
index 1eac4ac5b6..7cfbcb3462 100644
--- a/Formula/subversion.rb
+++ b/Formula/subversion.rb
@@ -112,6 +112,7 @@ class Subversion < Formula
--without-jikes
PYTHON=#{Formula["python@3.9"].opt_bin}/python3
RUBY=/usr/bin/ruby
+ PERL=/usr/bin/perl
]
inreplace "Makefile.in",
@@ -137,34 +138,25 @@ class Subversion < Formula
system "make", "javahl"
system "make", "install-javahl"
- if Hardware::CPU.intel?
- perl_archlib = Utils.safe_popen_read("perl", "-MConfig", "-e", "print $Config{archlib}")
- perl_core = Pathname.new(perl_archlib)/"CORE"
- perl_extern_h = perl_core/"EXTERN.h"
+ perl_version = Utils.safe_popen_read("/usr/bin/perl", "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1]
+ perl_core = MacOS.sdk_path/"System/Library/Perl"/perl_version/"darwin-thread-multi-2level/CORE"
+ perl_extern_h = perl_core/"EXTERN.h"
- unless perl_extern_h.exist?
- # No EXTERN.h, maybe it's system perl
- perl_version = Utils.safe_popen_read("perl", "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1]
- perl_core = MacOS.sdk_path/"System/Library/Perl"/perl_version/"darwin-thread-multi-2level/CORE"
- perl_extern_h = perl_core/"EXTERN.h"
- end
-
- onoe "'#{perl_extern_h}' does not exist" unless perl_extern_h.exist?
+ onoe "'#{perl_extern_h}' does not exist" unless perl_extern_h.exist?
- inreplace "Makefile" do |s|
- s.change_make_var! "SWIG_PL_INCLUDES",
- "$(SWIG_INCLUDES) -arch x86_64 -g -pipe -fno-common " \
- "-DPERL_DARWIN -fno-strict-aliasing -I#{HOMEBREW_PREFIX}/include -I#{perl_core}"
- end
- system "make", "swig-pl"
- system "make", "install-swig-pl"
-
- # This is only created when building against system Perl, but it isn't
- # purged by Homebrew's post-install cleaner because that doesn't check
- # "Library" directories. It is however pointless to keep around as it
- # only contains the perllocal.pod installation file.
- rm_rf prefix/"Library/Perl"
+ inreplace "Makefile" do |s|
+ s.change_make_var! "SWIG_PL_INCLUDES",
+ "$(SWIG_INCLUDES) -arch x86_64 -g -pipe -fno-common " \
+ "-DPERL_DARWIN -fno-strict-aliasing -I#{HOMEBREW_PREFIX}/include -I#{perl_core}"
end
+ system "make", "swig-pl"
+ system "make", "install-swig-pl"
+
+ # This is only created when building against system Perl, but it isn't
+ # purged by Homebrew's post-install cleaner because that doesn't check
+ # "Library" directories. It is however pointless to keep around as it
+ # only contains the perllocal.pod installation file.
+ rm_rf prefix/"Library/Perl"
end
def caveats
@@ -185,11 +177,9 @@ class Subversion < Formula
system "#{bin}/svnadmin", "create", "test"
system "#{bin}/svnadmin", "verify", "test"
- if Hardware::CPU.intel?
- perl_version = Utils.safe_popen_read("/usr/bin/perl", "--version")[/v(\d+\.\d+(?:\.\d+)?)/, 1]
- ENV["PERL5LIB"] = "#{lib}/perl5/site_perl/#{perl_version}/darwin-thread-multi-2level"
- system "/usr/bin/perl", "-e", "use SVN::Client; new SVN::Client()"
- end
+ perl_version = Utils.safe_popen_read("/usr/bin/perl", "--version")[/v(\d+\.\d+(?:\.\d+)?)/, 1]
+ ENV["PERL5LIB"] = "#{lib}/perl5/site_perl/#{perl_version}/darwin-thread-multi-2level"
+ system "/usr/bin/perl", "-e", "use SVN::Client; new SVN::Client()"
end
end |
|
@moonfruit your patch still fails during the test command: ==> /usr/bin/perl -e use SVN::Client; new SVN::Client()
Last 15 lines from /Users/markphip/Library/Logs/Homebrew/subversion/test.03.perl:
2021-05-11 09:24:17 -0400
/usr/bin/perl
-e
use SVN::Client; new SVN::Client()
Can't load '/opt/homebrew/Cellar/subversion/1.14.1_1/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle' for module SVN::_Core: dlopen(/opt/homebrew/Cellar/subversion/1.14.1_1/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle, 0x0001): symbol '_svn_swig_pl_cancel_func' not found, expected in flat namespace by '/opt/homebrew/Cellar/subversion/1.14.1_1/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level/auto/SVN/_Core/_Core.bundle' at /System/Library/Perl/5.30/darwin-thread-multi-2level/DynaLoader.pm line 197.
at /opt/homebrew/Cellar/subversion/1.14.1_1/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level/SVN/Base.pm line 59.
BEGIN failed--compilation aborted at /opt/homebrew/Cellar/subversion/1.14.1_1/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level/SVN/Core.pm line 5.
Compilation failed in require at /opt/homebrew/Cellar/subversion/1.14.1_1/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level/SVN/Client.pm line 4.
BEGIN failed--compilation aborted at /opt/homebrew/Cellar/subversion/1.14.1_1/lib/perl5/site_perl/5.30.2/darwin-thread-multi-2level/SVN/Client.pm line 4.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
Error: subversion: failedFWIW, this is the diff of your change and the one I was previously testing: diff --git a/Formula/subversion.rb b/Formula/subversion.rb
index 07d585569a..7cfbcb3462 100644
--- a/Formula/subversion.rb
+++ b/Formula/subversion.rb
@@ -5,7 +5,7 @@ class Subversion < Formula
mirror "https://archive.apache.org/dist/subversion/subversion-1.14.1.tar.bz2"
sha256 "2c5da93c255d2e5569fa91d92457fdb65396b0666fad4fd59b22e154d986e1a9"
license "Apache-2.0"
- revision 2
+ revision 1
bottle do
sha256 arm64_big_sur: "cc10a37f931098a527772624566986313996921ef4db503574894e7c879a148e"
@@ -112,6 +112,7 @@ class Subversion < Formula
--without-jikes
PYTHON=#{Formula["python@3.9"].opt_bin}/python3
RUBY=/usr/bin/ruby
+ PERL=/usr/bin/perl
]
inreplace "Makefile.in",
@@ -137,17 +138,10 @@ class Subversion < Formula
system "make", "javahl"
system "make", "install-javahl"
- perl_archlib = Utils.safe_popen_read("perl", "-MConfig", "-e", "print $Config{archlib}")
- perl_core = Pathname.new(perl_archlib)/"CORE"
+ perl_version = Utils.safe_popen_read("/usr/bin/perl", "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1]
+ perl_core = MacOS.sdk_path/"System/Library/Perl"/perl_version/"darwin-thread-multi-2level/CORE"
perl_extern_h = perl_core/"EXTERN.h"
- unless perl_extern_h.exist?
- # No EXTERN.h, maybe it's system perl
- perl_version = Utils.safe_popen_read("perl", "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1]
- perl_core = MacOS.sdk_path/"System/Library/Perl"/perl_version/"darwin-thread-multi-2level/CORE"
- perl_extern_h = perl_core/"EXTERN.h"
- end
-
onoe "'#{perl_extern_h}' does not exist" unless perl_extern_h.exist?
inreplace "Makefile" do |s| |
|
This patch mostly applies to #76964 and will be solved there. If there are some problems, you can post there. |
This was initially disabled due to OpenJDK not
being available.
brew install --build-from-source <formula>, where<formula>is the name of the formula you're submitting?brew test <formula>, where<formula>is the name of the formula you're submitting?brew audit --strict <formula>(after doingbrew install <formula>)?I verified that the JavaHL library works by using it via Subclipse in Eclipse.
Note there is a sqlite related problem with JavaHL that already exists on Intel
and also exists on Apple Silicon. This either came about with Big Sur or Homebrew 3.0
I am investigating options and will possibly submit a separate PR for that.