Package: bladerf
Version: 0.2023.02-1
Severity: serious
Tags: patch
Justification: Policy 4.9
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu mantic ubuntu-patch
X-Debbugs-Cc: bdr...@debian.org

Dear Maintainer,

bladerf 0.2023.02-1 fails to build from source on Ubuntu, because it
tries to access the Internet (see Debian policy 4.9):

```
python3 -m build --sdist --outdir=debian/tmp/ 
host/libraries/libbladeRF_bindings/python
* Creating venv isolated environment...
* Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
WARNING: The directory '/sbuild-nonexistent/.cache/pip' or its parent directory 
is not owned or is not writable by the current user. The cache has been 
disabled. Check the permissions and owner of that directory. If executing pip 
with sudo, you should use sudo's -H flag.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 
0x7f24da035d10>: Failed to establish a new connection: [Errno -2] Name or 
service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 
0x7f24da0363d0>: Failed to establish a new connection: [Errno -2] Name or 
service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 
0x7f24da036f90>: Failed to establish a new connection: [Errno -2] Name or 
service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 
0x7f24da037dd0>: Failed to establish a new connection: [Errno -2] Name or 
service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 
'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 
0x7f24da048510>: Failed to establish a new connection: [Errno -2] Name or 
service not known')': /simple/wheel/
ERROR: Could not find a version that satisfies the requirement wheel (from 
versions: none)
ERROR: No matching distribution found for wheel

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/build/__main__.py", line 375, in main
    built = build_call(
            ^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/build/__main__.py", line 208, in 
build_package
    out = _build(isolation, builder, outdir, distribution, config_settings, 
skip_dependency_check)
          
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/build/__main__.py", line 145, in _build
    return _build_in_isolated_env(builder, outdir, distribution, 
config_settings)
           
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/build/__main__.py", line 113, in 
_build_in_isolated_env
    env.install(builder.build_system_requires)
  File "/usr/lib/python3/dist-packages/build/env.py", line 214, in install
    _subprocess(cmd)
  File "/usr/lib/python3/dist-packages/build/env.py", line 79, in _subprocess
    raise e
  File "/usr/lib/python3/dist-packages/build/env.py", line 76, in _subprocess
    subprocess.run(cmd, check=True, stdout=subprocess.PIPE, 
stderr=subprocess.STDOUT)
  File "/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/tmp/build-env-c4ez2a0s/bin/python', 
'-Im', 'pip', 'install', '--use-pep517', '--no-warn-script-location', '-r', 
'/tmp/build-reqs-kxypfyca.txt']' returned non-zero exit status 1.

ERROR Command '['/tmp/build-env-c4ez2a0s/bin/python', '-Im', 'pip', 'install', 
'--use-pep517', '--no-warn-script-location', '-r', 
'/tmp/build-reqs-kxypfyca.txt']' returned non-zero exit status 1.
```

In Ubuntu, the attached patch was applied to achieve the following:

  * Use pybuild for building the Python3 bindings to avoid Internet access
    (LP: #2033661)


Thanks for considering the patch.

-- 
Benjamin Drung
Debian & Ubuntu Developer
diff -Nru bladerf-0.2023.02/debian/control bladerf-0.2023.02/debian/control
--- bladerf-0.2023.02/debian/control    2023-07-12 17:45:05.000000000 +0200
+++ bladerf-0.2023.02/debian/control    2023-08-31 16:21:33.000000000 +0200
@@ -15,10 +15,8 @@
                libusb2-dev [kfreebsd-any],
               pandoc [!kfreebsd-any],
                pkg-config,
-              python3-build,
                python3-dev,
-              python3-setuptools,
-              python3-venv
+              python3-setuptools
 Standards-Version: 4.6.2
 Rules-Requires-Root: no
 Section: comm
@@ -94,7 +92,7 @@
 Architecture: any
 Multi-Arch: foreign
 Depends: libbladerf-dev (= ${binary:Version}),
-         python3, python3-cffi, ${python3:Depends},
+         python3-cffi, ${python3:Depends},
          ${misc:Depends}
 Description: Nuand bladeRF software-defined radio device (Python)
  The Nuand bladeRF is an open-source software-defined radio (SDR) system,
diff -Nru bladerf-0.2023.02/debian/not-installed 
bladerf-0.2023.02/debian/not-installed
--- bladerf-0.2023.02/debian/not-installed      1970-01-01 01:00:00.000000000 
+0100
+++ bladerf-0.2023.02/debian/not-installed      2023-08-31 16:01:44.000000000 
+0200
@@ -0,0 +1,2 @@
+usr/bin/bladerf-tool
+usr/lib/python3*/dist-packages/bladerf-*.egg-info
diff -Nru bladerf-0.2023.02/debian/python3-bladerf.install 
bladerf-0.2023.02/debian/python3-bladerf.install
--- bladerf-0.2023.02/debian/python3-bladerf.install    2022-10-31 
02:34:36.000000000 +0100
+++ bladerf-0.2023.02/debian/python3-bladerf.install    2023-08-31 
16:01:02.000000000 +0200
@@ -1,2 +1,2 @@
-host/libraries/libbladeRF_bindings/python/bladerf 
usr/lib/python3/dist-packages/
+usr/lib/python3*/dist-packages/bladerf
 host/misc/python/* usr/share/doc/python-bladerf/
diff -Nru bladerf-0.2023.02/debian/rules bladerf-0.2023.02/debian/rules
--- bladerf-0.2023.02/debian/rules      2023-07-12 17:10:30.000000000 +0200
+++ bladerf-0.2023.02/debian/rules      2023-08-31 15:45:08.000000000 +0200
@@ -54,18 +54,17 @@
 
 override_dh_auto_build:
        dh_auto_build
-       python3 -m build --sdist --outdir=debian/tmp/ 
host/libraries/libbladeRF_bindings/python
-       tar tvf debian/tmp/bladerf-1.3.0.tar.gz
+       dh_auto_build --buildsystem=pybuild 
--sourcedir=host/libraries/libbladeRF_bindings/python
 
 override_dh_auto_install:
        dh_auto_install
+       # Python3 bindings
+       dh_auto_install --buildsystem=pybuild 
--sourcedir=host/libraries/libbladeRF_bindings/python
        # Use locally installed Mathjax.js
        (cd debian/tmp/usr/share/doc/libbladerf-doc/html && ln -s 
/usr/share/javascript/mathjax/MathJax.js MathJax.js)
        (cd debian/tmp/usr/share/doc/libbladerf-doc/html && sed --in-place 
's_http://cdn.mathjax.org/mathjax/latest/MathJax.js_MathJax.js_' *.html)
        # library soversion named udev rules
        #mv debian/tmp/lib/udev/rules.d/88-nuand.rules 
debian/tmp/lib/udev/rules.d/88-libbladerf2.rules
-       # Python3 bindings
-       # python3 host/libraries/libbladeRF_bindings/python/setup.py install 
--root=debian/tmp/ --prefix=/usr
        # per lintian
        rm -f host/examples/bladeRF-cli/sync_trx/.gitignore
        rm -f host/examples/python/txrx/.gitignore

Reply via email to