Closed waranlogesh closed 3 years ago
Also experiencing this error when installing for Python 3.8 on AMI:
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
@waranlogesh I suppose you have multiple installations of libxmlsec1
: one via apt
, version 1.2.28 and one via linuxbrew
, version 1.2.32. pkg-config
shows flags for the lib version installed via apt
, while the 1.2.32 installed into /home/linuxbrew/.linuxbrew/Cellar/libxmlsec1/
is used for building. Using the version installed via apt
, the installation runs fine here:
$ docker run --rm -it ubuntu:20.04
# apt update && apt full-upgrade -y
# apt install libxml2-dev libxmlsec1-dev libxmlsec1-openssl python3-dev python3-pip python3-venv build-essential pkg-config
# python3 -m venv test
# source test/bin/activate
# pip install xmlsec
Collecting xmlsec
Using cached xmlsec-1.3.10.tar.gz (62 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Collecting lxml>=3.8
Using cached lxml-4.6.3-cp38-cp38-manylinux2014_x86_64.whl (6.8 MB)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (PEP 517) ... done
Created wheel for xmlsec: filename=xmlsec-1.3.10-cp38-cp38-linux_x86_64.whl size=196004 sha256=642296850f73c804542bb9ad3cfc0289fd37c23f431804cbc231a2acfce179e2
Stored in directory: /root/.cache/pip/wheels/39/89/be/839edc5b5c73c980be0a9093d0e5df9681848b92e2541b9b25
Successfully built xmlsec
Installing collected packages: lxml, xmlsec
Successfully installed lxml-4.6.3 xmlsec-1.3.10
@hoefling Thanks for the response. I was able to install using libxmlsec1 from apt.
Is there any way we can have compatibility with the homebrew version?
@waranlogesh I don't know how linuxbrew
builds the libraries and honestly don't have time to look into it, but at least xmlsec1
build looks broken to me. To reproduce your error from above:
$ docker run --rm -it linuxbrew/brew:latest
# su linuxbrew
$ export PATH=/home/linuxbrew/.linuxbrew/bin:$PATH
$ brew update
$ brew install python gcc libxml2 libxmlsec1 pkg-config
$ gcc-11 $(pkg-config --cflags xmlsec1) $(pkg-config --libs xmlsec1) tst.c -o tst
tst.c: In function 'main':
tst.c:4:16: error: 'xmlSecTransformXsltId' undeclared (first use in this function); did you mean 'xmlSecTransformXPathId'?
4 | printf("%s", xmlSecTransformXsltId);
| ^~~~~~~~~~~~~~~~~~~~~
| xmlSecTransformXPathId
tst.c:4:16: note: each undeclared identifier is reported only once for each function it appears in
with tst.c
being simply
#include <xmlsec/transforms.h>
int main() {
printf("test: %p\n", xmlSecTransformXsltId);
return 0;
}
This indicates xmlSecTransformXsltId
is not available, thus it isn't possible to build the bindings. Most likely a misconfigured library build in the first place. This isn't the case if I build the lib in e.g. a fedora:rawhide
container, using xmlsec1.spec
with version number patched to 1.2.32. You can report the issue upstream if you wish; I will leave this issue open for now anyway.
@waranlogesh after I got some sleep - actually it's because the libxmlsec1
is built without XSLT support, and xmlsec
code doesn't distinct between both variants. I will add compile-time checks for XMLSEC_NO_XSLT
and disable the relevant functionality. Good catch!
Thank you @hoefling
@waranlogesh this should be fixed in #173. If you want, you can test by installing from the PR:
$ pip install git+https://github.com/mehcode/python-xmlsec.git@refs/pull/173/merge
@waranlogesh this should be fixed in #173. If you want, you can test by installing from the PR:
$ pip install git+https://github.com/mehcode/python-xmlsec.git@refs/pull/173/merge
Great. This works.
❯ pip install git+https://github.com/mehcode/python-xmlsec.git@refs/pull/173/merge
Collecting git+https://github.com/mehcode/python-xmlsec.git@refs/pull/173/merge
Cloning https://github.com/mehcode/python-xmlsec.git (to revision refs/pull/173/merge) to /tmp/pip-req-build-y9iofssx
Running command git clone -q https://github.com/mehcode/python-xmlsec.git /tmp/pip-req-build-y9iofssx
WARNING: Did not find branch or tag 'refs/pull/173/merge', assuming revision or ref.
Running command git fetch -q https://github.com/mehcode/python-xmlsec.git refs/pull/173/merge
Running command git checkout -q 892d33497fcac7f27cc2da67e5399c4902bcd576
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Requirement already satisfied: lxml>=3.8 in ./.venv/lib/python3.6/site-packages (from xmlsec==1.3.11.dev6+g892d334) (4.6.3)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (PEP 517) ... done
Created wheel for xmlsec: filename=xmlsec-1.3.11.dev6+g892d334-cp36-cp36m-linux_x86_64.whl size=184997 sha256=392f1258f88d14e6313444612a76ef8b9d8515ce88545638f932e61dc73dd312
Stored in directory: /tmp/pip-ephem-wheel-cache-ey3w4ecu/wheels/c1/71/ce/99d7d4709ebeaeb531bf298d24bbe321adf8b23ecdf23e58ee
Successfully built xmlsec
Installing collected packages: xmlsec
Successfully installed xmlsec-1.3.11.dev6+g892d334
@waranlogesh awesome, thank you for testing!
Version of
xmlsec
- 1.3.10Version of
libxmlsec1
Version of
libxml2
Output from the command pkg-config --cflags xmlsec1
pip error log