--- Begin Message ---
Package: src:python-libusb1
Version: 3.3.1+ds-4
Severity: serious
Tags: ftbfs forky sid
Dear maintainer:
During a rebuild of all packages in unstable, this package failed to build.
Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:
https://people.debian.org/~sanvila/build-logs/202512/
About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.
If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.
If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:python-libusb1, so that this is still
visible in the BTS web page for this package.
Thanks.
--------------------------------------------------------------------------------
[...]
debian/rules clean
dh clean --buildsystem=pybuild
dh_auto_clean -O--buildsystem=pybuild
I: pybuild base:317: python3.14 setup.py clean
/usr/lib/python3/dist-packages/setuptools/dist.py:759:
SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX
license expression:
License :: OSI Approved :: GNU Lesser General Public License v2 or
later (LGPLv2+)
See
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
for details.
********************************************************************************
[... snipped ...]
expected_name = expected_name[:-2]
# NOTE: on macOS with .framework bundle build, INSTSONAME contains full
name of the .framework library, for example
# `Python.framework/Versions/3.13/Python`. Pre-compute a basename for
comparisons that are using only basename.
expected_basename = os.path.normcase(os.path.basename(expected_name))
# Try to find the expected name among the libraries against which the
Python executable is linked. This assumes that
# the Python executable was not statically linked against the library
(as is the case with Debian-packaged Python,
# or Anaconda Python).
if is_shared:
imported_libraries = get_imports(compat.python_executable) #
(name, fullpath) tuples
for _, lib_path in imported_libraries:
if lib_path is None:
continue # Skip unresolved imports
if os.path.normcase(os.path.basename(lib_path)) ==
expected_basename: # Basename comparison
# Python library found. Return absolute path to it.
return lib_path
# As a fallback, try to find the library in several "standard" search
locations...
def _find_lib_in_libdirs(name, *libdirs):
for libdir in libdirs:
full_path = os.path.join(libdir, name)
if not os.path.exists(full_path):
continue
# Resolve potential symbolic links to achieve consistent
results with linker-based search; e.g., on
# POSIX systems, linker resolves unversioned library names
(python3.X.so) to versioned ones
# (libpython3.X.so.1.0) due to former being symbolic linkes to
the latter. See #6831.
full_path = os.path.realpath(full_path)
if not os.path.exists(full_path):
continue
return full_path
return None
# Search the `sys.base_prefix` and `lib` directory in `sys.base_prefix`.
# This covers various Python installations in case we fail to infer the
shared library location for whatever reason;
# Anaconda Python, `uv` and `rye` Python, etc.
python_libname = _find_lib_in_libdirs(
expected_name, # Full name
compat.base_prefix,
os.path.join(compat.base_prefix, 'lib'),
)
if python_libname:
return python_libname
# Perform search in the configured library search locations. This
should be done after exhausting all other options;
# it primarily caters to Debian-packaged Python, but we need to make
sure that we do not collect shared library from
# system-installed Python when the current interpreter is in fact some
other Python build (for example, `uv` or
# `rye` Python of the same version as system-installed Python).
python_libname = resolve_library_path(expected_basename) # Basename
if python_libname:
return python_libname
# Not found. Raise a PythonLibraryNotFoundError with corresponding
message.
from PyInstaller.exceptions import PythonLibraryNotFoundError
message = f"ERROR: Python shared library ({expected_name!r}) was not
found!"
if compat.is_linux and os.path.isfile('/etc/debian_version'):
# The shared library is provided by `libpython3.x` package (i.e.,
no need to install full `python3-dev`).
pkg_name = f"libpython3.{sys.version_info.minor}"
message += (
" If you are using system python on Debian/Ubuntu, you might
need to install a separate package by running "
f"`apt install {pkg_name}`."
)
> raise PythonLibraryNotFoundError(message)
E PyInstaller.exceptions.PythonLibraryNotFoundError: ERROR: ERROR: Python
shared library ('libpython3.14.so.1.0') was not found! If you are using system
python on Debian/Ubuntu, you might need to install a separate package by
running `apt install libpython3.14`.
/usr/lib/python3/dist-packages/PyInstaller/depend/bindepend.py:978:
PythonLibraryNotFoundError
_____________________________ test_pyi_hooksample ______________________________
tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-0/test_pyi_hooksample1')
def test_pyi_hooksample(tmp_path):
app_name = "userapp"
workpath = tmp_path / "build"
distpath = tmp_path / "dist"
app = tmp_path / (app_name + ".py")
app.write_text("\n".join([
"import usb1",
"print(usb1.getVersion())"
]))
args = [
# Place all generated files in ``tmp_path``.
'--workpath', str(workpath),
'--distpath', str(distpath),
'--specpath', str(tmp_path),
str(app),
]
> pyi_main.run(args)
usb1/__pyinstaller/test_libusb1_packaging.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/PyInstaller/__main__.py:215: in run
run_build(pyi_config, spec_file, **vars(args))
/usr/lib/python3/dist-packages/PyInstaller/__main__.py:70: in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py:1272: in main
build(specfile, distpath, workpath, clean_build)
/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py:1210: in build
exec(code, spec_namespace)
/tmp/pytest-of-sbuild/pytest-0/test_pyi_hooksample1/userapp.spec:4: in <module>
a = Analysis(
/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py:584: in
__init__
self.__postinit__()
/usr/lib/python3/dist-packages/PyInstaller/building/datastruct.py:184: in
__postinit__
self.assemble()
/usr/lib/python3/dist-packages/PyInstaller/building/build_main.py:668: in
assemble
python_lib = bindepend.get_python_library_path() # Raises
PythonLibraryNotFoundError
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def get_python_library_path():
"""
Find Python shared library that belongs to the current interpreter.
Return full path to Python dynamic library or None when not found.
PyInstaller needs to collect the Python shared library, so that
bootloader can load it, import Python C API
symbols, and use them to set up the embedded Python interpreter.
The name of the shared library is typically fixed (`python3.X.dll` on
Windows, libpython3.X.so on Unix systems,
and `libpython3.X.dylib` on macOS for shared library builds and
`Python.framework/Python` for framework build).
Its location can usually be inferred from the Python interpreter
executable, when the latter is dynamically
linked against the shared library.
However, some situations require extra handling due to various quirks;
for example, Debian-based linux
distributions statically link the Python interpreter executable against
the Python library, while also providing
a shared library variant for external users.
"""
# With Windows Python builds, this is pretty straight-forward:
`sys.dllhandle` provides a handle to the loaded
# Python DLL, and we can resolve its path using `GetModuleFileName()`
from win32 API.
# This is applicable to python.org Windows builds, Anaconda on Windows,
and MSYS2 Python.
if compat.is_win:
import _winapi
return _winapi.GetModuleFileName(sys.dllhandle)
# On other (POSIX) platforms, the name of the Python shared library is
available in the `INSTSONAME` variable
# exposed by the `sysconfig` module. There is also the `LDLIBRARY`
variable, which points to the unversioned .so
# symbolic link for linking purposes; however, we are interested in the
actual, fully-versioned soname.
# This should cover all variations in the naming schemes across
different platforms as well as different build
# options (debug build, free-threaded build, etc.).
# First, try to catch Python builds that were not made with shared
library (or .framework bundle on macOS) enabled.
# In such builds, `INSTSONAME` seems to point to the static library,
which is of no use to us.
is_shared = (
# Builds made with `--enable-shared` have `Py_ENABLE_SHARED` set to
1. This is true even for Debian-packaged
# Python, which has the `python` executable statically linked
against the Python library.
sysconfig.get_config_var("Py_ENABLE_SHARED") or
# On macOS, builds made with `--enable-framework` have
`Py_ENABLE_SHARED` set to 0, but have `PYTHONFRAMEWORK`
# set to a non-empty string.
(compat.is_darwin and sysconfig.get_config_var("PYTHONFRAMEWORK"))
)
if is_shared:
expected_name = sysconfig.get_config_var('INSTSONAME')
elif compat.is_conda:
# While Anaconda provides Python shared library, the interpreter
executable and shared library seem to be made
# separately; therefore, the interpreter has `Py_ENABLE_SHARED` set
to 0 and `INSTSONAME` points to a static
# library. And so we need to fall back to the old guess-work.
py_major, py_minor = sys.version_info[:2]
py_suffix = "t" if compat.is_nogil else "" # TODO: does Anaconda
provide debug builds with "d" suffix?
if compat.is_darwin:
# macOS
expected_name =
f"libpython{py_major}.{py_minor}{py_suffix}.dylib"
else:
# Linux; assume any other potential POSIX builds use the same
naming scheme.
expected_name =
f"libpython{py_major}.{py_minor}{py_suffix}.so.1.0"
else:
# Raise PythonLibraryNotFoundError
from PyInstaller.exceptions import PythonLibraryNotFoundError
option_str = (
"either the `--enable-shared` or the `--enable-framework`
option"
if compat.is_darwin else "the `--enable-shared` option"
)
raise PythonLibraryNotFoundError(
"Python was built without a shared library, which is required
by PyInstaller. "
f"If you built Python from source, rebuild it with
{option_str}."
)
# In Cygwin builds (and also MSYS2 python, although that should be
handled by Windows-specific codepath...),
# INSTSONAME is available, but the name has a ".dll.a" suffix; remove
that trailing ".a".
if (compat.is_win or compat.is_cygwin) and
os.path.normcase(expected_name).endswith('.dll.a'):
expected_name = expected_name[:-2]
# NOTE: on macOS with .framework bundle build, INSTSONAME contains full
name of the .framework library, for example
# `Python.framework/Versions/3.13/Python`. Pre-compute a basename for
comparisons that are using only basename.
expected_basename = os.path.normcase(os.path.basename(expected_name))
# Try to find the expected name among the libraries against which the
Python executable is linked. This assumes that
# the Python executable was not statically linked against the library
(as is the case with Debian-packaged Python,
# or Anaconda Python).
if is_shared:
imported_libraries = get_imports(compat.python_executable) #
(name, fullpath) tuples
for _, lib_path in imported_libraries:
if lib_path is None:
continue # Skip unresolved imports
if os.path.normcase(os.path.basename(lib_path)) ==
expected_basename: # Basename comparison
# Python library found. Return absolute path to it.
return lib_path
# As a fallback, try to find the library in several "standard" search
locations...
def _find_lib_in_libdirs(name, *libdirs):
for libdir in libdirs:
full_path = os.path.join(libdir, name)
if not os.path.exists(full_path):
continue
# Resolve potential symbolic links to achieve consistent
results with linker-based search; e.g., on
# POSIX systems, linker resolves unversioned library names
(python3.X.so) to versioned ones
# (libpython3.X.so.1.0) due to former being symbolic linkes to
the latter. See #6831.
full_path = os.path.realpath(full_path)
if not os.path.exists(full_path):
continue
return full_path
return None
# Search the `sys.base_prefix` and `lib` directory in `sys.base_prefix`.
# This covers various Python installations in case we fail to infer the
shared library location for whatever reason;
# Anaconda Python, `uv` and `rye` Python, etc.
python_libname = _find_lib_in_libdirs(
expected_name, # Full name
compat.base_prefix,
os.path.join(compat.base_prefix, 'lib'),
)
if python_libname:
return python_libname
# Perform search in the configured library search locations. This
should be done after exhausting all other options;
# it primarily caters to Debian-packaged Python, but we need to make
sure that we do not collect shared library from
# system-installed Python when the current interpreter is in fact some
other Python build (for example, `uv` or
# `rye` Python of the same version as system-installed Python).
python_libname = resolve_library_path(expected_basename) # Basename
if python_libname:
return python_libname
# Not found. Raise a PythonLibraryNotFoundError with corresponding
message.
from PyInstaller.exceptions import PythonLibraryNotFoundError
message = f"ERROR: Python shared library ({expected_name!r}) was not
found!"
if compat.is_linux and os.path.isfile('/etc/debian_version'):
# The shared library is provided by `libpython3.x` package (i.e.,
no need to install full `python3-dev`).
pkg_name = f"libpython3.{sys.version_info.minor}"
message += (
" If you are using system python on Debian/Ubuntu, you might
need to install a separate package by running "
f"`apt install {pkg_name}`."
)
> raise PythonLibraryNotFoundError(message)
E PyInstaller.exceptions.PythonLibraryNotFoundError: ERROR: ERROR: Python
shared library ('libpython3.14.so.1.0') was not found! If you are using system
python on Debian/Ubuntu, you might need to install a separate package by
running `apt install libpython3.14`.
/usr/lib/python3/dist-packages/PyInstaller/depend/bindepend.py:978:
PythonLibraryNotFoundError
=============================== warnings summary ===============================
usb1/_libusb1.py:1071
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_usb1/build/usb1/_libusb1.py:1071:
DeprecationWarning: Due to '_pack_', the 'libusb_control_setup' Structure will
use memory layout compatible with MSVC (Windows). If this is intended, set
_layout_ to 'ms'. The implicit default is deprecated and slated to become an
error in Python 3.19.
class libusb_control_setup(Structure):
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED __pyinstaller/test_libusb1_packaging.py::test_pyi_hooksample - PyInsta...
FAILED usb1/__pyinstaller/test_libusb1_packaging.py::test_pyi_hooksample - Py...
========================= 2 failed, 1 warning in 0.36s =========================
E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_usb1/build; python3.14 -m pytest
I: pybuild pybuild:308: cp -r /<<PKGBUILDDIR>>/usb1/__pyinstaller
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_usb1/build
I: pybuild base:317: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_usb1/build;
python3.13 -m pytest
============================= test session starts ==============================
platform linux -- Python 3.13.11, pytest-9.0.2, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>
plugins: typeguard-4.4.4
collected 2 items
__pyinstaller/test_libusb1_packaging.py . [ 50%]
usb1/__pyinstaller/test_libusb1_packaging.py . [100%]
============================== 2 passed in 4.99s ===============================
I: pybuild pybuild:334: rm -rf
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_usb1/build/__pyinstaller
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.14
3.13" returned exit code 13
make: *** [debian/rules:13: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
--- End Message ---