Skip to content
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

[BUG] 62.0.0: setuptools._distutils.unixccompiler hardcodes on linking rpath #3257

Open
kloczek opened this issue Apr 9, 2022 · 5 comments · May be fixed by pypa/distutils#160
Open

[BUG] 62.0.0: setuptools._distutils.unixccompiler hardcodes on linking rpath #3257

kloczek opened this issue Apr 9, 2022 · 5 comments · May be fixed by pypa/distutils#160
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@kloczek
Copy link

kloczek commented Apr 9, 2022

setuptools version

62.0.0:

Python version

3.8.13

OS

Linux/x86_64

Additional environment information

No response

Description

I'm tring to build bsddb3 as rpm package (https://pypi.org/project/bsddb3/). That module links small DSO.
Looks like

# For all compilers, `-Wl` is the presumed way to
# pass a compiler option to the linker and `-R` is
# the way to pass an RPATH.
if sysconfig.get_config_var("GNULD") == "yes":
# GNU ld needs an extra option to get a RUNPATH
# instead of just an RPATH.
return "-Wl,--enable-new-dtags,-R" + dir
else:
return "-Wl,-R" + dir

is causing that to the linker options is always added -Wl,--enable-new-dtags,-R/usr/lib64.
Linking binary with default libdir is pointless and rpm on packaging is checkin is any ELF binary has RPATH and if that RPATH points to default libdir it exits with error.

Build log:

* Getting dependencies for wheel...
Found Berkeley DB 5.3 installation.
  include files in /usr/include
  library files in /usr/lib64
  library name is libdb-5.3
Detected Berkeley DB version 5.3 from db.h
running egg_info
writing bsddb3.egg-info/PKG-INFO
writing dependency_links to bsddb3.egg-info/dependency_links.txt
writing top-level names to bsddb3.egg-info/top_level.txt
reading manifest file 'bsddb3.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'updatedb.bat'
warning: no files found matching '*.py' under directory 'bsddb3'
warning: no files found matching '*.html' under directory 'docs'
warning: no files found matching '*.css' under directory 'docs'
warning: no files found matching '*.gif' under directory 'docs'
warning: no files found matching '*.jpg' under directory 'docs'
warning: no files found matching '*.js' under directory 'docs'
warning: no files found matching '*.json' under directory 'docs'
warning: no files found matching '*.txt' under directory 'patches'
warning: no files found matching '*.patch' under directory 'patches'
warning: no files found matching '*.py' under directory 'test'
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/tools/docutils'
no previously-included directories found matching 'docs/tools/sphinx'
no previously-included directories found matching 'docs/tools/pygments'
no previously-included directories found matching 'old'
no previously-included directories found matching 'test/db_home'
no previously-included directories found matching 'test/bsddb3'
adding license file 'LICENSE.txt'
writing manifest file 'bsddb3.egg-info/SOURCES.txt'



******* WARNING *******

This library (bsddb3) is legacy. Please, upgrade to 'berkeleydb' library. Check details at:

    https://www.jcea.es/programacion/pybsddb.htm

Take note that upgrading to 'berkeleydb' is easy but not transparent. Notably, keys and values are *bytes* in 'berkeleydb' lib, while in 'bsddb3' they are *strings*. You would only need to change your code to add or remove type encoding/decoding, depending of how you use the library. The process should be simple, nevertheless.


* Building wheel...
Found Berkeley DB 5.3 installation.
  include files in /usr/include
  library files in /usr/lib64
  library name is libdb-5.3
Detected Berkeley DB version 5.3 from db.h
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbutils.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbtables.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbshelve.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbrecio.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbobj.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/db.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/__init__.py -> build/lib.linux-x86_64-3.8/bsddb3
creating build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_thread.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_sequence.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_replication.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_recno.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_queue.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_pickle.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_misc.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_lock.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_join.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_get_none.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_fileid.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_early_close.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_distributed_transactions.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbtables.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbshelve.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbobj.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbenv.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_db.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_cursor_pget_bug.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_compat.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_compare.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_basics.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_associate.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_all.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/__init__.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
running build_ext
building 'bsddb3._pybsddb' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/Modules
/usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -fPIC -I/usr/include -I/usr/include/python3.8 -c Modules/_bsddb.c -o build/temp.linux-x86_64-3.8/Modules/_bsddb.o
/usr/bin/gcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none build/temp.linux-x86_64-3.8/Modules/_bsddb.o -L/usr/lib64 -L/usr/lib64 -Wl,--enable-new-dtags,-R/usr/lib64 -ldb-5.3 -o build/lib.linux-x86_64-3.8/bsddb3/_pybsddb.cpython-38-x86_64-linux-gnu.so
installing to build/bdist.linux-x86_64/wheel
running install

In that last line is -Wl,--enable-new-dtags,-R/usr/lib64 as linker option.

That is causeing that rpmbuild post installation is failing with:

Can't list '/home/tkloczko/rpmbuild/BUILDROOT/python-bsddb3-6.2.9-7.fc35.x86_64/usr/lib/python3.8/site-packages'
+ /usr/lib/rpm/check-rpaths
*******************************************************************************
*
* WARNING: 'check-rpaths' detected a broken RPATH OR RUNPATH and will cause
*          'rpmbuild' to fail. To ignore these errors, you can set the
*          '$QA_RPATHS' environment variable which is a bitmask allowing the
*          values below. The current value of QA_RPATHS is 0x0000.
*
*    0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor
*               issue but are introducing redundant searchpaths without
*               providing a benefit. They can also cause errors in multilib
*               environments.
*    0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute
*               nor relative filenames and can therefore be a SECURITY risk
*    0x0004 ... insecure RPATHs; these are relative RPATHs which are a
*               SECURITY risk
*    0x0008 ... the special '$ORIGIN' RPATHs are appearing after other
*               RPATHs; this is just a minor issue but usually unwanted
*    0x0010 ... the RPATH is empty; there is no reason for such RPATHs
*               and they cause unneeded work while loading libraries
*    0x0020 ... an RPATH references '..' of an absolute path; this will break
*               the functionality when the path before '..' is a symlink
*
*
* Examples:
* - to ignore standard and empty RPATHs, execute 'rpmbuild' like
*   $ QA_RPATHS=$(( 0x0001|0x0010 )) rpmbuild my-package.src.rpm
* - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like
*   $ RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths
*
*******************************************************************************
ERROR   0001: file '/usr/lib64/python3.8/site-packages/bsddb3/_pybsddb.cpython-38-x86_64-linux-gnu.so' contains a standard  '/usr/lib64' in [/usr/lib64]

Expected behavior

  • RPATH with default libdir shpuld not be used
  • at least spoud be some option (env variable?) to disable hardcode RPATH

How to Reproduce

wget  https://pypi.io/packages/source/b/bsddb3/bsddb3-6.2.9.tar.gz
tar xzf bsddb3-6.2.9.tar.gz
cd bsddb3-6.2.9
python3 -sBm build -w --no-isolatio
objdump -x build/lib.*/bsddb3/_pybsddb.cpython-*.so | grep RUNPATH

Output

* Getting dependencies for wheel...
Found Berkeley DB 5.3 installation.
  include files in /usr/include
  library files in /usr/lib64
  library name is libdb-5.3
Detected Berkeley DB version 5.3 from db.h
running egg_info
writing bsddb3.egg-info/PKG-INFO
writing dependency_links to bsddb3.egg-info/dependency_links.txt
writing top-level names to bsddb3.egg-info/top_level.txt
reading manifest file 'bsddb3.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'updatedb.bat'
warning: no files found matching '*.py' under directory 'bsddb3'
warning: no files found matching '*.html' under directory 'docs'
warning: no files found matching '*.css' under directory 'docs'
warning: no files found matching '*.gif' under directory 'docs'
warning: no files found matching '*.jpg' under directory 'docs'
warning: no files found matching '*.js' under directory 'docs'
warning: no files found matching '*.json' under directory 'docs'
warning: no files found matching '*.txt' under directory 'patches'
warning: no files found matching '*.patch' under directory 'patches'
warning: no files found matching '*.py' under directory 'test'
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/tools/docutils'
no previously-included directories found matching 'docs/tools/sphinx'
no previously-included directories found matching 'docs/tools/pygments'
no previously-included directories found matching 'old'
no previously-included directories found matching 'test/db_home'
no previously-included directories found matching 'test/bsddb3'
adding license file 'LICENSE.txt'
writing manifest file 'bsddb3.egg-info/SOURCES.txt'



