-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python :: pipy install on ubuntu 20.04 does not find the libs #1668
Comments
I would say two things (in decreasing order of relevance):
xrootd/.github/workflows/build.yml Lines 282 to 291 in 2c43d2e
(maybe in
xrootd/.github/workflows/build.yml Line 252 in 2c43d2e
I would assume that the default version of $ docker run --rm -ti ubuntu:20.04 /bin/bash
root@be875f1dd958:/# apt update -y && apt install -y python3 python3-dev python3-venv python3-pip
root@be875f1dd958:/# python3 -m pip list
Package Version
---------- -------
pip 20.0.2
setuptools 45.2.0
wheel 0.34.2
root@be875f1dd958:/# What version of |
hi @matthewfeickert ! so, first i made sure that i have:
also
so, answering by points:
Thanks a lot! |
This has a complicated answer, that I don't know if I can give a good summary to beyond showing it (as I think this also gets down into the fundamental differences about where Debian and RHEL place things), but this comes down to how different OS define and treat the user site. I would also highly recommend reading the There is nothing special about In general I personally recommend avoiding
Hm. This is strange given that you have sufficient versions, yet they are not being found. My suggestion is that you replicate this error in a Docker build in |
It's strange that you have Ah, I see that you did an I suspect a lot of these problems stem from installing into the user site rather than using a virtual-env. Once you break your environment, it can be tricky to fix it by hand (vs just wiping and starting over). Also, you generally do not want to update your system-managed packages (like Out of curiosity, what does $ objdump -x /home/user/.local/lib/python3.6/site-packages/pyxrootd/client.cpython-36m-x86_64-linux-gnu.so | grep RPATH
RPATH $ORIGIN/lib64 |
@matthewfeickert @agoose77 thanks a lot for all the info and taking time to look over this! i never used/had to use virtual-env on rhel family as i did not needed and also this is my first encounter with debian family (beside googling "how to install packages on ubuntu" and install some packages on the machines of my colleagues)
@agoose77 so, the answers:
BUT OTOH the situation is identical on fedora 35 and everything just works:
so, at this moment i just need to establish if it is my problem that what works on centos/fedora does not work on ubuntu, or is a packaging problem (i mean, if someone do pip install xrootd at least it should receive a message that: on ubuntu this will not work, install only in a virtual env or just refuse to install with the reason of virtual env not detected..) |
@adriansev (It is late for me so I will respond to the specifics about package management later, but...) looking at your problem again I think I now understand two things:
Am I correct on both of those things? If so, then take a look at the following building Dockerfile:N.B.: the addition of ARG BASE_IMAGE=debian:bullseye
FROM ${BASE_IMAGE} as base
SHELL [ "/bin/bash", "-c" ]
ENV PATH=/usr/local/venv/bin:"${PATH}"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
git \
cmake \
uuid-dev \
dpkg-dev \
libssl-dev \
libx11-dev \
libxml2-dev \
libkrb5-dev \
libgsl0-dev \
pkg-config \
python3 \
python3-pip \
python3-venv \
python3-dev && \
apt-get autoclean -y && \
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python3 -m pip list
WORKDIR /code/
ENV LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"
# Install XRootD v5.4.2 with no Python bindings so that libraries exist
RUN git clone --depth 1 https://github.com/xrootd/xrootd \
--branch v5.4.2 \
--single-branch && \
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/ \
-S xrootd \
-B build && \
cmake build -LH && \
cmake \
--build build \
--clean-first \
--parallel $(($(nproc) - 1)) && \
cmake --build build --target install && \
command -v xrootd && \
command -v xrdcp && \
xrdcp --version
WORKDIR /
# Show --user even though I don't recommend it just to show it works
RUN python3 -m pip --no-cache-dir install --user --upgrade pip setuptools wheel && \
python3 -m pip install --user --verbose 'xrootd==5.4.2' && \
python3 -m pip list
RUN python3 -m pip list && \
python3 -m pip show xrootd && \
python3 -c 'import XRootD; print(XRootD)' && \
python3 -c 'import pyxrootd; print(pyxrootd)' && \
python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
WORKDIR /
CMD ["/bin/bash"] If you build it with docker build . -f Dockerfile -t xrootd/xrootd:issue-1668 then $ docker run --rm -ti xrootd/xrootd:issue-1668
root@e864a61b3442:/# python3 -m pip list
Package Version
---------- -------
pip 22.0.4
setuptools 62.0.0
wheel 0.37.1
xrootd 5.4.2
root@e864a61b3442:/# python3 -m pip show xrootd
Name: xrootd
Version: 5.4.2
Summary: XRootD Python bindings
Home-page: http://xrootd.org
Author: XRootD Developers
Author-email: xrootd-dev@slac.stanford.edu
License: LGPLv3+
Location: /root/.local/lib/python3.9/site-packages/xrootd-5.4.2-py3.9-linux-x86_64.egg
Requires:
Required-by:
root@e864a61b3442:/# python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
<XRootD.client.filesystem.FileSystem object at 0x7f8c7fa9af40>
root@e864a61b3442:/# |
Virtual Environments
There are three main benefits to virtual environments CompatibilityThe difference is more pronounced when you have multiple environments. Even if you're only ever using one environment, though, there are similar benefits. If you have Python tools (e.g. Related to this is SafetySometimes you can break your environment, especially when using Python VersionWith Conda environments (or virtualenvs if you use something like
|
@matthewfeickert thanks for answering at such a hour! but this is just a leisure conversation, we can discuss this whenever :)
also, it seems that i have all the required dependencies used by the Dockerfile |
OK, I took a deeper look at this, and I've realised that the build chain is a lot more complicated than I expected. The sdist on PyPI is a "pseudo package" that has its own I first tested on Scientific Linux (Python 3.6), and it seems that there The installed layouts on Ubuntu is:
|
Correct, as it is done as part of the CI in a xrootd/.github/workflows/build.yml Lines 635 to 644 in cdb6b22
So I guess we need to understand what isn't being set right in Debian based systems. I also didn't do a good enough job showing last night (sorry, probably better to just not post at all late at night) that the Dockerfile I shared was to demonstrate that the libraries being found is the core problem that is being faced.
Yeah, while I don't think I will be the person to spend time revising the build system, it would be great to see a more modern approach (e.g. |
@adriansev @agoose77 Yeah, this
works. In a Dockerfile you need to manually set this though as Dockerfile:ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE} as base
SHELL [ "/bin/bash", "-c" ]
ENV PATH=/usr/local/venv/bin:"${PATH}"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
git \
cmake \
uuid-dev \
dpkg-dev \
libssl-dev \
libx11-dev \
libxml2-dev \
libkrb5-dev \
libgsl0-dev \
pkg-config \
python3 \
python3-pip \
python3-venv \
python3-dev && \
apt-get autoclean -y && \
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python3 -m pip list
WORKDIR /
# export LD_LIBRARY_PATH="$(python3 -m site --user-site)/pyxrootd/lib:${LD_LIBRARY_PATH}"
ENV LD_LIBRARY_PATH="/root/.local/lib/python3.8/site-packages/pyxrootd/lib:${LD_LIBRARY_PATH}"
# Show --user even though I don't recommend it just to show it works
RUN python3 -m pip --no-cache-dir install --user --upgrade pip setuptools wheel && \
python3 -m pip install --user --verbose 'xrootd==5.4.2' && \
python3 -m pip list
RUN python3 -m pip list && \
python3 -m pip show xrootd && \
python3 -c 'import XRootD; print(XRootD)' && \
python3 -c 'import pyxrootd; print(pyxrootd)' && \
python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
CMD ["/bin/bash"]
$ docker run --rm -ti xrootd/xrootd:issue-1668
root@e63fb03decdb:/# python3 -m pip list
Package Version
---------- -------
pip 22.0.4
setuptools 60.9.3
wheel 0.37.1
xrootd 5.4.2
root@e63fb03decdb:/# python3 -m pip show xrootd
Name: xrootd
Version: 5.4.2
Summary: XRootD Python bindings
Home-page: http://xrootd.org
Author: XRootD Developers
Author-email: xrootd-dev@slac.stanford.edu
License: LGPLv3+
Location: /root/.local/lib/python3.8/site-packages/xrootd-5.4.2-py3.8-linux-x86_64.egg
Requires:
Required-by:
root@e63fb03decdb:/# python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
<XRootD.client.filesystem.FileSystem object at 0x7fc3038794c0>
root@e63fb03decdb:/# So yeah, the key thing here is: ensure the libraries are on Dockerfile using a virtual environment:ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE} as base
SHELL [ "/bin/bash", "-c" ]
ENV PATH=/usr/local/venv/bin:"${PATH}"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
git \
cmake \
uuid-dev \
dpkg-dev \
libssl-dev \
libx11-dev \
libxml2-dev \
libkrb5-dev \
libgsl0-dev \
pkg-config \
python3 \
python3-pip \
python3-venv \
python3-dev && \
apt-get autoclean -y && \
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python3 -m pip list
WORKDIR /
# Set PATH to pickup virtualenv by default
ENV PATH=/usr/local/venv/bin:"${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/venv/lib/python3.8/site-packages/pyxrootd/lib:${LD_LIBRARY_PATH}"
RUN python3 -m venv /usr/local/venv && \
. /usr/local/venv/bin/activate && \
python -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python -m pip install --verbose 'xrootd==5.4.2' && \
python -m pip list
RUN python -m pip list && \
python -m pip show xrootd && \
python -c 'import XRootD; print(XRootD)' && \
python -c 'import pyxrootd; print(pyxrootd)' && \
python -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
CMD ["/bin/bash"] |
@matthewfeickert setting
That sounds like the best way to kill two birds with one stone :) |
Agreed — definitely a "get things working now" approach (though I've become far too used to having to update |
To expand on this a bit using the Dockerfile built with a virtual environment image: $ docker run --rm -ti xrootd/xrootd:issue-1668 /bin/bash -c 'objdump -x $(find -L /usr/local/venv/lib -type f -iname "libXrdUtils.so.3") | grep RUNPATH'
RUNPATH $ORIGIN and as xrootd/bindings/python/setup.py.in Lines 29 to 30 in 3b34050
where xrootd/bindings/python/CMakeLists.txt Lines 12 to 16 in 4e9b15d
which was all set in 6fba5b0, so maybe @simonmichal has some general thoughts or recommendations here on how to get edit: As @agoose77 pointed out earlier though, if you make a similar Dockerfile for CentOS7, it will work right away and have Dockerfile based on CentOS 7:ARG BASE_IMAGE=gitlab-registry.cern.ch/linuxsupport/cc7-base:latest
FROM ${BASE_IMAGE} as base
SHELL [ "/bin/bash", "-c" ]
RUN yum update -y && \
yum install -y \
cmake3 \
make \
krb5-devel \
libuuid-devel \
libxml2-devel \
openssl-devel \
systemd-devel \
zlib-devel \
devtoolset-7-gcc-c++ \
python3-devel \
python3-setuptools \
git \
cppunit-devel && \
yum clean all && \
python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
WORKDIR /
# Set PATH to pickup virtualenv by default
ENV PATH=/usr/local/venv/bin:"${PATH}"
RUN source scl_source enable devtoolset-7 && \
python3 -m venv /usr/local/venv && \
. /usr/local/venv/bin/activate && \
python -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python -m pip install --verbose 'xrootd==5.4.2' && \
python -m pip list
RUN python -m pip list && \
python -m pip show xrootd && \
python -c 'import XRootD; print(XRootD)' && \
python -c 'import pyxrootd; print(pyxrootd)' && \
python -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
SHELL [ "/usr/bin/scl", "enable", "devtoolset-7", "/bin/bash", "-c"] $ docker run --rm -ti xrootd/xrootd:issue-1668-centos /bin/bash -c 'objdump -x $(find -L /usr/local/venv/lib -type f -iname "libXrdUtils.so.3") | grep PATH'
RPATH $ORIGIN |
Hi @matthewfeickert @agoose77 so, (with the stressed disclaimer that i still lack a lot of knowledge about the python ecosystem) i found these bits of info:
Thanks a lot! |
I think
|
well, the weird thing is this: on both ubuntu and fedora XRootD directory is placed in
the rest of pyxrootd (with lib{,64} and include and share) is still found in the core of weirdness is that while they have the same locations, on fedora there are no problems while ubuntu needs that LD_LIBRARY_PATH export |
Yes, it's the same layout that is problematic. I only looked at this superficially, but upon closer inspection it looks as though it's the However, on forcing these versions on Ubuntu I don't see any change in behaviour. Time to properly drill down into what's happening here. |
i was looking over https://setuptools.pypa.io/en/latest/history.html and there are a number
|
Issue #1579 and PR #1586 were meant to address most of this, and in CI we can see that they are working as expected. Though these focused on CMake builds, and the only builds that test the install purely from the sdist are for CentOS 7. Though this seems to be an issue with what is actually getting packaged and put up on PyPI (which if you look is just a tarfile of the whole repo, and not a normal sdist). There is something wrong with the PyPI version, as compare the following builds on Ubuntu where you install from PyPI Dockerfile with PyPI install:ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE} as base
SHELL [ "/bin/bash", "-c" ]
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
git \
cmake \
uuid-dev \
dpkg-dev \
libssl-dev \
libx11-dev \
libxml2-dev \
libkrb5-dev \
libgsl0-dev \
pkg-config \
tree \
python3 \
python3-pip \
python3-venv \
python3-dev && \
apt-get autoclean -y && \
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python3 -m pip list
WORKDIR /
# Set PATH to pickup virtualenv by default
ENV PATH=/usr/local/venv/bin:"${PATH}"
ENV LD_LIBRARY_PATH="/usr/local/venv/lib/python3.8/site-packages/pyxrootd/lib:${LD_LIBRARY_PATH}"
RUN python3 -m venv /usr/local/venv && \
. /usr/local/venv/bin/activate && \
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python3 -m pip install --verbose 'xrootd==5.4.2' && \
python3 -m pip list
RUN python3 -m pip list && \
python3 -m pip show xrootd && \
python3 -c 'import XRootD; print(XRootD)' && \
python3 -c 'import pyxrootd; print(pyxrootd)' && \
python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
WORKDIR /
CMD ["/bin/bash"] layout with egg:
and where you install from the tarball you make with the Dockerfile for install from sdist from publish.sh:ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE} as base
SHELL [ "/bin/bash", "-c" ]
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
git \
cmake \
uuid-dev \
dpkg-dev \
libssl-dev \
libx11-dev \
libxml2-dev \
libkrb5-dev \
libgsl0-dev \
pkg-config \
tree \
python3 \
python3-pip \
python3-venv \
python3-dev && \
apt-get autoclean -y && \
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python3 -m pip list
# Set PATH to pickup virtualenv by default
ENV PATH=/usr/local/venv/bin:"${PATH}"
RUN python3 -m venv /usr/local/venv && \
. /usr/local/venv/bin/activate
WORKDIR /code
RUN git clone https://github.com/xrootd/xrootd \
--branch v5.4.2 \
--single-branch && \
cd xrootd && \
cp packaging/wheel/* . && \
./publish.sh && \
cd .. && \
python3 -m pip --verbose install xrootd/dist/xrootd-*.tar.gz && \
python3 -m pip list
RUN python3 -m pip list && \
python3 -m pip show xrootd && \
python3 -c 'import XRootD; print(XRootD)' && \
python3 -c 'import pyxrootd; print(pyxrootd)' && \
python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
WORKDIR /code
CMD ["/bin/bash"] site-packages layout with wheel:root@257f1f5fa793:~# ls /usr/local/venv/lib/python3.8/site-packages/
XRootD packaging pip-20.0.2.dist-info pyxrootd wheel
__pycache__ packaging-21.3.dist-info pkg_resources setuptools wheel-0.37.1.dist-info
build pep517 pkg_resources-0.0.0.dist-info setuptools-44.0.0.dist-info xrootd-5.4.2_.dist-info
build-0.7.0.dist-info pep517-0.12.0.dist-info pyparsing tomli
easy_install.py pip
root@257f1f5fa793:~# tree /usr/local/venv/lib/python3.8/site-packages/xrootd-5.4.2_.dist-info/
/usr/local/venv/lib/python3.8/site-packages/xrootd-5.4.2_.dist-info/
|-- METADATA
|-- RECORD
`-- WHEEL
0 directories, 3 files
root@257f1f5fa793:~# tree /usr/local/venv/lib/python3.8/site-packages/XRootD/
/usr/local/venv/lib/python3.8/site-packages/XRootD/
|-- __init__.py
|-- __pycache__
| `-- __init__.cpython-38.pyc
`-- client
|-- __init__.py
|-- __pycache__
| |-- __init__.cpython-38.pyc
| |-- _version.cpython-38.pyc
| |-- copyprocess.cpython-38.pyc
| |-- env.cpython-38.pyc
| |-- file.cpython-38.pyc
| |-- filesystem.cpython-38.pyc
| |-- finalize.cpython-38.pyc
| |-- flags.cpython-38.pyc
| |-- glob_funcs.cpython-38.pyc
| |-- responses.cpython-38.pyc
| |-- url.cpython-38.pyc
| `-- utils.cpython-38.pyc
|-- _version.py
|-- copyprocess.py
|-- env.py
|-- file.py
|-- filesystem.py
|-- finalize.py
|-- flags.py
|-- glob_funcs.py
|-- responses.py
|-- url.py
`-- utils.py
3 directories, 26 files
root@257f1f5fa793:~# tree /usr/local/venv/lib/python3.8/site-packages/pyxrootd/
/usr/local/venv/lib/python3.8/site-packages/pyxrootd/
|-- __init__.py
|-- __pycache__
| `-- __init__.cpython-38.pyc
|-- client.cpython-38-x86_64-linux-gnu.so
|-- include
| `-- xrootd
| |-- XProtocol
| | |-- XProtocol.hh
| | `-- XPtypes.hh
| |-- Xrd
| | |-- XrdBuffer.hh
| | |-- XrdJob.hh
| | |-- XrdLink.hh
| | |-- XrdLinkMatch.hh
| | |-- XrdProtocol.hh
| | |-- XrdScheduler.hh
| | `-- XrdTcpMonPin.hh
| |-- XrdCl
| | |-- XrdClAnyObject.hh
| | |-- XrdClBuffer.hh
| | |-- XrdClConstants.hh
| | |-- XrdClCopyProcess.hh
| | |-- XrdClDefaultEnv.hh
| | |-- XrdClEnv.hh
| | |-- XrdClFile.hh
| | |-- XrdClFileSystem.hh
| | |-- XrdClFileSystemUtils.hh
| | |-- XrdClLog.hh
| | |-- XrdClMonitor.hh
| | |-- XrdClOptional.hh
| | |-- XrdClPlugInInterface.hh
| | |-- XrdClPlugInManager.hh
| | |-- XrdClPropertyList.hh
| | |-- XrdClStatus.hh
| | |-- XrdClURL.hh
| | `-- XrdClXRootDResponses.hh
| |-- XrdHttp
| | `-- XrdHttpSecXtractor.hh
| |-- XrdNet
| | |-- XrdNet.hh
| | |-- XrdNetAddr.hh
| | |-- XrdNetAddrInfo.hh
| | |-- XrdNetCmsNotify.hh
| | |-- XrdNetConnect.hh
| | |-- XrdNetOpts.hh
| | |-- XrdNetSockAddr.hh
| | |-- XrdNetSocket.hh
| | `-- XrdNetUtils.hh
| |-- XrdOuc
| | |-- XrdOucBuffer.hh
| | |-- XrdOucCRC.hh
| | |-- XrdOucCacheCM.hh
| | |-- XrdOucCacheStats.hh
| | |-- XrdOucCallBack.hh
| | |-- XrdOucChain.hh
| | |-- XrdOucCompiler.hh
| | |-- XrdOucDLlist.hh
| | |-- XrdOucEnum.hh
| | |-- XrdOucEnv.hh
| | |-- XrdOucErrInfo.hh
| | |-- XrdOucGMap.hh
| | |-- XrdOucHash.hh
| | |-- XrdOucHash.icc
| | |-- XrdOucIOVec.hh
| | |-- XrdOucLock.hh
| | |-- XrdOucName2Name.hh
| | |-- XrdOucPinObject.hh
| | |-- XrdOucPinPath.hh
| | |-- XrdOucRash.hh
| | |-- XrdOucRash.icc
| | |-- XrdOucSFVec.hh
| | |-- XrdOucStream.hh
| | |-- XrdOucString.hh
| | |-- XrdOucTList.hh
| | |-- XrdOucTable.hh
| | |-- XrdOucTokenizer.hh
| | |-- XrdOucTrace.hh
| | |-- XrdOucUtils.hh
| | `-- XrdOuca2x.hh
| |-- XrdSec
| | |-- XrdSecAttr.hh
| | |-- XrdSecEntity.hh
| | |-- XrdSecEntityAttr.hh
| | |-- XrdSecEntityPin.hh
| | `-- XrdSecInterface.hh
| |-- XrdSys
| | |-- XrdSysAtomics.hh
| | |-- XrdSysError.hh
| | |-- XrdSysFD.hh
| | |-- XrdSysHeaders.hh
| | |-- XrdSysLogPI.hh
| | |-- XrdSysLogger.hh
| | |-- XrdSysPageSize.hh
| | |-- XrdSysPlatform.hh
| | |-- XrdSysPlugin.hh
| | |-- XrdSysPthread.hh
| | |-- XrdSysSemWait.hh
| | |-- XrdSysTimer.hh
| | |-- XrdSysXAttr.hh
| | `-- XrdSysXSLock.hh
| |-- XrdVersion.hh
| |-- XrdXml
| | `-- XrdXmlReader.hh
| |-- XrdXrootd
| | |-- XrdXrootdBridge.hh
| | |-- XrdXrootdGStream.hh
| | `-- XrdXrootdMonData.hh
| `-- private
| |-- Xrd
| | `-- XrdPoll.hh
| |-- XrdCl
| | |-- XrdClArg.hh
| | |-- XrdClCtx.hh
| | |-- XrdClFileOperations.hh
| | |-- XrdClFileSystemOperations.hh
| | |-- XrdClFinalOperation.hh
| | |-- XrdClFwd.hh
| | |-- XrdClMessage.hh
| | |-- XrdClOperationHandlers.hh
| | |-- XrdClOperationTimeout.hh
| | |-- XrdClOperations.hh
| | |-- XrdClParallelOperation.hh
| | |-- XrdClPostMaster.hh
| | |-- XrdClPostMasterInterfaces.hh
| | |-- XrdClResponseJob.hh
| | |-- XrdClTransportManager.hh
| | |-- XrdClZipArchive.hh
| | |-- XrdClZipCache.hh
| | `-- XrdClZipOperations.hh
| |-- XrdNet
| | |-- XrdNetBuffer.hh
| | |-- XrdNetIF.hh
| | `-- XrdNetPeer.hh
| |-- XrdOuc
| | |-- XrdOucExport.hh
| | |-- XrdOucGatherConf.hh
| | |-- XrdOucN2NLoader.hh
| | `-- XrdOucPList.hh
| |-- XrdPosix
| | `-- XrdPosixMap.hh
| |-- XrdSecsss
| | `-- XrdSecsssID.hh
| |-- XrdSys
| | `-- XrdSysPriv.hh
| `-- XrdZip
| |-- XrdZipCDFH.hh
| |-- XrdZipEOCD.hh
| |-- XrdZipExtra.hh
| |-- XrdZipLFH.hh
| |-- XrdZipUtils.hh
| |-- XrdZipZIP64EOCD.hh
| `-- XrdZipZIP64EOCDL.hh
|-- lib
| |-- libXrdAppUtils.so -> libXrdAppUtils.so.2
| |-- libXrdAppUtils.so.2 -> libXrdAppUtils.so.2.0.0
| |-- libXrdAppUtils.so.2.0.0
| |-- libXrdCl.so -> libXrdCl.so.3
| |-- libXrdCl.so.3 -> libXrdCl.so.3.0.0
| |-- libXrdCl.so.3.0.0
| |-- libXrdClProxyPlugin-5.so
| |-- libXrdCrypto.so -> libXrdCrypto.so.2
| |-- libXrdCrypto.so.2 -> libXrdCrypto.so.2.0.0
| |-- libXrdCrypto.so.2.0.0
| |-- libXrdCryptoLite.so -> libXrdCryptoLite.so.2
| |-- libXrdCryptoLite.so.2 -> libXrdCryptoLite.so.2.0.0
| |-- libXrdCryptoLite.so.2.0.0
| |-- libXrdCryptossl-5.so
| |-- libXrdSec-5.so
| |-- libXrdSecProt-5.so
| |-- libXrdSecgsi-5.so
| |-- libXrdSecgsiAUTHZVO-5.so
| |-- libXrdSecgsiGMAPDN-5.so
| |-- libXrdSeckrb5-5.so
| |-- libXrdSecpwd-5.so
| |-- libXrdSecsss-5.so
| |-- libXrdSecunix-5.so
| |-- libXrdUtils.so -> libXrdUtils.so.3
| |-- libXrdUtils.so.3 -> libXrdUtils.so.3.0.0
| |-- libXrdUtils.so.3.0.0
| |-- libXrdXml.so -> libXrdXml.so.3
| |-- libXrdXml.so.3 -> libXrdXml.so.3.0.0
| `-- libXrdXml.so.3.0.0
`-- share
`-- man
|-- man1
| `-- xrdadler32.1
`-- man8
`-- mpxstats.8
27 directories, 161 files
root@257f1f5fa793:~# So for debugging I'd suggest not trying to use the files on PyPI given that they are somehow different from what the (To be clear, this should all be redone, but to make sure we're testing against the thing that matters (the source we can control now)). |
Ah, excellent point @matthewfeickert! |
Seems that you're not (wrong), @agoose77, as if you download this that is from the built Docker image that successfully installed the same distribution as a wheel, and then My takeaway from this is that the while the $ python -m pip install --upgrade pip twine
$ python -m pip download 'xrootd==5.4.2'
$ twine check xrootd-5.4.2.tar.gz
Checking xrootd-5.4.2.tar.gz: PASSED with warnings
WARNING `long_description_content_type` missing. defaulting to `text/x-rst`. it (so really the build system) needs to be revised to be more robust to the OS it is installed on. Though at this point you should just start shipping wheels. Maybe someone on the XRootD team (I assume from the |
Thanks for the detective work @matthewfeickert!
I spent a couple of minutes looking at moving to |
@adriansev just to follow up on your good point, while this is correct (for installs from PyPI only — CMake builds from source are fine with any version of If you simply just do
then this will work right out of the box on Ubuntu for Here's a Dockerfile showing that working without any Dockerfile for setuptools>60.0.0 on Ubuntu 20.04:ARG BASE_IMAGE=ubuntu:20.04
FROM ${BASE_IMAGE} as base
SHELL [ "/bin/bash", "-c" ]
ENV PATH=/usr/local/venv/bin:"${PATH}"
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
git \
cmake \
uuid-dev \
dpkg-dev \
libssl-dev \
libx11-dev \
libxml2-dev \
libkrb5-dev \
libgsl0-dev \
pkg-config \
tree \
python3 \
python3-pip \
python3-venv \
python3-dev && \
apt-get autoclean -y && \
python3 -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python3 -m pip list
WORKDIR /
# Show --user even though I don't recommend it just to show it works
RUN python3 -m pip --no-cache-dir install --user --upgrade pip 'setuptools>60.0.0' wheel && \
SETUPTOOLS_USE_DISTUTILS=stdlib python3 -m pip install --user --verbose 'xrootd==5.4.2' && \
python3 -m pip list
RUN python3 -m pip list && \
python3 -m pip show xrootd && \
python3 -c 'import XRootD; print(XRootD)' && \
python3 -c 'import pyxrootd; print(pyxrootd)' && \
python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
WORKDIR /
CMD ["/bin/bash"]
$ docker run --rm -ti xrootd/xrootd:issue-1668-setuptools-60-plus
root@debb0c80d455:/# python3 -m pip show xrootd
Name: xrootd
Version: 5.4.2-
Summary:
Home-page:
Author:
Author-email:
License:
Location: /root/.local/lib/python3.8/site-packages
Requires:
Required-by:
root@debb0c80d455:/# ls -lhtra /root/.local/lib/python3.8/site-packages
total 20K
drwxr-xr-x 3 root root 4.0K Apr 7 06:02 ..
drwxr-xr-x 2 root root 4.0K Apr 7 06:03 xrootd-5.4.2_.dist-info
drwxr-xr-x 6 root root 4.0K Apr 7 06:03 pyxrootd
drwxr-xr-x 4 root root 4.0K Apr 7 06:03 XRootD
drwx------ 5 root root 4.0K Apr 7 06:03 .
root@debb0c80d455:/# Future thoughtsThis should still be fixed though in a robust way. Note that these problems are happening because of the reliance on
As |
@adriansev @agoose77 Circling back to this very late, I think I have the start of an idea of the problem: The WheelIf you have a wheel then from your [root@e2b96418e2e5 site-packages]# tree -L 1 | grep -i "xrootd"
|-- XRootD
|-- pyxrootd
`-- xrootd-5.4.2-py3.6.egg-info
[root@e2b96418e2e5 site-packages]# tree -L 1 pyxrootd/
pyxrootd/
|-- __init__.py
|-- __pycache__
|-- client.cpython-36m-x86_64-linux-gnu.so
|-- include
|-- lib64
`-- share
4 directories, 2 files and the important thing is that the [root@e2b96418e2e5 site-packages]# cd pyxrootd/
[root@e2b96418e2e5 pyxrootd]# objdump -x client.cpython-36m-x86_64-linux-gnu.so | grep PATH
RPATH $ORIGIN/lib64
[root@e2b96418e2e5 pyxrootd]# ls -l lib64/libXrdCl.so.3
lrwxrwxrwx 1 root root 17 Apr 5 23:09 lib64/libXrdCl.so.3 -> libXrdCl.so.3.0.0
[root@e2b96418e2e5 site-packages]# cd
[root@e2b96418e2e5 ~]# python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
<XRootD.client.filesystem.FileSystem object at 0x7fd541df7f98> eggHowever, if you have an egg, then the layout changes and from your (venv) root@34321f613143:/code/venv/lib/python3.9/site-packages# tree -L 1 | grep -i "xrootd"
|-- pyxrootd
`-- xrootd-2022.415-py3.9-linux-x86_64.egg
(venv) root@34321f613143:/code/venv/lib/python3.9/site-packages# tree -L 2 xrootd-2022.415-py3.9-linux-x86_64.egg/
xrootd-2022.415-py3.9-linux-x86_64.egg/
|-- EGG-INFO
| |-- PKG-INFO
| |-- SOURCES.txt
| |-- dependency_links.txt
| |-- native_libs.txt
| |-- not-zip-safe
| `-- top_level.txt
|-- XRootD
| |-- __init__.py
| |-- __pycache__
| `-- client
`-- pyxrootd
|-- __init__.py
|-- __pycache__
|-- client.cpython-39-x86_64-linux-gnu.so
`-- client.py
6 directories, 10 files and now the (venv) root@34321f613143:/code/venv/lib/python3.9/site-packages# cd xrootd-2022.415-py3.9-linux-x86_64.egg/pyxrootd/
(venv) root@34321f613143:/code/venv/lib/python3.9/site-packages/xrootd-2022.415-py3.9-linux-x86_64.egg/pyxrootd# objdump -x client.cpython-39-x86_64-linux-gnu.so | grep PATH
RUNPATH $ORIGIN/../../pyxrootd/lib
(venv) root@34321f613143:/code/venv/lib/python3.9/site-packages/xrootd-2022.415-py3.9-linux-x86_64.egg/pyxrootd# ls -l ../../pyxrootd/lib/libXrdCl.so.3
lrwxrwxrwx 1 root root 17 Apr 15 06:44 ../../pyxrootd/lib/libXrdCl.so.3 -> libXrdCl.so.3.0.0
(venv) root@34321f613143:/code/venv/lib/python3.9/site-packages/xrootd-2022.415-py3.9-linux-x86_64.egg/pyxrootd# cd
(venv) root@34321f613143:~# python3 -c 'from XRootD import client; print(client.FileSystem("root://someserver:1094"))'
<XRootD.client.filesystem.FileSystem object at 0x7f5105ee12b0> This works without any Next question towards solutionAs the xrootd/bindings/python/CMakeLists.txt Lines 12 to 16 in 81e57b5
needs to be more robust and be able to determine what the layout will be and set the
So how to determine the layout in advance? Question after all of this is fixedWhy are wheels not working with SummaryI don't have a working fix yet, but I think this is actually understandable now. 👍 |
great analysis @matthewfeickert !! thanks a lot! |
Because I made a mistake in PR #1585 and xrootd/packaging/wheel/install.sh Lines 43 to 44 in 81e57b5
will always have from shutil import which :( I have fixes on my fork that implement this as well as other things that should make things fully CentOS7 ships very old If you are okay with that then I can simplify all of this xrootd/packaging/wheel/install.sh Lines 61 to 84 in 81e57b5
to 4 lines using |
@matthewfeickert kudos for finding the problem!! |
@adriansev I think it will actually be a non-issue, as by removing some additional code that was doing work that
I'll make a new PR later today (US time) and tag you both for review there. |
To further alleviate any concerns about the next sdist released on PyPI, here's an upload of an You can try to
and it will install just fine! So for
and get the Python bindings installed (as long as you have a valid CMake). 👍 |
@matthewfeickert Thanks a lot for your great work!!!
|
Great! Thank you for the independent check — the more machines tested the better. 🚀 And (unsurprisingly) things are working as expected on Ubuntu 22.04 Jammy Jellyfish too
👍 |
Hi! @matthewfeickert sorry to bother you again :) any idea why this still does not work?
AFAIR this was solved, but i just hit this up on a ubuntu 20.04 .. the output is here
The text was updated successfully, but these errors were encountered: