python-xmlsec: Unable to (pip install xmlsec) since brew version 4.0.13
Hi,
I am using MacOS 13.2.1 (22D68), I didn’t have any issue Installing xmlsec when I had brew version ~2.x.x. I’ve recently updated brew to version 4.0.13, and I haven’t been able to pip install xmlsec since. Any idea what might this be?
I have below dependencies installed
libxml2 = 2.10.4
libxmlsec1 = 1.3.0
The error that I am getting
pip install xmlsec
Collecting xmlsec
Using cached xmlsec-1.3.13.tar.gz (64 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting lxml>=3.8
Using cached lxml-4.9.2-cp38-cp38-macosx_10_15_x86_64.whl (4.7 MB)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for xmlsec (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [65 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-13.2-x86_64-cpython-38
creating build/lib.macosx-13.2-x86_64-cpython-38/xmlsec
copying src/xmlsec/py.typed -> build/lib.macosx-13.2-x86_64-cpython-38/xmlsec
copying src/xmlsec/tree.pyi -> build/lib.macosx-13.2-x86_64-cpython-38/xmlsec
copying src/xmlsec/__init__.pyi -> build/lib.macosx-13.2-x86_64-cpython-38/xmlsec
copying src/xmlsec/constants.pyi -> build/lib.macosx-13.2-x86_64-cpython-38/xmlsec
copying src/xmlsec/template.pyi -> build/lib.macosx-13.2-x86_64-cpython-38/xmlsec
running build_ext
building 'xmlsec' extension
creating build/temp.macosx-13.2-x86_64-cpython-38
creating build/temp.macosx-13.2-x86_64-cpython-38/private
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders/3r
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442
creating build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DOPENSSL_NO_SSL3 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_FTP=1 -DXMLSEC_NO_MD5=1 -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_CRYPTO_OPENSSL=1 -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.3.13 -I/usr/local/Cellar/libxmlsec1/1.3.0/include/xmlsec1 -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/openssl@1.1/include/openssl -I/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-build-env-wv9r2lgj/overlay/lib/python3.8/site-packages/lxml/includes -I/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-build-env-wv9r2lgj/overlay/lib/python3.8/site-packages/lxml -I/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-build-env-wv9r2lgj/overlay/lib/python3.8/site-packages/lxml/includes/libxml -I/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-build-env-wv9r2lgj/overlay/lib/python3.8/site-packages/lxml/includes/libxslt -I/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-build-env-wv9r2lgj/overlay/lib/python3.8/site-packages/lxml/includes/libexslt -I/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-build-env-wv9r2lgj/overlay/lib/python3.8/site-packages/lxml/includes/extlibs -I/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-build-env-wv9r2lgj/overlay/lib/python3.8/site-packages/lxml/includes/__pycache__ -I/Users/abed/.pyenv/versions/3.8.13/include/python3.8 -c /private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/constants.c -o build/temp.macosx-13.2-x86_64-cpython-38/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/constants.o -g -std=c99 -fPIC -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/constants.c:319:5: error: use of undeclared identifier 'xmlSecSoap11Ns'
PYXMLSEC_ADD_NS_CONSTANT(Soap11Ns, "SOAP11");
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/constants.c:304:46: note: expanded from macro 'PYXMLSEC_ADD_NS_CONSTANT'
tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/common.h:19:19: note: expanded from macro 'JOIN'
#define JOIN(X,Y) DO_JOIN1(X,Y)
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/common.h:20:23: note: expanded from macro 'DO_JOIN1'
#define DO_JOIN1(X,Y) DO_JOIN2(X,Y)
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/common.h:21:23: note: expanded from macro 'DO_JOIN2'
#define DO_JOIN2(X,Y) X##Y
^
<scratch space>:60:1: note: expanded from here
xmlSecSoap11Ns
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/constants.c:320:5: error: use of undeclared identifier 'xmlSecSoap12Ns'; did you mean 'xmlSecXPath2Ns'?
PYXMLSEC_ADD_NS_CONSTANT(Soap12Ns, "SOAP12");
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/constants.c:304:46: note: expanded from macro 'PYXMLSEC_ADD_NS_CONSTANT'
tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/common.h:19:19: note: expanded from macro 'JOIN'
#define JOIN(X,Y) DO_JOIN1(X,Y)
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/common.h:20:23: note: expanded from macro 'DO_JOIN1'
#define DO_JOIN1(X,Y) DO_JOIN2(X,Y)
^
/private/var/folders/3r/5tl2g0hd1s5892x7v6_l80680000gp/T/pip-install-l82wgx3k/xmlsec_b1821a1b8b0e4f2e9d01654d56c1f442/src/common.h:21:23: note: expanded from macro 'DO_JOIN2'
#define DO_JOIN2(X,Y) X##Y
^
<scratch space>:62:1: note: expanded from here
xmlSecSoap12Ns
^
/usr/local/Cellar/libxmlsec1/1.3.0/include/xmlsec1/xmlsec/strings.h:34:33: note: 'xmlSecXPath2Ns' declared here
XMLSEC_EXPORT_VAR const xmlChar xmlSecXPath2Ns[];
^
2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for xmlsec
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec, which is required to install pyproject.toml-based projects
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 28
- Comments: 41 (1 by maintainers)
Commits related to this issue
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/xaasible-ops by deleted user 3 years ago
- [depends] `libxmlsec1`, + downgradey bugware for Mac As per https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1726249435 — committed to epfl-si/sddc-ocp by deleted user 3 years ago
- [unbugware] `ensure_libxmlsec1` All I know is that [the upstream issue looks fixed](https://github.com/xmlsec/python-xmlsec/issues/254) — committed to epfl-si/sddc-ocp by deleted user 3 years ago
brew editseems to have broken in a recent update, so here’s an even hackier workaround that almost fails but still got me what I needed:Remove the official formula
Download the last known good formula and shove it into
/tmpInstall the local copy of the last known good formula from
/tmpA “better” (cleaner) workaround is to create a local tap and extract the previous version, like so:
Once
python-xmlsecis updated to supportlibxmlsec11.3+, you can uninstall the extracted version and remove the tap by doing:Edit: This no longer works, because there were new patch versions of
libxmlsec1released and the formula can’t find the archive for 1.2.37 at the old URL. A quick fix is to edit the formula to point to the correct URL before installing it:And update line 4 with the correct URL:
Thanks to @karthicraghupathi for that!
Shell one liner of @amir0ff’s fix.
Can confirm that manually reverting to a copy of the last known good pre-1.3.0
xmlsec1version (1.2.37) Formula fixed me up:https://raw.githubusercontent.com/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb
Specific workaround steps:
brew edit libxmlsec1. An editor opens up, full of the contents of the latest downloadedxmlsecformula from GitHub or wherever they come frombrew install /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libxmlsec1.rbpip install xmlsecReferences
I made a tap to install libxmlsec1@1.2.37 Usage:
Undo:
when you use brew 4.0.14 version, you should pay attention to brew home path is /opt/homebrew, not /usr/local/Homebrew;
i also workaround it with below method;
very much thank to @dpritchett : )
Thanks a lot, that worked for me!
@bgaifullin I see this issue was fixed by https://github.com/xmlsec/python-xmlsec/pull/264, but I’m not sure how to access this fix. I see at https://pypi.org/project/xmlsec/#history that the latest release is 1.3.13 from 2022. Will there be a new release containing this fix?
In case it helps anyone, I ran into two issues with the workaround @D3X posted above:
Invalid tap namewhen runningbrew tap-new $USER/localMy $USER has a.in it, making it an invalid tap name, so I had to manually set a name.curl: (22) The requested URL returned error: 404when runningbrew install $USER/local/libxmlsec1@1.2.37. The xmlsec tarball that brew downloads has moved into theolder-releasesdirectory with the release of version 1.2.38, so I needed to change the URL in the libxmlsec1.rb file.This worked for me:
Per the workaround above, I had to run
brew unlink libxmlsec1in between steps 2 and 3 and it worked for me.Thanks! it worked for me… the only problem I had was that it gave me this error when installing the formula from /tpm folder:
"Error: openssl@1.1 has been disabled because it is not supported upstream! It was disabled on 2024-10-24.".I solved it by editing /tml/libxmlsec1.rb, changing
depends_on "openssl@1.1"todepends_on "openssl@3"For M2 (Silicon chip) I had to run:
Anxiously awaiting this update on an M1.
I’m encountering this on macOS right now and from everybody’s collected solutions I landed on the following:
sudo xcodebuild -license acceptContents for
libxmlsec1.rb:I need one more step
Now openssl@1.1 is deprecated so we need to edit the content of /tmp/libxmlsec1.rb and replace all the instances of openssl@1.1 to openssl@3 and then hit brew install --formula /tmp/libxmlsec1.rb
Doesn’t seem to work (anymore?) - it returns
Using Homebrew 4.0.24-4-g9e747d8
@timothestes total brew noob over here, but I was able to give the link from the original workaround to wget and it worked.
e.g.
I prefer this method. However I ran into this error when I ran these commands:
The package’s URL has now changed. It is present in
older-releases. To fix this, run the following command:And make the following changes:
Once these changes are complete, you can re-run the following to complete installation:
Ugh, it’s so annoying that this issue has been open for so long the workarounds stop working… Thanks for posting an updated solution!
Hopefully #252 will be addressed soon so this can be fixed 🤞🏻
This is gonna be resolved in the new version, see https://github.com/xmlsec/python-xmlsec/issues/284
For MacPorts users:
I’ve installed
libxmlsec1at1.2.37but still cannot getxmlsecto work properly:You can paste this code into a file called libxmlsec1.rb and then install using formula.
I got a 404 when using the wget link you provided, however the concept for this did work when I found an alternative source. Thanks a lot for pointing this out. Would have never solved this otherwise.
I can confirm that downgrading to libxmlsec1 1.2.37 worked. 1.3.1 broke our SAML workflow completely
Thank you @dpritchett. Your workaround worked for me 👍