Bug#1051778: gnuradio: Block "RFNoC Graph (Device)" cannot be used in GNURadio companion

2023-09-12 Thread Thomas Lorblanchès
Seems to be related to this bug/fix: 
https://github.com/gnuradio/gnuradio/commit/8e42db980c891ac4e7a1e9ca4fa10fc0f65b5979



Bug#1051778: gnuradio: Block "RFNoC Graph (Device)" cannot be used in GNURadio companion

2023-09-12 Thread Thomas Lorblanchès
Package: gnuradio
Version: 3.10.5.1-3
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
Under GNURadio companion (Debian 12), I want to use the "RFNoC Graph (Device)" 
block.
   * What exactly did you do (or not do) that was effective (or
 ineffective)?
Drag the "RFNoc Graph (Device)" menu entry and drop it on the flowgraph window.
   * What was the outcome of this action?
The block does not appear in the flowgraph window.
The following error messages are printed in the terminal:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/blocks/_templates.py",
line 77, in render
return template.render(**namespace)
   
  File "/usr/lib/python3/dist-packages/mako/template.py", line 439, in render
return runtime._render(self, self.callable_, args, data)
   ^
  File "/usr/lib/python3/dist-packages/mako/runtime.py", line 874, in _render
_render_context(
  File "/usr/lib/python3/dist-packages/mako/runtime.py", line 916, in
_render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "/usr/lib/python3/dist-packages/mako/runtime.py", line 943, in
_exec_template
callable_(context, *args, **kwargs)
  File "memory:0x7f3068b802d0", line 43, in render_body
  File "/usr/lib/python3.11/ast.py", line 64, in literal_eval
node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
 
  File "/usr/lib/python3.11/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
   ^^
  File "", line 0

SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/Application.py", line
409, in _handle_action
flow_graph_update()
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/Application.py", line
110, in flow_graph_update
fg.update()
  File "/usr/lib/python3/dist-packages/gnuradio/grc/gui/canvas/flowgraph.py",
line 192, in update
self.rewrite()
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line
232, in rewrite
self.renew_namespace()
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line
284, in renew_namespace
for variable_block in self.get_variables():
  
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/FlowGraph.py", line
73, in get_variables
return expr_utils.sort_objects(variables, attrgetter('name'),
methodcaller('get_var_make'))

  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/utils/expr_utils.py",
line 61, in sort_objects
id2expr = {get_id(obj): get_expr(obj) for obj in objects}
  ^^^
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/utils/expr_utils.py",
line 61, in 
id2expr = {get_id(obj): get_expr(obj) for obj in objects}
^
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/blocks/block.py", line
396, in get_var_make
return self.templates.render('var_make')
   ^
  File "/usr/lib/python3/dist-packages/gnuradio/grc/core/blocks/_templates.py",
line 79, in render
raise TemplateError(error, text)
gnuradio.grc.core.errors.TemplateError: (SyntaxError('invalid syntax',
('', 0, 0, '', 0, 0)), '<%\nimport ast\n# Sanitize\n
graph_args = ast.literal_eval(dev_addr.strip())\ndev_args_s =
ast.literal_eval(dev_args.strip())\nclock_source_s =
ast.literal_eval(clock_source.strip())\ntime_source_s =
ast.literal_eval(time_source.strip())\n# Build full dev args\nif
dev_args_s:\ngraph_args += f",{clock_source_s}"\nif
clock_source_s:\ngraph_args += f",clock_source={clock_source_s}"\n
if time_source_s:\ngraph_args +=
f",time_source={time_source_s}"\n%>\nself.rfnoc_graph = ${id} =
uhd.rfnoc_graph(uhd.device_addr("${graph_args}"))\n')

   * What outcome did you expect instead?

*** End of the template - remove these template lines ***


-- System Information:
Debian Release: 12.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-12-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gnuradio depends on:
ii  gnome-terminal [x-terminal-emulator]  3.46.8-1
ii  libboost-program-options1.74.0