python@3.9: make test run on ARM#64869
python@3.9: make test run on ARM#64869claui wants to merge 1 commit intoHomebrew:masterfrom claui:arm-test-python3.9
Conversation
The test block uses the _gdbm module as an example for an external loadable module. That module is not part of the natively built ARM Python though. Replace _gdbm with _dbm, which is present in either architecture and should serve just the same purpose.
|
@claui but is it expected that the gdbm and decimal modules are not present? Or is it a build problem? Our formula depends on |
|
I think we have had trouble with gdbm before, and this is exactly the reason why we put it in the test: to check it is correctly built. |
|
@fxcoudert Good points. Need to investigate that. |
|
I know that installing Python from the 3.9 branch (thus 3.9.0 + extra bits) does make gdbm work correctly on arm64. |
This comment has been minimized.
This comment has been minimized.
|
@TonyWu20 if this is on a supported platform, please file an issue and report all the necessary information |
|
Tried to add the --- a/Formula/python@3.9.rb
+++ b/Formula/python@3.9.rb
@@ -114,7 +114,7 @@ class PythonAT39 < Formula
--with-openssl=#{Formula["openssl@1.1"].opt_prefix}
]
- cflags = []
+ cflags = ["-I#{Formula["gdbm"].opt_include}"]
ldflags = []
cppflags = []
@@ -151,7 +151,7 @@ class PythonAT39 < Formula
f.gsub! "DEFAULT_FRAMEWORK_FALLBACK = [", "DEFAULT_FRAMEWORK_FALLBACK = [ '#{HOMEBREW_PREFIX}/Frameworks',"
end
- args << "CFLAGS=#{cflags.join(" ")}" unless cflags.empty?
+ args << "CFLAGS=#{cflags.join(" ")}"
args << "LDFLAGS=#{ldflags.join(" ")}" unless ldflags.empty?
args << "CPPFLAGS=#{cppflags.join(" ")}" unless cppflags.empty?
@@ -349,7 +349,6 @@ class PythonAT39 < Formula
# and it can occur that building sqlite silently fails if OSX's sqlite is used.
system "#{bin}/python#{xy}", "-c", "import sqlite3"
# Check if some other modules import. Then the linked libs are working.
- system "#{bin}/python#{xy}", "-c", "import tkinter; root = tkinter.Tk()"
system "#{bin}/python#{xy}", "-c", "import _gdbm"
system "#{bin}/python#{xy}", "-c", "import zlib"
system bin/"pip3", "list", "--format=columns"The test still fails: |
|
I created this PR to fix the issue #66458. Let me know if that helps. Thanks! |
|
Fixed on #66438 |
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>)?The
testblock uses the _gdbm module as an example for an external loadable module. That module is not part of the natively built ARM Python though.Replace
_gdbmwith_dbm, which is present in either architecture and should serve just the same purpose.(For the record,
_gdbmand_decimalare the only modules that are affected.)