Closed abdwebus closed 7 months ago
libxmlsec1 released v1.3.0 yesterday, guessing it's related 😵💫
Can confirm that manually reverting to a copy of the last known good pre-1.3.0 xmlsec1
version (1.2.37
) Formula fixed me up:
Specific workaround steps:
brew edit libxmlsec1
. An editor opens up, full of the contents of the latest downloaded xmlsec
formula from GitHub or wherever they come from brew install /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libxmlsec1.rb
pip install xmlsec
Here's the PR that removed soap from xmlsec
back in November: https://github.com/lsh123/xmlsec/pull/427
Thank you @dpritchett. Your workaround worked for me 👍
Hopefully #252 will be addressed soon so this can be fixed 🤞🏻
Per the workaround above, I had to run brew unlink libxmlsec1
in between steps 2 and 3 and it worked for me.
A "better" (cleaner) workaround is to create a local tap and extract the previous version, like so:
brew tap-new $USER/local
brew extract --version=1.2.37 libxmlsec1 $USER/local
brew uninstall libxmlsec1
brew install $USER/local/libxmlsec1@1.2.37
Once python-xmlsec
is updated to support libxmlsec1
1.3+, you can uninstall the extracted version and remove the tap by doing:
brew uninstall $USER/local/libxmlsec1@1.2.37
brew untap $USER/local
Edit: This no longer works, because there were new patch versions of libxmlsec1
released 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:
brew edit $USER/local/libxmlsec1@1.2.37
And update line 4 with the correct URL:
- url "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.37.tar.gz"
+ url "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.37.tar.gz"
Thanks to @karthicraghupathi for that!
@D3X, I am facing this error when using the workaround. (I am new to MacOS)
~ % brew tap-new $USER/local-2
Error: /opt/homebrew/Library/Taps/ssrivastava/homebrew-local-2/README.md already exists
~ % brew extract --version=1.2.37 libxmlsec1 $USER/local-2
==> Searching repository history
Error: Could not find libxmlsec1! The formula or version may not have existed.
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;
brew unlink libxmlsec1
brew install /opt/homebrew/opt/libxmlsec1/.brew/libxmlsec1.rb
pip install xmlsec
very much thank to @dpritchett : )
I need one more step
cd /opt/homebrew/opt/
ln -s libxmlsec1\@1.2.37 libxmlsec1
Anxiously awaiting this update on an M1.
brew extract --version=1.2.37 libxmlsec1 $USER/local
Doesn't seem to work (anymore?) - it returns
==> Searching repository history
Error: Could not find libxmlsec1! The formula or version may not have existed.
Using Homebrew 4.0.24-4-g9e747d8
I can confirm that downgrading to libxmlsec1 1.2.37 worked. 1.3.1 broke our SAML workflow completely
brew edit
seems to have broken in a recent update, so here's an even hackier workaround that almost fails but still got me what I needed:
> brew uninstall libxmlsec1
Uninstalling /opt/homebrew/Cellar/libxmlsec1/1.3.1_1... (220 files, 7.5MB)
/tmp
> export DESIRED_SHA="7f35e6ede954326a10949891af2dba47bbe1fc17"
# ⚠️ this wget call will fail if you haven't exported DESIRED_SHA as in the preceding line
> wget -O /tmp/libxmlsec1.rb "https://raw.githubusercontent.com/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb"
--2023-06-30 11:40:48-- https://raw.githubusercontent.com/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2932 (2.9K) [text/plain]
Saving to: ‘/tmp/libxmlsec1.rb’
/tmp/libxmlsec1.rb 100%[=========================================================================================>] 2.86K --.-KB/s in 0s
2023-06-30 11:40:48 (25.9 MB/s) - ‘/tmp/libxmlsec1.rb’ saved [2932/2932]
/tmp
> brew install --formula /tmp/libxmlsec1.rb
==> Fetching libxmlsec1
==> Downloading https://ghcr.io/v2/homebrew/core/libxmlsec1/manifests/1.2.37
Already downloaded: /Users/daniel/Library/Caches/Homebrew/downloads/0cff6c77c178a7b4826e3146309166ec9d19a0a6580d47e5a1ebaf367cd6c7d0--libxmlsec1-1.2.37.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libxmlsec1/blobs/sha256:26d6ebddf4e97431819583ad699228360886d81786b332084693d0ad34aa2c72
####################################################################################################################################################################### 100.0%
Warning: libxmlsec1 1.3.1_1 is available and more recent than version 1.2.37.
==> Pouring libxmlsec1--1.2.37.arm64_ventura.bottle.tar.gz
🍺 /opt/homebrew/Cellar/libxmlsec1/1.2.37: 221 files, 6MB
==> Running `brew cleanup libxmlsec1`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/daniel/Library/Caches/Homebrew/libxmlsec1--1.2.37... (1.2MB)
brew edit
seems to have broken in a recent update, so here's an even hackier workaround that almost fails but still got me what I needed:
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.
@alexeocto Can you post the alternative source?
@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.
https://raw.githubusercontent.com/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb
I made a tap to install libxmlsec1@1.2.37 Usage:
brew uninstall libxmlsec1
brew install tvuotila/libxmlsec1/libxmlsec1@1.2.37
Undo:
brew uninstall libxmlsec1@1.2.37
brew untap tvuotila/libxmlsec1
@alexeocto Can you post the alternative source?
You can paste this code into a file called libxmlsec1.rb and then install using formula.
# Libxmlsec1 definition for 1.2.37. This includes the bottles for this version.
class Libxmlsec1 < Formula
desc "XML security library"
homepage "https://www.aleksey.com/xmlsec/"
url "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.37.tar.gz"
sha256 "5f8dfbcb6d1e56bddd0b5ec2e00a3d0ca5342a9f57c24dffde5c796b2be2871c"
license "MIT"
livecheck do
url "https://www.aleksey.com/xmlsec/download/older-releases/"
regex(/href=.*?xmlsec1[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_ventura: "26d6ebddf4e97431819583ad699228360886d81786b332084693d0ad34aa2c72"
sha256 cellar: :any, arm64_monterey: "66646e0a3c47fe21b5d6257d2940c1cbaddd68fd71845ae21eb34275b2913db4"
sha256 cellar: :any, arm64_big_sur: "6520bff7f714071fc7a5925dc2335c5482ce59383386500e1f51680bf3e69850"
sha256 cellar: :any, ventura: "15faa359429f324b4d18e49c70b0832cf93eb052ad0ef74ccddf1a2db0a4aad5"
sha256 cellar: :any, monterey: "dfc4528593b38556559a49053f7b5e3a46ae07d844ad3412a65c22214624a932"
sha256 cellar: :any, big_sur: "d428a24cc5c8165e84718292cd4a7a21519b1ce1f46c82ffff0bc27216b8a573"
sha256 cellar: :any, catalina: "b67b572409b3d79387f621c9f28338d0ec99342477f50643ff3a6032b58133c6"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a52005111565d460c6774d5c5be9c8a0db05e0a06dc8715b7c1f59ab4a66fcb0"
end
depends_on "pkg-config" => :build
depends_on "gnutls" # Yes, it wants both ssl/tls variations
depends_on "libgcrypt"
depends_on "libxml2"
depends_on "openssl@1.1"
uses_from_macos "libxslt"
on_macos do
depends_on xcode: :build
end
# Add HOMEBREW_PREFIX/lib to dl load path
patch :DATA
# Fix -flat_namespace being used on Big Sur and later.
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff"
sha256 "35acd6aebc19843f1a2b3a63e880baceb0f5278ab1ace661e57a502d9d78c93c"
end
def install
args = ["--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-crypto-dl",
"--disable-apps-crypto-dl",
"--with-nss=no",
"--with-nspr=no",
"--enable-mscrypto=no",
"--enable-mscng=no",
"--with-openssl=#{Formula["openssl@1.1"].opt_prefix}"]
system "./configure", *args
system "make", "install"
end
test do
system "#{bin}/xmlsec1", "--version"
system "#{bin}/xmlsec1-config", "--version"
end
end
__END__
diff --git a/src/dl.c b/src/dl.c
index 6e8a56a..0e7f06b 100644
--- a/src/dl.c
+++ b/src/dl.c
@@ -141,6 +141,7 @@ xmlSecCryptoDLLibraryCreate(const xmlChar* name) {
}
#ifdef XMLSEC_DL_LIBLTDL
+ lt_dlsetsearchpath("HOMEBREW_PREFIX/lib");
lib->handle = lt_dlopenext((char*)lib->filename);
if(lib->handle == NULL) {
xmlSecError(XMLSEC_ERRORS_HERE,
I've installed libxmlsec1
at 1.2.37
but still cannot get xmlsec
to work properly:
>>> import xmlsec
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/tmarshall/.pyenv/versions/3.10.6/envs/app/lib/python3.10/site-packages/xmlsec.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace (_xmlSecAddIDs)
I found this solution (works with libxmlsec1==1.3.1):
$(brew86 --prefix Python@3.10)/bin/python3.10 -m venv .venv
source .venv/bin/activate
export C_INCLUDE_PATH="$(brew86 --prefix libxml2)/include:$(brew86 --prefix libxmlsec1)/include:${C_INCLUDE_PATH}"
pip cache purge
python -m pip install xmlsec
# validate
python -c "import xmlsec"
Where brew86 is
alias brew86="arch -x86_64 /usr/local/bin/brew"
brew edit
seems 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
> brew uninstall libxmlsec1 Uninstalling /opt/homebrew/Cellar/libxmlsec1/1.3.1_1... (220 files, 7.5MB)
Download the last known good formula and shove it into
/tmp
> export DESIRED_SHA="7f35e6ede954326a10949891af2dba47bbe1fc17" # ⚠️ this wget call will fail if you haven't exported DESIRED_SHA as in the preceding line > wget -O /tmp/libxmlsec1.rb "https://raw.githubusercontent.com/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb" --2023-06-30 11:40:48-- https://raw.githubusercontent.com/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2932 (2.9K) [text/plain] Saving to: ‘/tmp/libxmlsec1.rb’ /tmp/libxmlsec1.rb 100%[=========================================================================================>] 2.86K --.-KB/s in 0s 2023-06-30 11:40:48 (25.9 MB/s) - ‘/tmp/libxmlsec1.rb’ saved [2932/2932]
Install the local copy of the last known good formula from
/tmp
> brew install --formula /tmp/libxmlsec1.rb ==> Fetching libxmlsec1 ==> Downloading https://ghcr.io/v2/homebrew/core/libxmlsec1/manifests/1.2.37 Already downloaded: /Users/daniel/Library/Caches/Homebrew/downloads/0cff6c77c178a7b4826e3146309166ec9d19a0a6580d47e5a1ebaf367cd6c7d0--libxmlsec1-1.2.37.bottle_manifest.json ==> Downloading https://ghcr.io/v2/homebrew/core/libxmlsec1/blobs/sha256:26d6ebddf4e97431819583ad699228360886d81786b332084693d0ad34aa2c72 ####################################################################################################################################################################### 100.0% Warning: libxmlsec1 1.3.1_1 is available and more recent than version 1.2.37. ==> Pouring libxmlsec1--1.2.37.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/libxmlsec1/1.2.37: 221 files, 6MB ==> Running `brew cleanup libxmlsec1`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). Removing: /Users/daniel/Library/Caches/Homebrew/libxmlsec1--1.2.37... (1.2MB)
Thanks a lot, that worked for me!
For MacPorts users:
sudo port install xmlsec-1.2
PKG_CONFIG_PATH=/opt/local/lib/xmlsec-1.2/lib/pkgconfig pip install xmlsec
In case it helps anyone, I ran into two issues with the workaround @D3X posted above:
Invalid tap name
when running brew tap-new $USER/local
My $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: 404
when running brew install $USER/local/libxmlsec1@1.2.37
. The xmlsec tarball that brew downloads has moved into the older-releases
directory with the release of version 1.2.38, so I needed to change the URL in the libxmlsec1.rb file.This worked for me:
MYNAME=neruson
brew tap-new $MYNAME/local
brew extract --version=1.2.37 libxmlsec1 $MYNAME/local
sed -i '' 's^/xmlsec/download/^/xmlsec/download/older-releases/^g' /opt/homebrew/Library/Taps/$MYNAME/homebrew-local/Formula/libxmlsec1@1.2.37.rb
brew uninstall libxmlsec1
brew install $MYNAME/local/libxmlsec1@1.2.37
In case it helps anyone, I ran into two issues with the workaround @D3X posted above
Ugh, it's so annoying that this issue has been open for so long the workarounds stop working... Thanks for posting an updated solution!
For Windows. I couldn't find a work around hence used WSL
I installed Ubuntu 22.04 on WSL and tried installing xmlsec there. But again same kind of issue.
Installed brew in Ubuntu, and followed the same workaround as written in comment
Now, I could install xmlsec.
Hopefully, in new version these issues with different platforms will be taken care.
Shell one liner of @amir0ff's fix.
brew uninstall libxmlsec1
export DESIRED_SHA="7f35e6ede954326a10949891af2dba47bbe1fc17"
wget -O /tmp/libxmlsec1.rb "https://raw.githubusercontent.com/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb"
brew install --formula /tmp/libxmlsec1.rb
I am using 2,3 GHz Quad-Core Intel Core i7 with macOS 13.4.1. For me the workaround was https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-1511135314 with a combination of https://stackoverflow.com/a/76639165
brew edit
seems 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
> brew uninstall libxmlsec1 Uninstalling /opt/homebrew/Cellar/libxmlsec1/1.3.1_1... (220 files, 7.5MB)
Download the last known good formula and shove it into
/tmp
> export DESIRED_SHA="7f35e6ede954326a10949891af2dba47bbe1fc17" # ⚠️ this wget call will fail if you haven't exported DESIRED_SHA as in the preceding line > wget -O /tmp/libxmlsec1.rb "https://raw.githubusercontent.com/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb" --2023-06-30 11:40:48-- https://raw.githubusercontent.com/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2932 (2.9K) [text/plain] Saving to: ‘/tmp/libxmlsec1.rb’ /tmp/libxmlsec1.rb 100%[=========================================================================================>] 2.86K --.-KB/s in 0s 2023-06-30 11:40:48 (25.9 MB/s) - ‘/tmp/libxmlsec1.rb’ saved [2932/2932]
Install the local copy of the last known good formula from
/tmp
> brew install --formula /tmp/libxmlsec1.rb ==> Fetching libxmlsec1 ==> Downloading https://ghcr.io/v2/homebrew/core/libxmlsec1/manifests/1.2.37 Already downloaded: /Users/daniel/Library/Caches/Homebrew/downloads/0cff6c77c178a7b4826e3146309166ec9d19a0a6580d47e5a1ebaf367cd6c7d0--libxmlsec1-1.2.37.bottle_manifest.json ==> Downloading https://ghcr.io/v2/homebrew/core/libxmlsec1/blobs/sha256:26d6ebddf4e97431819583ad699228360886d81786b332084693d0ad34aa2c72 ####################################################################################################################################################################### 100.0% Warning: libxmlsec1 1.3.1_1 is available and more recent than version 1.2.37. ==> Pouring libxmlsec1--1.2.37.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/libxmlsec1/1.2.37: 221 files, 6MB ==> Running `brew cleanup libxmlsec1`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). Removing: /Users/daniel/Library/Caches/Homebrew/libxmlsec1--1.2.37... (1.2MB)
For M2 (Silicon chip) I had to run:
arch -arm64 brew install --formula /tmp/libxmlsec1.rb
@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?
A "better" (cleaner) workaround is to create a local tap and extract the previous version, like so:
brew tap-new $USER/local brew extract --version=1.2.37 libxmlsec1 $USER/local brew uninstall libxmlsec1 brew install $USER/local/libxmlsec1@1.2.37
Once
python-xmlsec
is updated to supportlibxmlsec1
1.3+, you can uninstall the extracted version and remove the tap by doing:brew uninstall $USER/local/libxmlsec1@1.2.37 brew untap $USER/local
I prefer this method. However I ran into this error when I ran these commands:
==> Downloading https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.37.tar.gz
curl: (22) The requested URL returned error: 404
Error: libxmlsec1@1.2.37: Failed to download resource "libxmlsec1@1.2.37"
Download failed: https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.37.tar.gz
The package's URL has now changed. It is present in older-releases
. To fix this, run the following command:
brew edit $USER/local/libxmlsec1@1.2.37
And make the following changes:
...
#url "https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.37.tar.gz"
url "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.37.tar.gz"
...
Once these changes are complete, you can re-run the following to complete installation:
brew install $USER/local/libxmlsec1@1.2.37
It’s been a year and the issue is still not fixed on macos, requiring the user to use the abovementionned work-around Any hope to have the xmlsec build fixed at some point ?
I have this same issue. Is there any luck this would be fixed in the package without us having to resort to a workaround for MacOS?
Same issue here. Its used in several SAML solutions, hampering implementation of single sign on modules
Op wo 17 apr 2024 om 13:27 schreef David Z Quartz @.***>
I have this same issue. Is there any luck this would be fixed in the package without us having to resort to a workaround for MacOS?
— Reply to this email directly, view it on GitHub https://github.com/xmlsec/python-xmlsec/issues/254#issuecomment-2061040212, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRXHZ6UXHSOZLLEUSRURK3Y5ZMBVAVCNFSM6AAAAAAW5S7VYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRRGA2DAMRRGI . You are receiving this because you commented.Message ID: @.***>
This is gonna be resolved in the new version, see https://github.com/xmlsec/python-xmlsec/issues/284
I'm still having this issue, is it meant to be fixed?
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 topip install xmlsec
since. Any idea what might this be? I have below dependencies installedThe error that I am getting