gnuradio / pybombs

PyBOMBS (Python Build Overlay Managed Bundle System) is the GNU Radio install management system for resolving dependencies and pulling in out-of-tree projects.
https://gnuradio.org
GNU General Public License v3.0
414 stars 191 forks source link

Unhelpful message when trying to install package from source with no source given in recipie #597

Open software-opal opened 3 years ago

software-opal commented 3 years ago

Problem:

I'm trying to install hackrf from source because I'm pretty sure the Ubuntu packaged version is out of date(and because I have no idea what I'm doing and am about 7 issues deep in debugging my original issue ... but that's not important). I get this error:

$ pybombs install hackrf --static
[INFO] Prefix Python version is: 3.8.5
[INFO] PyBOMBS Version 2.3.4
[INFO] Phase 1: Creating install tree and installing binary packages:
Install tree:
|
\- hackrf
[INFO] Phase 1 complete: All binary dependencies installed.
[INFO] Phase 2: Recursively installing source packages to prefix:
[INFO] Installing package: hackrf
Traceback (most recent call last):
  File "/usr/local/bin/pybombs", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/pybombs/main.py", line 32, in main
    return dispatch() or 0
  File "/usr/local/lib/python3.8/dist-packages/pybombs/commands/base.py", line 195, in dispatch
    return get_cmd_dict(cmd_list)[args.command](cmd=args.command, args=args).run()
  File "/usr/local/lib/python3.8/dist-packages/pybombs/commands/install.py", line 113, in run
    return not self.install_manager.install(
  File "/usr/local/lib/python3.8/dist-packages/pybombs/install_manager.py", line 138, in install
    if not self.pm.install(pkg, install_type="source", static=static, verify=verify):
  File "/usr/local/lib/python3.8/dist-packages/pybombs/package_manager.py", line 237, in install
    install_result = self._std_package_operation(
  File "/usr/local/lib/python3.8/dist-packages/pybombs/package_manager.py", line 283, in _std_package_operation
    result = getattr(pkgr, operation)(rec, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/pybombs/packagers/source.py", line 438, in install
    assert False
AssertionError

Setup:

I've just installed pybombs using these steps on an Ubuntu 20.04 VM:

sudo apt-get install python3-pip
sudo pip3 install pybombs
pybombs auto-config
pybombs recipes add-defaults

It turns out after digging that the error is caused because the recipie is missing source information(or at least that's what I assume given the source code the error is pointing to): https://github.com/gnuradio/pybombs/blob/master/pybombs/packagers/source.py#L434-L438

It would be nice if the error message was a bit more helpful than 'nope', and so that I don't have to go source code diving to find why the error happened and what I need to do to fix it.