******* WARNING *******

This library (bsddb3) is legacy. Please, upgrade to 'berkeleydb' library. Check details at:

    https://www.jcea.es/programacion/pybsddb.htm

Take note that upgrading to 'berkeleydb' is easy but not transparent. Notably, keys and values are *bytes* in 'berkeleydb' lib, while in 'bsddb3' they are *strings*. You would only need to change your code to add or remove type encoding/decoding, depending of how you use the library. The process should be simple, nevertheless.


* Building wheel...
Found Berkeley DB 5.3 installation.
  include files in /usr/include
  library files in /usr/lib64
  library name is libdb-5.3
Detected Berkeley DB version 5.3 from db.h
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbutils.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbtables.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbshelve.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbrecio.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/dbobj.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/db.py -> build/lib.linux-x86_64-3.8/bsddb3
copying Lib3/bsddb/__init__.py -> build/lib.linux-x86_64-3.8/bsddb3
creating build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_thread.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_sequence.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_replication.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_recno.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_queue.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_pickle.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_misc.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_lock.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_join.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_get_none.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_fileid.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_early_close.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_distributed_transactions.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbtables.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbshelve.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbobj.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_dbenv.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_db.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_cursor_pget_bug.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_compat.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_compare.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_basics.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_associate.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/test_all.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
copying Lib3/bsddb/test/__init__.py -> build/lib.linux-x86_64-3.8/bsddb3/tests
running build_ext
building 'bsddb3._pybsddb' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/Modules
/usr/bin/gcc -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -D_GNU_SOURCE -fPIC -fwrapv -ffat-lto-objects -fPIC -I/usr/include -I/usr/include/python3.8 -c Modules/_bsddb.c -o build/temp.linux-x86_64-3.8/Modules/_bsddb.o
/usr/bin/gcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 -Wl,-z,relro -Wl,--as-needed -Wl,--gc-sections -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto=auto -flto-partition=none -fuse-linker-plugin -Wl,--build-id=sha1 build/temp.linux-x86_64-3.8/Modules/_bsddb.o -L/usr/lib64 -L/usr/lib64 -Wl,--enable-new-dtags,-R/usr/lib64 -ldb-5.3 -o build/lib.linux-x86_64-3.8/bsddb3/_pybsddb.cpython-38-x86_64-linux-gnu.so
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/bsddb3
copying build/lib.linux-x86_64-3.8/bsddb3/dbutils.py -> build/bdist.linux-x86_64/wheel/bsddb3
copying build/lib.linux-x86_64-3.8/bsddb3/dbtables.py -> build/bdist.linux-x86_64/wheel/bsddb3
copying build/lib.linux-x86_64-3.8/bsddb3/dbshelve.py -> build/bdist.linux-x86_64/wheel/bsddb3
copying build/lib.linux-x86_64-3.8/bsddb3/dbrecio.py -> build/bdist.linux-x86_64/wheel/bsddb3
copying build/lib.linux-x86_64-3.8/bsddb3/dbobj.py -> build/bdist.linux-x86_64/wheel/bsddb3
copying build/lib.linux-x86_64-3.8/bsddb3/db.py -> build/bdist.linux-x86_64/wheel/bsddb3
copying build/lib.linux-x86_64-3.8/bsddb3/__init__.py -> build/bdist.linux-x86_64/wheel/bsddb3
creating build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_thread.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_sequence.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_replication.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_recno.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_queue.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_pickle.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_misc.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_lock.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_join.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_get_none.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_fileid.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_early_close.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_distributed_transactions.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_dbtables.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_dbshelve.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_dbobj.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_dbenv.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_db.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_cursor_pget_bug.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_compat.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_compare.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_basics.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_associate.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/test_all.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/tests/__init__.py -> build/bdist.linux-x86_64/wheel/bsddb3/tests
copying build/lib.linux-x86_64-3.8/bsddb3/_pybsddb.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/wheel/bsddb3
running install_headers
creating build/bdist.linux-x86_64/wheel/bsddb3-6.2.9.data
creating build/bdist.linux-x86_64/wheel/bsddb3-6.2.9.data/headers
copying Modules/bsddb.h -> build/bdist.linux-x86_64/wheel/bsddb3-6.2.9.data/headers
running install_egg_info
running egg_info
writing bsddb3.egg-info/PKG-INFO
writing dependency_links to bsddb3.egg-info/dependency_links.txt
writing top-level names to bsddb3.egg-info/top_level.txt
reading manifest file 'bsddb3.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'updatedb.bat'
warning: no files found matching '*.py' under directory 'bsddb3'
warning: no files found matching '*.html' under directory 'docs'
warning: no files found matching '*.css' under directory 'docs'
warning: no files found matching '*.gif' under directory 'docs'
warning: no files found matching '*.jpg' under directory 'docs'
warning: no files found matching '*.js' under directory 'docs'
warning: no files found matching '*.json' under directory 'docs'
warning: no files found matching '*.txt' under directory 'patches'
warning: no files found matching '*.patch' under directory 'patches'
warning: no files found matching '*.py' under directory 'test'
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/tools/docutils'
no previously-included directories found matching 'docs/tools/sphinx'
no previously-included directories found matching 'docs/tools/pygments'
no previously-included directories found matching 'old'
no previously-included directories found matching 'test/db_home'
no previously-included directories found matching 'test/bsddb3'
adding license file 'LICENSE.txt'
writing manifest file 'bsddb3.egg-info/SOURCES.txt'
Copying bsddb3.egg-info to build/bdist.linux-x86_64/wheel/bsddb3-6.2.9-py3.8.egg-info
running install_scripts
adding license file "LICENSE.txt" (matched pattern "LICEN[CS]E*")
creating build/bdist.linux-x86_64/wheel/bsddb3-6.2.9.dist-info/WHEEL
creating '/home/tkloczko/rpmbuild/SPECS/bsddb3-6.2.9/dist/tmp27atf04e/bsddb3-6.2.9-cp38-cp38-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'bsddb3/__init__.py'
adding 'bsddb3/_pybsddb.cpython-38-x86_64-linux-gnu.so'
adding 'bsddb3/db.py'
adding 'bsddb3/dbobj.py'
adding 'bsddb3/dbrecio.py'
adding 'bsddb3/dbshelve.py'
adding 'bsddb3/dbtables.py'
adding 'bsddb3/dbutils.py'
adding 'bsddb3/tests/__init__.py'
adding 'bsddb3/tests/test_all.py'
adding 'bsddb3/tests/test_associate.py'
adding 'bsddb3/tests/test_basics.py'
adding 'bsddb3/tests/test_compare.py'
adding 'bsddb3/tests/test_compat.py'
adding 'bsddb3/tests/test_cursor_pget_bug.py'
adding 'bsddb3/tests/test_db.py'
adding 'bsddb3/tests/test_dbenv.py'
adding 'bsddb3/tests/test_dbobj.py'
adding 'bsddb3/tests/test_dbshelve.py'
adding 'bsddb3/tests/test_dbtables.py'
adding 'bsddb3/tests/test_distributed_transactions.py'
adding 'bsddb3/tests/test_early_close.py'
adding 'bsddb3/tests/test_fileid.py'
adding 'bsddb3/tests/test_get_none.py'
adding 'bsddb3/tests/test_join.py'
adding 'bsddb3/tests/test_lock.py'
adding 'bsddb3/tests/test_misc.py'
adding 'bsddb3/tests/test_pickle.py'
adding 'bsddb3/tests/test_queue.py'
adding 'bsddb3/tests/test_recno.py'
adding 'bsddb3/tests/test_replication.py'
adding 'bsddb3/tests/test_sequence.py'
adding 'bsddb3/tests/test_thread.py'
adding 'bsddb3-6.2.9.data/headers/bsddb.h'
adding 'bsddb3-6.2.9.dist-info/LICENSE.txt'
adding 'bsddb3-6.2.9.dist-info/METADATA'
adding 'bsddb3-6.2.9.dist-info/WHEEL'
adding 'bsddb3-6.2.9.dist-info/top_level.txt'
adding 'bsddb3-6.2.9.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel



******* WARNING *******

This library (bsddb3) is legacy. Please, upgrade to 'berkeleydb' library. Check details at:

    https://www.jcea.es/programacion/pybsddb.htm

Take note that upgrading to 'berkeleydb' is easy but not transparent. Notably, keys and values are *bytes* in 'berkeleydb' lib, while in 'bsddb3' they are *strings*. You would only need to change your code to add or remove type encoding/decoding, depending of how you use the library. The process should be simple, nevertheless.


Successfully built bsddb3-6.2.9-cp38-cp38-linux_x86_64.whl
+ objdump -x build/lib.*/bsddb3/_pybsddb.cpython-*.so | grep RUNPATH
  RUNPATH              /usr/lib64
@kloczek kloczek added bug Needs Triage Issues that need to be evaluated for severity and status. labels Apr 9, 2022
@DWesl
Copy link
Contributor

DWesl commented Jul 18, 2022

Out of curiousity, would something like this patch fix this problem? Found in this distutils comment; possibly enabled by SETUPTOOLS_USE_DISTUTILS=stdlib

@kloczek
Copy link
Author

kloczek commented Jul 20, 2022

Issue is that setuptools should not fiddle in linker options .. at all.
If someone neds link with rpath it should be passed over LDFLAGS env variable.

@DWesl
Copy link
Contributor

DWesl commented Jul 20, 2022

Issue is that setuptools should not fiddle in linker options .. at all. If someone needs link with rpath it should be passed over LDFLAGS env variable.

For rpath specifically I can mostly see your point, but that might be because I come from Windows.

As for "setuptools should never fiddle with linker options", there's a range of arguments to setuptools.Extension designed explicitly to add things to the link line (library_dirs, libraries, runtime_library_dirs, extra_link_args), so I suspect I don't understand what you mean.

In case I understood properly the first time, you may want to avoid setting runtime_library_dir on line 542 of setup3.py if libdir in default_libdirs; does removing that line in the package build allow it to succeed?

@lazka
Copy link
Contributor

lazka commented Jul 20, 2022

bsddb3 is explicitly requesting rpath: https://hg.jcea.es/pybsddb/file/tip/setup3.py#l490 so I'd either patch bsddb3 to remove that line, or ask upstream why they need it.

DWesl added a commit to DWesl/distutils that referenced this issue Jul 31, 2022
Last of the patches from pypa#73 
Might close pypa/setuptools#3257

Dual purposes here:
- On platforms like Cygwin that don't have `rpath`, try to avoid adding things to `rpath`
- Some distribution binary package makers require that no shared library list a system library directory (`/lib`, `/lib64`, `/usr/lib`, `/usr/lib64`) in its `rpath`; this patch simplifies the code to ensure the shared library can find its dependencies at runtime.
@DWesl
Copy link
Contributor

DWesl commented Jul 31, 2022

Does applying the patch in pypa/distutils#160 to the copy of distutils that setuptools bundles in setuptools._distutils allow the binary package creation to pass its checks?

DWesl added a commit to DWesl/distutils that referenced this issue Jun 28, 2024
Last of the patches from pypa#73 
Might close pypa/setuptools#3257

Dual purposes here:
- On platforms like Cygwin that don't have `rpath`, try to avoid adding things to `rpath`
- Some distribution binary package makers require that no shared library list a system library directory (`/lib`, `/lib64`, `/usr/lib`, `/usr/lib64`) in its `rpath`; this patch simplifies the code to ensure the shared library can find its dependencies at runtime.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants