Skip to content

Unable to (pip install xmlsec) since brew version 4.0.13  #254

Description

@abdwebus

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

Activity

  1. dpritchett commented on Apr 13, 2023

    @dpritchett

    libxmlsec1 released v1.3.0 yesterday, guessing it's related 😵‍💫

    Release 1.3.0 on GitHub

  2. dpritchett commented on Apr 13, 2023

    @dpritchett

    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:

    https://github.com/raw/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb

    Specific workaround steps:

    1. brew edit libxmlsec1. An editor opens up, full of the contents of the latest downloaded xmlsec formula from GitHub or wherever they come from
    2. i paste in the contents of the last pre-1.3.0 brew formula
      and hit save
    3. Install that local formula: brew install /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/libxmlsec1.rb
    4. pip install xmlsec

    References

  3. dpritchett commented on Apr 13, 2023

    @dpritchett

    Here's the PR that removed soap from xmlsec back in November: lsh123/xmlsec#427

  4. abdwebus commented on Apr 13, 2023

    @abdwebus
    Author

    Thank you @dpritchett. Your workaround worked for me 👍

  5. dpritchett commented on Apr 13, 2023

    @dpritchett

    Hopefully #252 will be addressed soon so this can be fixed 🤞🏻

  6. johnnymetz commented on Apr 17, 2023

    @johnnymetz

    Per the workaround above, I had to run brew unlink libxmlsec1 in between steps 2 and 3 and it worked for me.

  7. D3X commented on Apr 17, 2023

    @D3X

    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!

  8. srivastavashobhit-sl commented on Apr 21, 2023

    @srivastavashobhit-sl

    @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.

  9. xibolun commented on Apr 26, 2023

    @xibolun

    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 : )

  10. dingxiong commented on Apr 27, 2023

    @dingxiong

    I need one more step

    cd /opt/homebrew/opt/
    ln -s libxmlsec1\@1.2.37 libxmlsec1
    
  11. orionsparks commented on Jun 9, 2023

    @orionsparks

    Anxiously awaiting this update on an M1.

  12. MattFisher commented on Jun 21, 2023

    @MattFisher

    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

  13. vdejager commented on Jun 28, 2023

    @vdejager

    I can confirm that downgrading to libxmlsec1 1.2.37 worked. 1.3.1 broke our SAML workflow completely

  14. dpritchett commented on Jun 28, 2023

    @dpritchett

    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://github.com/raw/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb"
    
    --2023-06-30 11:40:48--  https://github.com/raw/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)
  15. alexeocto commented on Jul 7, 2023

    @alexeocto

    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.

  16. 25 remaining items

  17. karthicraghupathi commented on Mar 21, 2024

    @karthicraghupathi

    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
    

    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
    
  18. wind-shift commented on Apr 16, 2024

    @wind-shift

    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 ?

  19. DavidQuartz commented on Apr 17, 2024

    @DavidQuartz

    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?

  20. vdejager commented on Apr 17, 2024

    @vdejager
  21. mxamin commented on Apr 17, 2024

    @mxamin
    Collaborator

    This is gonna be resolved in the new version, see #284

  22. added a commit that references this issue on Apr 23, 2024
  23. jffiorillo commented on Aug 29, 2024

    @jffiorillo

    I'm still having this issue, is it meant to be fixed?

  24. nachoaguirre commented on Oct 25, 2024

    @nachoaguirre

    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://github.com/raw/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb"
    
    --2023-06-30 11:40:48--  https://github.com/raw/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
    

    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"
    to
    depends_on "openssl@3"

  25. xu20160924 commented on Nov 1, 2024

    @xu20160924

    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://github.com/raw/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb"
    
    --2023-06-30 11:40:48--  https://github.com/raw/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
    

    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" to depends_on "openssl@3"

    openssl@1.1 is disabled, I face the same problem on this, the one more step needed in my situation is to add --build-from-source like this, that's worked for me

    brew install --formula /tmp/libxmlsec1.rb --build-from-source.
    
  26. spilth commented on Nov 7, 2024

    @spilth

    I'm encountering this on macOS right now and from everybody's collected solutions I landed on the following:

    1. Install Xcode
    2. Accept the Xcode license with sudo xcodebuild -license accept
    3. Install an older, customized version of libxmlsec1 built against OpenSSL 3 using Homebrew and pin it so it doesn't get upgraded:
    $ brew uninstall libxmlsec1
    $ mkdir tmp
    $ cd tmp
    $ vim libxmlsec1.rb # Or your preferred editor. See contents below
    $ brew install --formula libxmlsec1.rb
    $ brew pin libxmlsec1
    $ export LDFLAGS="-L$(brew --prefix openssl@3)/lib"
    $ export CPPFLAGS="-I$(brew --prefix openssl@3)/include"
    $ export PKG_CONFIG_PATH="$(brew --prefix openssl@3)/lib/pkgconfig"

    Contents for libxmlsec1.rb:

    # 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@3"
      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://github.com/raw/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@3"].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,
  27. utkarshdx commented on Dec 11, 2024

    @utkarshdx

    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://github.com/raw/Homebrew/homebrew-core/${DESIRED_SHA}/Formula/libxmlsec1.rb"
    
    --2023-06-30 11:40:48--  https://github.com/raw/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)
    

    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

  28. that-one-arab commented on Jul 14, 2025

    @that-one-arab

    I'm encountering this on macOS right now and from everybody's collected solutions I landed on the following:

    1. Install Xcode
    2. Accept the Xcode license with sudo xcodebuild -license accept
    3. Install an older, customized version of libxmlsec1 built against OpenSSL 3 using Homebrew and pin it so it doesn't get upgraded:

    $ brew uninstall libxmlsec1
    $ mkdir tmp
    $ cd tmp
    $ vim libxmlsec1.rb # Or your preferred editor. See contents below
    $ brew install --formula libxmlsec1.rb
    $ brew pin libxmlsec1
    $ export LDFLAGS="-L$(brew --prefix openssl@3)/lib"
    $ export CPPFLAGS="-I$(brew --prefix openssl@3)/include"
    $ export PKG_CONFIG_PATH="$(brew --prefix openssl@3)/lib/pkgconfig"
    Contents for libxmlsec1.rb:

    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@3"
    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://github.com/raw/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@3"].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,

    As of today, this is the definite hotfix for this problem.

  29. ethanhusband commented on Jul 28, 2025

    @ethanhusband

    I'm encountering this on macOS right now and from everybody's collected solutions I landed on the following:

    1. Install Xcode
    2. Accept the Xcode license with sudo xcodebuild -license accept
    3. Install an older, customized version of libxmlsec1 built against OpenSSL 3 using Homebrew and pin it so it doesn't get upgraded:

    $ brew uninstall libxmlsec1
    $ mkdir tmp
    $ cd tmp
    $ vim libxmlsec1.rb # Or your preferred editor. See contents below
    $ brew install --formula libxmlsec1.rb
    $ brew pin libxmlsec1
    $ export LDFLAGS="-L$(brew --prefix openssl@3)/lib"
    $ export CPPFLAGS="-I$(brew --prefix openssl@3)/include"
    $ export PKG_CONFIG_PATH="$(brew --prefix openssl@3)/lib/pkgconfig"
    Contents for libxmlsec1.rb:

    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@3"
    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://github.com/raw/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@3"].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,

    Just adding to this, I personally found issues making it link against openssl3 instead of 1.1, and got it working with these tweaks

    1. Modify the "url" section to include a debian mirror
    -  url "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.37.tar.gz"
    +  url "https://www.aleksey.com/xmlsec/download/older-releases/xmlsec1-1.2.37.tar.gz"
    +  mirror "https://deb.debian.org/debian/pool/main/x/xmlsec1/xmlsec1_1.2.37.orig.tar.gz"
    
    1. I was finding brew install --formula libxmlsec1.rb would just pull in the tap with openssl1.1 anyway, so instead I ran brew install --build-from-source ./libxmlsec1.rb. The above change is such that building from source works. When doing this it respected the openssl3 preference

    Hope this helps someone!

  30. tvuotila commented on Nov 6, 2025

    @tvuotila

    I made a tap to install libxmlsec1@1.2.37

    FYI I will delete my tap in near future as the tap is not needed anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions