Print

Print


@simonmichal Thanks for following up on this. Unfortunatley, using

https://github.com/xrootd/xrootd/blob/30c0899254fa28a58548c0f939b1046bba623163/packaging/wheel/install.sh#L41

still produces the undesired behavior of using `easy-install.pth`.

As an example, if we take the `Dockerfile` in [my example Gist](https://gist.github.com/matthewfeickert/6ff43901c7a76e07b5b92620be1496c5) and tell it to use 30c0899254fa28a58548c0f939b1046bba623163


```diff
$ git diff
diff --git a/Dockerfile b/Dockerfile
index 07e9053..1d7c59a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,7 +17,7 @@ RUN apt-get -qq -y update && \
     python -m pip list && \
     printf '\nexport PATH=/usr/local/venv/bin:"${PATH}"\n' >> /root/.bashrc
 
-ARG XROOTD_TAG=v5.4.0
+ARG XROOTD_TAG=master
 ARG SETUPTOOLS_VERSION=60.0.0
 WORKDIR /code
 RUN . /usr/local/venv/bin/activate && \
@@ -26,6 +26,9 @@ RUN . /usr/local/venv/bin/activate && \
       --branch "${XROOTD_TAG}" \
       --single-branch \
       xrootd && \
+    pushd xrootd && \
+    git reset --hard 30c0899254fa28a58548c0f939b1046bba623163 && \
+    popd && \
     cmake \
         -DCMAKE_INSTALL_PREFIX=/usr/local/venv \
         -S xrootd \
diff --git a/Makefile b/Makefile
index 74ea534..a825e07 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,6 @@ debug_image_fail:
        docker build . \
        -f Dockerfile \
        --build-arg BASE_IMAGE=$(BASE_IMAGE) \
-       --build-arg XROOTD_TAG=v5.4.0 \
+       --build-arg XROOTD_TAG=master \
        --build-arg SETUPTOOLS_VERSION=60.0.0 \
        --tag xrootd-debug:debug-fail
```

building gives the following warnings during the install section

```
/usr/local/venv/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/local/venv/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
/usr/local/venv/lib/python3.9/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: v20220106-30c0899 is an invalid version and will not be supported in a future release
  warnings.warn(
```

<details>
<summary>fuller log section that contains those warnings:</summary>

```
-- Processing: //usr/local/venv/share/man/man1/xrdmapc.1
/usr/local/venv/lib/python3.9/site-packages/setuptools/dist.py:507: UserWarning: The version specified ('v20220106-30c0899') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  warnings.warn(
XRootD library dir:     /code/build/src
XRootD src include dir: /code/xrootd/src
XRootD bin include dir: /code/build/src
Version:                v20220106-30c0899
running install
/usr/local/venv/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/local/venv/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
/usr/local/venv/lib/python3.9/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: v20220106-30c0899 is an invalid version and will not be supported in a future release
  warnings.warn(
running egg_info
creating xrootd.egg-info
writing manifest file 'xrootd.egg-info/SOURCES.txt'
writing manifest file 'xrootd.egg-info/SOURCES.txt'
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/pyxrootd
copying /code/xrootd/bindings/python/src/__init__.py -> build/lib.linux-x86_64-3.9/pyxrootd
creating build/lib.linux-x86_64-3.9/XRootD
copying /code/xrootd/bindings/python/libs/__init__.py -> build/lib.linux-x86_64-3.9/XRootD
creating build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/finalize.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/responses.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/_version.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/__init__.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/env.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/flags.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/filesystem.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/url.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/copyprocess.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/utils.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/file.py -> build/lib.linux-x86_64-3.9/XRootD/client
copying /code/xrootd/bindings/python/libs/client/glob_funcs.py -> build/lib.linux-x86_64-3.9/XRootD/client
running build_ext
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/code
creating build/temp.linux-x86_64-3.9/code/xrootd
creating build/temp.linux-x86_64-3.9/code/xrootd/bindings
creating build/temp.linux-x86_64-3.9/code/xrootd/bindings/python
creating build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/code/xrootd/src -I/code/build/src -I/usr/local/venv/include -I/usr/local/include/python3.9 -c /code/xrootd/bindings/python/src/PyXRootDCopyProcess.cc -o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDCopyProcess.o -g
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/code/xrootd/src -I/code/build/src -I/usr/local/venv/include -I/usr/local/include/python3.9 -c /code/xrootd/bindings/python/src/PyXRootDCopyProgressHandler.cc -o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDCopyProgressHandler.o -g
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/code/xrootd/src -I/code/build/src -I/usr/local/venv/include -I/usr/local/include/python3.9 -c /code/xrootd/bindings/python/src/PyXRootDFile.cc -o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDFile.o -g
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/code/xrootd/src -I/code/build/src -I/usr/local/venv/include -I/usr/local/include/python3.9 -c /code/xrootd/bindings/python/src/PyXRootDFileSystem.cc -o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDFileSystem.o -g
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/code/xrootd/src -I/code/build/src -I/usr/local/venv/include -I/usr/local/include/python3.9 -c /code/xrootd/bindings/python/src/PyXRootDModule.cc -o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDModule.o -g
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/code/xrootd/src -I/code/build/src -I/usr/local/venv/include -I/usr/local/include/python3.9 -c /code/xrootd/bindings/python/src/PyXRootDURL.cc -o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDURL.o -g
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/code/xrootd/src -I/code/build/src -I/usr/local/venv/include -I/usr/local/include/python3.9 -c /code/xrootd/bindings/python/src/Utils.cc -o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/Utils.o -g
g++ -pthread -shared -Wl,--strip-all build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDCopyProcess.o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDCopyProgressHandler.o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDFile.o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDFileSystem.o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDModule.o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/PyXRootDURL.o build/temp.linux-x86_64-3.9/code/xrootd/bindings/python/src/Utils.o -L/code/build/src -L/code/build/src/XrdCl -L/usr/local/lib -lXrdCl -lXrdUtils -ldl -o build/lib.linux-x86_64-3.9/pyxrootd/client.cpython-39-x86_64-linux-gnu.so
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/XRootD
creating build/bdist.linux-x86_64/egg/XRootD/client
creating build/bdist.linux-x86_64/egg/pyxrootd
byte-compiling build/bdist.linux-x86_64/egg/XRootD/__init__.py to __init__.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/finalize.py to finalize.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/responses.py to responses.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/_version.py to _version.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/__init__.py to __init__.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/env.py to env.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/flags.py to flags.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/filesystem.py to filesystem.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/url.py to url.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/copyprocess.py to copyprocess.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/utils.py to utils.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/file.py to file.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/XRootD/client/glob_funcs.py to glob_funcs.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyxrootd/__init__.py to __init__.cpython-39.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyxrootd/client.py to client.cpython-39.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying xrootd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xrootd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xrootd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying xrootd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
pyxrootd.__pycache__.client.cpython-39: module references __file__
creating dist
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
creating /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg
Extracting xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg to /usr/local/venv/lib/python3.9/site-packages
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/__init__.py to __init__.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/__init__.py to __init__.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/_version.py to _version.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/copyprocess.py to copyprocess.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/env.py to env.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/file.py to file.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/filesystem.py to filesystem.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/finalize.py to finalize.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/flags.py to flags.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/glob_funcs.py to glob_funcs.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/responses.py to responses.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/url.py to url.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/client/utils.py to utils.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/pyxrootd/__init__.py to __init__.cpython-39.pyc
byte-compiling /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/pyxrootd/client.py to client.cpython-39.pyc
Adding xrootd v20220106-30c0899 to easy-install.pth file

Installed /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg
Processing dependencies for xrootd===v20220106-30c0899
Finished processing dependencies for xrootd===v20220106-30c0899
writing list of installed files to 'PYTHON_INSTALLED'
```

</details>

Things build and install such that `pyxrootd` and `XRootD` are findable (:+1: that's great!), however things are still falling back to `easy_install` which should be avoided as [it is very deprecated](https://setuptools.pypa.io/en/stable/deprecated/easy_install.html) and should be taken as "use at your own risk" now.

```console
$ docker run --rm -ti xrootd-debug:debug-fail 
root@1d413b14eaf5:/# python -c 'import pyxrootd; print(pyxrootd); import XRootD; print(XRootD)'
<module 'pyxrootd' from '/usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/pyxrootd/__init__.py'>
<module 'XRootD' from '/usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/XRootD/__init__.py'>
root@1d413b14eaf5:/# ls -lhtr /usr/local/venv/lib/python3.9/site-packages/
total 44K
drwxr-xr-x 2 root root 4.0K Jan  6 19:48 wheel-0.37.1.dist-info
drwxr-xr-x 5 root root 4.0K Jan  6 19:48 wheel
drwxr-xr-x 5 root root 4.0K Jan  6 19:48 pip
drwxr-xr-x 2 root root 4.0K Jan  6 19:48 pip-21.3.1.dist-info
drwxr-xr-x 7 root root 4.0K Jan  6 20:02 setuptools
drwxr-xr-x 6 root root 4.0K Jan  6 20:02 pkg_resources
-rw-r--r-- 1 root root  151 Jan  6 20:02 distutils-precedence.pth
drwxr-xr-x 3 root root 4.0K Jan  6 20:02 _distutils_hack
drwxr-xr-x 2 root root 4.0K Jan  6 20:02 setuptools-60.0.0.dist-info
drwxr-xr-x 5 root root 4.0K Jan  6 20:04 xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg
-rw-r--r-- 1 root root   50 Jan  6 20:04 easy-install.pth
root@1d413b14eaf5:/# ls -lhtr /usr/local/venv/lib/python3.9/site-packages/xrootd-v20220106_30c0899-py3.9-linux-x86_64.egg/
total 12K
drwxr-xr-x 3 root root 4.0K Jan  6 20:04 pyxrootd
drwxr-xr-x 4 root root 4.0K Jan  6 20:04 XRootD
drwxr-xr-x 2 root root 4.0K Jan  6 20:04 EGG-INFO
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/1579#issuecomment-1006908959
You are receiving this because you are subscribed to this thread.

Message ID: <[log in to unmask]>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1